Commit 5daba02a authored by Santino Campos's avatar Santino Campos

Fix functionnal test for detais of hero in details page

parent 67e8d8db
......@@ -12,5 +12,7 @@
<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>
<a href="http://localhost:8000/heroes"><button>Back to Heroes List </button> </a>
</body>
</html>
\ No newline at end of file
</html>
......@@ -25,72 +25,21 @@ class NewVisitorTest(unittest.TestCase):
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
self.browser.get('http://localhost:8000/hero/sunflowey')
self.assertIn('Detail - Sunflowey', self.browser.title)
self.assertIn('
<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>
', self.browser.page_source)
self.browser.get('http://localhost:8000/hero/jester')
self.assertIn('Detail - Jester', self.browser.title)
self.assertIn('
<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>
', self.browser.page_source)
self.browser.get('http://localhost:8000/hero/cloud')
self.assertIn('Detail - Cloud', self.browser.title)
self.assertIn('<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>', self.browser.page_source)
self.assertIn('<img src="./sunflowey.png" style="width: 10vw;">', self.browser.page_source)
self.assertIn('<dt>Health Points</dt><dd>650</dd>', self.browser.page_source)
self.assertIn('<dt>Base Attack Damage</dt><dd>43</dd>', self.browser.page_source)
self.assertIn('<dt>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd>', self.browser.page_source)
self.assertIn('<dt>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd>', self.browser.page_source)
# She spots the page title and header mentions the name of the hero she selected.
self.assertIn('Detail - Sunflowey', self.browser.title)
# 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.assertIn('<a href="http://localhost:8000/heroes"><button>Back to Heroes List </button> </a>', self.browser.page_source)
self.browser.get('http://localhost:8000/heroes')
self.fail('Finish the test!')
......
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