diff options
author | David <ottodavid@gmx.net> | 2015-08-06 18:12:45 +0200 |
---|---|---|
committer | David <ottodavid@gmx.net> | 2015-08-06 18:14:04 +0200 |
commit | bdfd9f07f17de1751a7e4d94940acb426af4be77 (patch) | |
tree | 093d0e40504e0ece761733780934e0d6f09888fe /tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php | |
parent | 1feb1e95660fdfeb5b6d9e12c6fe085aa2bec5ad (diff) |
Fix tests
work around stale references by explicitly waiting
Diffstat (limited to 'tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php')
-rwxr-xr-x | tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php index 8f5557ca..d44cea10 100755 --- a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php +++ b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php @@ -6,27 +6,34 @@ class QuickstartHangmanTestCase extends PradoGenericSelenium2Test { $this->url("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&notheme=true&lang=en"); $this->assertEquals("Hangman Game", $this->title()); - $this->assertContains("Medium game; you are allowed 5 misses.", $this->source()); + $this->assertSourceContains("Medium game; you are allowed 5 misses."); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); - $this->assertContains("You must choose a difficulty level", $this->source()); + $this->assertSourceContains("You must choose a difficulty level"); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); + $this->pause(50); $this->byXPath("//input[@name='ctl0\$body\$LevelSelection' and @value='3']")->click(); + $this->pause(50); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); - $this->assertContains("Please make a guess", $this->source()); - $this->assertContains("maximum of 3", $this->source()); + $this->assertSourceContains("Please make a guess"); + $this->assertSourceContains("maximum of 3"); $this->byLinkText("B")->click(); + $this->pause(50); $this->byLinkText("F")->click(); + $this->pause(50); $this->byLinkText("Give up?")->click(); - $this->assertContains("You Lose", $this->source()); + $this->assertSourceContains("You Lose"); $this->byLinkText("Start Again")->click(); + $this->pause(50); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); - $this->assertContains("Please make a guess", $this->source()); - $this->assertContains("maximum of 3", $this->source()); + $this->assertSourceContains("Please make a guess"); + $this->assertSourceContains("maximum of 3"); $this->byLinkText("Give up?")->click(); - $this->assertContains("You Lose", $this->source()); + $this->assertSourceContains("You Lose"); $this->byLinkText("Start Again")->click(); + $this->pause(50); $this->byXPath("//input[@name='ctl0\$body\$LevelSelection' and @value='5']")->click(); + $this->pause(50); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); - $this->assertContains("maximum of 5", $this->source()); + $this->assertSourceContains("maximum of 5"); } } |