Skip to content

Commit

Permalink
Fixed issue #18808: Mandatory soft only works once per survey if over…
Browse files Browse the repository at this point in the history
… multiple pages/groups (#3119)

* Fixed issue #18808: Mandatory soft only works once per survey if over multiple pages/groups

* Dev: Add test

* Dev: wait for clickable status

* Dev: wait for move next button
Dev: wait for mandatory soft link

* Dev: max 1 second

* Dev: oups

* Dev: Use
  • Loading branch information
Shnoulle committed Jun 2, 2023
1 parent 6181e6c commit 6439cb1
Show file tree
Hide file tree
Showing 4 changed files with 1,160 additions and 9 deletions.
4 changes: 0 additions & 4 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -546,10 +546,6 @@ public function run($surveyid, $args)
if (!empty($_SESSION[$this->LEMsessid]['token']) and $this->aSurveyInfo['anonymized'] != 'Y') {
$this->aSurveyInfo['hiddenInputs'] .= \CHtml::hiddenField('token', $_SESSION[$this->LEMsessid]['token'], array('id' => 'token'));
}
/* Set sof man to true if it's already in POST */
if (App()->request->getPost('mandSoft')) {
$this->aSurveyInfo['hiddenInputs'] .= \CHtml::hiddenField('mandSoft', App()->request->getPost('mandSoft'), array('id' => 'mandSoft'));
}
}

// For "clear all" buttons
Expand Down
7 changes: 6 additions & 1 deletion tests/LimeSurveyWebDriver.php
Expand Up @@ -4,6 +4,7 @@

use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\WebDriverExpectedCondition;
use Facebook\WebDriver\Exception\NoSuchElementException;

/**
Expand Down Expand Up @@ -85,7 +86,11 @@ public function answerTextQuestion($sgqa, $answer)
*/
public function next()
{
$nextButton = $this->findElement(WebDriverBy::id('ls-button-submit'));
$nextButton = $this->wait(1)->until(
WebDriverExpectedCondition::elementToBeClickable(
WebDriverBy::id('ls-button-submit')
)
);
$nextButton->click();
}

Expand Down

0 comments on commit 6439cb1

Please sign in to comment.