File tree 2 files changed +19
-9
lines changed
src/Magento/FunctionalTestingFramework
2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 8
8
namespace Magento \FunctionalTestingFramework \Console ;
9
9
10
10
use Codeception \Configuration ;
11
+ use Magento \FunctionalTestingFramework \Util \Path \UrlFormatter ;
11
12
use Symfony \Component \EventDispatcher \EventDispatcher ;
12
13
use Codeception \SuiteManager ;
13
14
use Magento \FunctionalTestingFramework \Config \MftfApplicationConfig ;
@@ -128,9 +129,17 @@ private function checkAuthenticationToMagentoAdmin()
128
129
$ this ->ioStyle ->success ('Successful ' );
129
130
$ result = true ;
130
131
} catch (TestFrameworkException $ e ) {
132
+ if (getenv ('MAGENTO_BACKEND_BASE_URL ' )) {
133
+ $ urlVar = 'MAGENTO_BACKEND_BASE_URL ' ;
134
+ } else {
135
+ $ urlVar = 'MAGENTO_BASE_URL ' ;
136
+ }
131
137
$ this ->ioStyle ->error (
132
- $ e ->getMessage ()
133
- . "\nPlease verify MAGENTO_ADMIN_USERNAME and MAGENTO_ADMIN_PASSWORD in .env. "
138
+ $ e ->getMessage () . "\n"
139
+ . "Please verify the following configuration settings in .env: \n"
140
+ . $ urlVar . ' = ' . getenv ($ urlVar ) . "\n"
141
+ . "MAGENTO_ADMIN_USERNAME = " . $ e ->getContext ()['MAGENTO_ADMIN_USERNAME ' ] . "\n"
142
+ . "MAGENTO_ADMIN_PASSWORD = " . $ e ->getContext ()['MAGENTO_ADMIN_PASSWORD ' ]
134
143
);
135
144
}
136
145
return $ result ;
Original file line number Diff line number Diff line change 15
15
*/
16
16
class MagentoWebDriverDoctor extends MagentoWebDriver
17
17
{
18
- const MAGENTO_CLI_COMMAND = 'list ' ;
18
+ const MAGENTO_CLI_COMMAND = 'info:currency: list ' ;
19
19
const EXCEPTION_CONTEXT_SELENIUM = 'selenium ' ;
20
20
const EXCEPTION_CONTEXT_ADMIN = 'admin ' ;
21
21
const EXCEPTION_CONTEXT_STOREFRONT = 'store ' ;
@@ -150,18 +150,19 @@ private function loadPageAtUrl($url)
150
150
private function runMagentoCLI ()
151
151
{
152
152
try {
153
- $ regex = '~^.*(?<name>Magento CLI ).*[\r\n]+ (?<usage>Usage: ).*~ ' ;
153
+ $ regex = '~^.*[\r\n]+.* (?<name>Currency ).*(?<code>Code ).*~ ' ;
154
154
$ output = parent ::magentoCLI (self ::MAGENTO_CLI_COMMAND );
155
155
preg_match ($ regex , $ output , $ matches );
156
156
157
- if (isset ($ matches ['name ' ]) && isset ($ matches ['usage ' ])) {
157
+ if (isset ($ matches ['name ' ]) && isset ($ matches ['code ' ])) {
158
158
return ;
159
159
}
160
160
} catch (\Exception $ e ) {
161
- throw new TestFrameworkException (
162
- "Failed to run Magento CLI command \n"
163
- . "Please reference Magento DevDoc to setup command.php and .htaccess files. "
164
- );
165
161
}
162
+
163
+ throw new TestFrameworkException (
164
+ "Failed to run Magento CLI command \n"
165
+ . "Please reference Magento DevDoc to setup command.php and .htaccess files. "
166
+ );
166
167
}
167
168
}
You can’t perform that action at this time.
0 commit comments