@@ -519,7 +519,7 @@ public function scrollToTopOfPage()
519
519
*/
520
520
public function magentoCLI ($ command , $ arguments = null , $ timeout = null )
521
521
{
522
- return $ this ->curlExecMagentoCLI ($ command , $ arguments , $ timeout );
522
+ return $ this ->curlExecMagentoCLI ($ command , $ arguments , $ timeout );
523
523
//TODO: calling bin/magento from pipeline is timing out, needs investigation (ref: MQE-1774)
524
524
// try {
525
525
// return $this->shellExecMagentoCLI($command, $arguments);
@@ -673,19 +673,19 @@ public function fillSecretField($field, $value)
673
673
* Function used to create data that contains sensitive credentials in a <createData> <field> override.
674
674
* The data is decrypted immediately prior to data creation to avoid exposure in console or log.
675
675
*
676
- * @param string $command
677
- * @param null $arguments
678
- * @param int $timeout
676
+ * @param string $command
677
+ * @param null $arguments
678
+ * @param null $timeout
679
679
* @throws TestFrameworkException
680
680
* @return string
681
681
*/
682
- public function magentoCLISecret ($ command , $ timeout , $ arguments = null )
682
+ public function magentoCLISecret ($ command , $ arguments = null , $ timeout = null )
683
683
{
684
684
// to protect any secrets from being printed to console the values are executed only at the webdriver level as a
685
685
// decrypted value
686
686
687
687
$ decryptedCommand = CredentialStore::getInstance ()->decryptAllSecretsInString ($ command );
688
- return $ this ->magentoCLI ($ decryptedCommand , $ timeout , $ arguments );
688
+ return $ this ->magentoCLI ($ decryptedCommand , $ arguments , $ timeout );
689
689
}
690
690
691
691
/**
@@ -837,20 +837,21 @@ public function makeScreenshot($name = null)
837
837
/**
838
838
* Takes given $command and executes it against bin/magento executable. Returns stdout output from the command.
839
839
*
840
- * @param string $command
841
- * @param string $arguments
840
+ * @param string $command
841
+ * @param string $arguments
842
+ * @param integer $timeout
842
843
*
843
844
* @throws \RuntimeException
844
845
* @return string
845
846
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
846
847
*/
847
- private function shellExecMagentoCLI ($ command , $ arguments ): string
848
+ private function shellExecMagentoCLI ($ command , $ arguments, $ timeout ): string
848
849
{
849
850
$ php = PHP_BINDIR ? PHP_BINDIR . DIRECTORY_SEPARATOR . 'php ' : 'php ' ;
850
851
$ binMagento = realpath (MAGENTO_BP . DIRECTORY_SEPARATOR . 'bin ' . DIRECTORY_SEPARATOR . 'magento ' );
851
852
$ command = $ php . ' -f ' . $ binMagento . ' ' . $ command . ' ' . $ arguments ;
852
853
$ process = new Process (escapeshellcmd ($ command ), MAGENTO_BP );
853
- $ process ->setIdleTimeout (60 );
854
+ $ process ->setIdleTimeout ($ timeout );
854
855
$ process ->setTimeout (0 );
855
856
$ exitCode = $ process ->run ();
856
857
if ($ exitCode !== 0 ) {
@@ -867,9 +868,10 @@ private function shellExecMagentoCLI($command, $arguments): string
867
868
* @param string $arguments
868
869
* @param integer $timeout
869
870
*
871
+ * @return string
870
872
* @throws TestFrameworkException
871
873
*/
872
- private function curlExecMagentoCLI ($ command , $ arguments , $ timeout ): string
874
+ private function curlExecMagentoCLI ($ command , $ arguments , $ timeout ): string
873
875
{
874
876
// Remove index.php if it's present in url
875
877
$ baseUrl = rtrim (
0 commit comments