Skip to content
Snippets Groups Projects
Commit e51662fa authored by Tasneem Natshah's avatar Tasneem Natshah
Browse files

Issue #3380447: Update the "Run cucumber tests" execution for all features saved by the user

parent adae2d88
No related branches found
No related tags found
No related merge requests found
......@@ -172,8 +172,8 @@ class CucumberUiController extends ControllerBase
$report_url = new Url('cucumber_ui.report');
$output = '<iframe id="cucumber-ui-output-iframe" src="' . $this->currentRequest->getSchemeAndHttpHost() . $report_url->toString() . '" width="100%" height="100%"></iframe>';
$beaht_ui_tempstore_collection = $this->tempStore->get('cucumber_ui');
$pid = $beaht_ui_tempstore_collection->get('cucumber_ui_pid');
$cucumber_ui_tempstore_collection = $this->tempStore->get('cucumber_ui');
$pid = $cucumber_ui_tempstore_collection->get('cucumber_ui_pid');
if ($pid && posix_kill(intval($pid), 0)) {
......@@ -231,13 +231,13 @@ class CucumberUiController extends ControllerBase
public function kill()
{
$response = false;
$beaht_ui_tempstore_collection = $this->tempStore->get('cucumber_ui');
$pid = $beaht_ui_tempstore_collection->get('cucumber_ui_pid');
$cucumber_ui_tempstore_collection = $this->tempStore->get('cucumber_ui');
$pid = $cucumber_ui_tempstore_collection->get('cucumber_ui_pid');
if ($pid && posix_kill(intval($pid), 0)) {
try {
$response = posix_kill($pid, SIGKILL);
$beaht_ui_tempstore_collection->delete('cucumber_ui_pid');
$cucumber_ui_tempstore_collection->delete('cucumber_ui_pid');
}
catch (Exception $e) {
$response = false;
......
......@@ -123,8 +123,8 @@ class CucumberUiRunTests extends FormBase
$html_report_dir = $config->get('html_report_dir');
$log_report_dir = $config->get('log_report_dir');
$beaht_ui_tempstore_collection = $this->tempStore->get('cucumber_ui');
$pid = $beaht_ui_tempstore_collection->get('cucumber_ui_pid');
$cucumber_ui_tempstore_collection = $this->tempStore->get('cucumber_ui');
$pid = $cucumber_ui_tempstore_collection->get('cucumber_ui_pid');
$label = $this->t('Not running');
$class = '';
......@@ -229,8 +229,8 @@ class CucumberUiRunTests extends FormBase
$log_report_dir = $config->get('log_report_dir');
$beaht_ui_tempstore_collection = $this->tempStore->get('cucumber_ui');
$pid = $beaht_ui_tempstore_collection->get('cucumber_ui_pid');
$cucumber_ui_tempstore_collection = $this->tempStore->get('cucumber_ui');
$pid = $cucumber_ui_tempstore_collection->get('cucumber_ui_pid');
$command = '';
......@@ -292,22 +292,22 @@ class CucumberUiRunTests extends FormBase
}
$command .= ';';
$process = new Process($command);
$process->enableOutput();
try {
$process->start();
$new_pid = $process->getPid() + 1;
$this->messenger->addMessage($this->t("Started running tests using prcess ID: @pid", ["@pid" => $new_pid]));
$beaht_ui_tempstore_collection->set('cucumber_ui_pid', $new_pid);
if (!$process->isSuccessful()) {
$this->messenger->addMessage($process->getErrorOutput());
}
}
catch (ProcessFailedException $exception) {
$form_state->setErrorByName('submit_button', $exception->getMessage());
}
// $process = new Process($command);
// $process->enableOutput();
// try {
// $process->start();
// $new_pid = $process->getPid() + 1;
// $this->messenger->addMessage($this->t("Started running tests using prcess ID: @pid", ["@pid" => $new_pid]));
// $cucumber_ui_tempstore_collection->set('cucumber_ui_pid', $new_pid);
// if (!$process->isSuccessful()) {
// $this->messenger->addMessage($process->getErrorOutput());
// }
// }
// catch (ProcessFailedException $exception) {
// $form_state->setErrorByName('submit_button', $exception->getMessage());
// }
}
}
......
......@@ -162,7 +162,7 @@ class CucumberUiSettings extends ConfigFormBase
<div class="panel">
<h3 class="panel__title">' . $this->t('Editing Mode') . '</h3>
<div class="panel__content">',
'#suffix' => '</div></div></div>',
'#suffix' => '</div></div></div></div>',
];
return parent::buildForm($form, $form_state);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment