Skip to content

Commit 99f8752

Browse files
committed
Merge remote-tracking branch 'origin/develop' into MQE-1379
# Conflicts: # src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php
2 parents 01f0847 + 580d6dc commit 99f8752

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use Magento\FunctionalTestingFramework\Util\ConfigSanitizerUtil;
2222
use Yandex\Allure\Adapter\AllureException;
2323
use Magento\FunctionalTestingFramework\Util\Protocol\CurlTransport;
24-
use Symfony\Component\Process\Process;
2524
use Yandex\Allure\Adapter\Support\AttachmentSupport;
2625
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
2726
use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
@@ -522,13 +521,35 @@ public function scrollToTopOfPage()
522521
*/
523522
public function magentoCLI($command, $timeout = null, $arguments = null)
524523
{
525-
return $this->curlExecMagentoCLI($command, $timeout, $arguments);
526-
//TODO: calling bin/magento from pipeline is timing out, needs investigation (ref: MQE-1774)
527-
// try {
528-
// return $this->shellExecMagentoCLI($command, $arguments);
529-
// } catch (\Exception $exception) {
530-
// return $this->curlExecMagentoCLI($command, $arguments);
531-
// }
524+
// Remove index.php if it's present in url
525+
$baseUrl = rtrim(
526+
str_replace('index.php', '', rtrim($this->config['url'], '/')),
527+
'/'
528+
);
529+
530+
$apiURL = UrlFormatter::format(
531+
$baseUrl . '/' . ltrim(getenv('MAGENTO_CLI_COMMAND_PATH'), '/'),
532+
false
533+
);
534+
535+
$restExecutor = new WebapiExecutor();
536+
$executor = new CurlTransport();
537+
$executor->write(
538+
$apiURL,
539+
[
540+
'token' => $restExecutor->getAuthToken(),
541+
getenv('MAGENTO_CLI_COMMAND_PARAMETER') => $command,
542+
'arguments' => $arguments,
543+
'timeout' => $timeout,
544+
],
545+
CurlInterface::POST,
546+
[]
547+
);
548+
$response = $executor->read();
549+
$restExecutor->close();
550+
$executor->close();
551+
552+
return $response;
532553
}
533554

534555
/**

0 commit comments

Comments
 (0)