summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/framework/Demos/testHangMan.php
diff options
context:
space:
mode:
authorwei <>2005-12-10 12:14:53 +0000
committerwei <>2005-12-10 12:14:53 +0000
commit2b90f0d2a6ce4c17dde8f69cb8b9d9f9757707b7 (patch)
tree07c15319de131524783a3dda22a0bad5b1b6aae9 /tests/FunctionalTests/framework/Demos/testHangMan.php
parent98215a603fb798cdb4178e49061977544aaa45b7 (diff)
Adding Hangman game functional test.
Diffstat (limited to 'tests/FunctionalTests/framework/Demos/testHangMan.php')
-rw-r--r--tests/FunctionalTests/framework/Demos/testHangMan.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/FunctionalTests/framework/Demos/testHangMan.php b/tests/FunctionalTests/framework/Demos/testHangMan.php
new file mode 100644
index 00000000..e6bc8c94
--- /dev/null
+++ b/tests/FunctionalTests/framework/Demos/testHangMan.php
@@ -0,0 +1,32 @@
+<?php
+
+class testHangMan extends SeleniumTestCase
+{
+ function setup()
+ {
+ $this->open('../../demos/hangman/index.php');
+ }
+
+ function testHangManGame()
+ {
+ $this->assertLocation('hangman/index.php');
+ $this->assertTextPresent('Prado Hangman Game');
+
+ //use xpath to select input with value "HardLevel",
+ //i.e the radio button with value "HardLevel"
+ $this->click('//input[@value="HardLevel"]');
+ $this->clickAndWait('//input[@value="Play!"]');
+
+ //try 3 alphabets that sure doesn't exists
+ $this->clickAndWait('link=X');
+ $this->assertTextPresent('made 1 bad guesses');
+
+ $this->clickAndWait('link=J');
+ $this->assertTextPresent('made 2 bad guesses');
+
+ $this->clickAndWait('link=Q');
+ $this->assertTextPresent('You Lose!');
+ }
+}
+
+?> \ No newline at end of file