Commit 8a27ddd6 authored by King Arthur's avatar King Arthur

Edited the home page to pass the functional test.

parent d8945a36
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<title>Detail - Cloud</title>
</head>
<body>
<img src="./cloud.png" style="width: 10vw;" />
<h1>Detail - Cloud</h1>
<dl>
<dt>Health Points</dt><dd>600</dd>
<dt>Base Attack Damage</dt><dd>57</dd>
<dt>Skills</dt><dd>Nimbus, Rain Cloud, Thunderbolt</dd>
<dt>Lore</dt><dd>I am a cloud. When I pee you call it 'rain'.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Jester</title>
</head>
<body>
<img src="./jester.png" style="width: 10vw;"/>
<h1>Detail - Jester</h1>
<dl>
<dt>Health Points</dt><dd>660</dd>
<dt>Base Attack Damage</dt><dd>64</dd>
<dt>Skills</dt><dd>Laugh, Dance, Smile</dd>
<dt>Lore</dt><dd>I do it for the LOLs.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Sunflowey</title>
</head>
<body>
<img src="./sunflowey.png" style="width: 10vw;" />
<h1>Detail - Sunflowey</h1>
<dl>
<dt>Health Points</dt><dd>650</dd>
<dt>Base Attack Damage</dt><dd>43</dd>
<dt>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd>
<dt>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>The Will of the Wisps Wiki</title>
</head>
<body>
<ul id="char-list">
<li id="char-cloud"><br>
<ul>
<li class="char-name">Name: Cloud</li>
<li class="char-hp">Health Points: 600</li>
<li class="char-damage">Base Attack Damage: 57</li>
</ul>
</li>
<li id="char-sunflowey"><br>
<ul>
<li class="char-name">Name: Sunflowey</li>
<li class="char-hp">Health Points: 650</li>
<li class="char-damage">Base Attack Damage: 43</li>
</ul>
</li>
<li id="char-jester"><br>
<ul>
<li class="char-name">Name: Jester</li>
<li class="char-hp">Health Points: 660</li>
<li class="char-damage">Base Attack Damage: 64</li>
</ul>
</li>
</ul>
</body>
</html>
\ No newline at end of file
from selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
def tearDown(self):
self.browser.quit()
def test_can_display_a_heroes_list_and_more_information_per_hero(self):
# Widget has heard about a new wiki app for the game called The Will of the Wisps.
# She goes to check out its homepage
self.browser.get('http://localhost:8000/heroes')
# She notices the page title and header mention
# 'The Will of the Wisps Wiki'
self.assertIn('The Will of the Wisps Wiki', self.browser.title)
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
char_list = self.browser.find_element_by_id("char-list")
chars = [{
"name": "Cloud",
"hp": "600",
"damage": "57"
},
{
"name": "Sunflowey",
"hp": "650",
"damage": "43"
},
{
"name": "Jester",
"hp": "660",
"damage": "64"
}]
for char in chars:
char_element = char_list.find_element_by_id("char-" + char["name"].lower())
for field in char:
field_element = char_element.find_element_by_class_name("char-" + field)
field_element_content = field_element.get_attribute("innerHTML")
self.assertIn(char[field], field_element_content)
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
# She spots the page title and header mentions the name of the hero she selected.
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
# She clicks this and she is redirected back to the wiki's homepage.
self.fail('Finish the test!')
if __name__ == '__main__':
unittest.main(warnings = 'ignore')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment