blob: d44cea10901f1b431ee58b3738bf3ad1f176e5ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<?php
class QuickstartHangmanTestCase extends PradoGenericSelenium2Test
{
function test ()
{
$this->url("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&notheme=true&lang=en");
$this->assertEquals("Hangman Game", $this->title());
$this->assertSourceContains("Medium game; you are allowed 5 misses.");
$this->byXPath("//input[@type='submit' and @value='Play!']")->click();
$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->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->assertSourceContains("You Lose");
$this->byLinkText("Start Again")->click();
$this->pause(50);
$this->byXPath("//input[@type='submit' and @value='Play!']")->click();
$this->assertSourceContains("Please make a guess");
$this->assertSourceContains("maximum of 3");
$this->byLinkText("Give up?")->click();
$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->assertSourceContains("maximum of 5");
}
}
|