diff --git a/src/Magento/FunctionalTestingFramework/Console/DoctorCommand.php b/src/Magento/FunctionalTestingFramework/Console/DoctorCommand.php index 4bd05b836..6fc9afa55 100644 --- a/src/Magento/FunctionalTestingFramework/Console/DoctorCommand.php +++ b/src/Magento/FunctionalTestingFramework/Console/DoctorCommand.php @@ -8,6 +8,7 @@ namespace Magento\FunctionalTestingFramework\Console; use Codeception\Configuration; +use Magento\FunctionalTestingFramework\Util\Path\UrlFormatter; use Symfony\Component\EventDispatcher\EventDispatcher; use Codeception\SuiteManager; use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig; @@ -128,9 +129,14 @@ private function checkAuthenticationToMagentoAdmin() $this->ioStyle->success('Successful'); $result = true; } catch (TestFrameworkException $e) { + if (getenv('MAGENTO_BACKEND_BASE_URL')) { + $urlVar = 'MAGENTO_BACKEND_BASE_URL'; + } else { + $urlVar = 'MAGENTO_BASE_URL'; + } $this->ioStyle->error( - $e->getMessage() - . "\nPlease verify MAGENTO_ADMIN_USERNAME and MAGENTO_ADMIN_PASSWORD in .env." + $e->getMessage() . "\nPlease verify if " . $urlVar . ", " + . "MAGENTO_ADMIN_USERNAME and MAGENTO_ADMIN_PASSWORD in .env are valid." ); } return $result; diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriverDoctor.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriverDoctor.php index 98eb8bd4f..1407c957b 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriverDoctor.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriverDoctor.php @@ -15,7 +15,7 @@ */ class MagentoWebDriverDoctor extends MagentoWebDriver { - const MAGENTO_CLI_COMMAND = 'list'; + const MAGENTO_CLI_COMMAND = 'info:currency:list'; const EXCEPTION_CONTEXT_SELENIUM = 'selenium'; const EXCEPTION_CONTEXT_ADMIN = 'admin'; const EXCEPTION_CONTEXT_STOREFRONT = 'store'; @@ -150,18 +150,19 @@ private function loadPageAtUrl($url) private function runMagentoCLI() { try { - $regex = '~^.*(?Magento CLI).*[\r\n]+(?Usage:).*~'; + $regex = '~^.*[\r\n]+.*(?Currency).*(?Code).*~'; $output = parent::magentoCLI(self::MAGENTO_CLI_COMMAND); preg_match($regex, $output, $matches); - if (isset($matches['name']) && isset($matches['usage'])) { + if (isset($matches['name']) && isset($matches['code'])) { return; } } catch (\Exception $e) { - throw new TestFrameworkException( - "Failed to run Magento CLI command\n" - . "Please reference Magento DevDoc to setup command.php and .htaccess files." - ); } + + throw new TestFrameworkException( + "Failed to run Magento CLI command\n" + . "Please reference Magento DevDoc to setup command.php and .htaccess files." + ); } }