Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dev: Sleep in test to await save button binding
  • Loading branch information
olleharstedt committed Nov 27, 2017
1 parent d40ea08 commit 33e54ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/controllers/SaveDualScaleAnswerOptionsTest.php
Expand Up @@ -59,7 +59,11 @@ public function setup()
*/
public function tearDown()
{
self::$survey->delete();
if (self::$testSurvey) {
self::$testSurvey->delete();
// NB: Unset so static teardown won't find it.
self::$testSurvey = null;
}
}

/**
Expand Down Expand Up @@ -140,6 +144,8 @@ public function testUsingLinkToEditAnswers()
$answer2 = self::$webDriver->findElement(WebDriverBy::cssSelector('input[name="answer_en_1_1"]'));
$answer2->sendKeys('abc');

sleep(1);

$savebutton = self::$webDriver->findElement(WebDriverBy::id('save-button'));
$savebutton->click();

Expand All @@ -149,6 +155,5 @@ public function testUsingLinkToEditAnswers()

$answers = \Answer::model()->findAllByAttributes(['qid' => $survey->groups[0]->questions[0]->qid]);
$this->assertCount(2, $answers, 'Two answer options saved');

}
}

0 comments on commit 33e54ba

Please sign in to comment.