Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS-Lab-1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
King Arthur Santos
CS-Lab-1
Commits
1f7e3b95
Commit
1f7e3b95
authored
Mar 07, 2020
by
King Arthur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Passed all the tests.
parent
9f7d3ba6
Pipeline
#913
failed with stages
Changes
10
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
134 additions
and
7 deletions
+134
-7
geckodriver.log
geckodriver.log
+110
-0
urls.cpython-37.pyc
heroes/__pycache__/urls.cpython-37.pyc
+0
-0
detail_cloud.html
heroes/templates/detail_cloud.html
+2
-1
detail_jester.html
heroes/templates/detail_jester.html
+2
-1
detail_sunflowey.html
heroes/templates/detail_sunflowey.html
+2
-1
home.html
heroes/templates/home.html
+3
-0
urls.py
heroes/urls.py
+4
-1
lab1_functional_test.py
lab1_functional_test.py
+7
-3
settings.cpython-37.pyc
willowisp/__pycache__/settings.cpython-37.pyc
+0
-0
settings.py
willowisp/settings.py
+4
-0
No files found.
geckodriver.log
View file @
1f7e3b95
This diff is collapsed.
Click to expand it.
heroes/__pycache__/urls.cpython-37.pyc
View file @
1f7e3b95
No preview for this file type
heroes/templates/detail_cloud.html
View file @
1f7e3b95
...
@@ -4,13 +4,14 @@
...
@@ -4,13 +4,14 @@
<title>
Detail - Cloud
</title>
<title>
Detail - Cloud
</title>
</head>
</head>
<body>
<body>
<img
src=
"
.
/cloud.png"
style=
"width: 10vw;"
/>
<img
src=
"
/static
/cloud.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Cloud
</h1>
<h1>
Detail - Cloud
</h1>
<dl>
<dl>
<dt>
Health Points
</dt><dd>
600
</dd>
<dt>
Health Points
</dt><dd>
600
</dd>
<dt>
Base Attack Damage
</dt><dd>
57
</dd>
<dt>
Base Attack Damage
</dt><dd>
57
</dd>
<dt>
Skills
</dt><dd>
Nimbus, Rain Cloud, Thunderbolt
</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>
<dt>
Lore
</dt><dd>
I am a cloud. When I pee you call it 'rain'.
</dd>
<dt><a
href=
"http://localhost:8000/heroes"
class=
"previous-page"
>
Back to Heroes
</a></dt>
</dl>
</dl>
</body>
</body>
</html>
</html>
\ No newline at end of file
heroes/templates/detail_jester.html
View file @
1f7e3b95
...
@@ -4,13 +4,14 @@
...
@@ -4,13 +4,14 @@
<title>
Detail - Jester
</title>
<title>
Detail - Jester
</title>
</head>
</head>
<body>
<body>
<img
src=
"
.
/jester.png"
style=
"width: 10vw;"
/>
<img
src=
"
/static
/jester.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Jester
</h1>
<h1>
Detail - Jester
</h1>
<dl>
<dl>
<dt>
Health Points
</dt><dd>
660
</dd>
<dt>
Health Points
</dt><dd>
660
</dd>
<dt>
Base Attack Damage
</dt><dd>
64
</dd>
<dt>
Base Attack Damage
</dt><dd>
64
</dd>
<dt>
Skills
</dt><dd>
Laugh, Dance, Smile
</dd>
<dt>
Skills
</dt><dd>
Laugh, Dance, Smile
</dd>
<dt>
Lore
</dt><dd>
I do it for the LOLs.
</dd>
<dt>
Lore
</dt><dd>
I do it for the LOLs.
</dd>
<dt><a
href=
"http://localhost:8000/heroes"
class=
"previous-page"
>
Back to Heroes
</a></dt>
</dl>
</dl>
</body>
</body>
</html>
</html>
\ No newline at end of file
heroes/templates/detail_sunflowey.html
View file @
1f7e3b95
...
@@ -4,13 +4,14 @@
...
@@ -4,13 +4,14 @@
<title>
Detail - Sunflowey
</title>
<title>
Detail - Sunflowey
</title>
</head>
</head>
<body>
<body>
<img
src=
"
.
/sunflowey.png"
style=
"width: 10vw;"
/>
<img
src=
"
/static
/sunflowey.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Sunflowey
</h1>
<h1>
Detail - Sunflowey
</h1>
<dl>
<dl>
<dt>
Health Points
</dt><dd>
650
</dd>
<dt>
Health Points
</dt><dd>
650
</dd>
<dt>
Base Attack Damage
</dt><dd>
43
</dd>
<dt>
Base Attack Damage
</dt><dd>
43
</dd>
<dt>
Skills
</dt><dd>
Power Pellet, Sunshine, Pollen Punch
</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>
<dt>
Lore
</dt><dd>
I am Sunflowey. Sometimes a sun, sometimes a flower.
</dd>
<dt><a
href=
"http://localhost:8000/heroes"
class=
"previous-page"
>
Back to Heroes
</a></dt>
</dl>
</dl>
</body>
</body>
</html>
</html>
\ No newline at end of file
heroes/templates/home.html
View file @
1f7e3b95
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<li
class=
"char-name"
>
Name: Cloud
</li>
<li
class=
"char-name"
>
Name: Cloud
</li>
<li
class=
"char-hp"
>
Health Points: 600
</li>
<li
class=
"char-hp"
>
Health Points: 600
</li>
<li
class=
"char-damage"
>
Base Attack Damage: 57
</li>
<li
class=
"char-damage"
>
Base Attack Damage: 57
</li>
<li><a
href=
"http://localhost:8000/hero/cloud"
class=
"next-page"
>
More info
</a></li>
</ul>
</ul>
</li>
</li>
<li
id=
"char-sunflowey"
><br>
<li
id=
"char-sunflowey"
><br>
...
@@ -17,6 +18,7 @@
...
@@ -17,6 +18,7 @@
<li
class=
"char-name"
>
Name: Sunflowey
</li>
<li
class=
"char-name"
>
Name: Sunflowey
</li>
<li
class=
"char-hp"
>
Health Points: 650
</li>
<li
class=
"char-hp"
>
Health Points: 650
</li>
<li
class=
"char-damage"
>
Base Attack Damage: 43
</li>
<li
class=
"char-damage"
>
Base Attack Damage: 43
</li>
<li><a
href=
"http://localhost:8000/hero/sunflowey"
class=
"next-page"
>
More info
</a></li>
</ul>
</ul>
</li>
</li>
<li
id=
"char-jester"
><br>
<li
id=
"char-jester"
><br>
...
@@ -24,6 +26,7 @@
...
@@ -24,6 +26,7 @@
<li
class=
"char-name"
>
Name: Jester
</li>
<li
class=
"char-name"
>
Name: Jester
</li>
<li
class=
"char-hp"
>
Health Points: 660
</li>
<li
class=
"char-hp"
>
Health Points: 660
</li>
<li
class=
"char-damage"
>
Base Attack Damage: 64
</li>
<li
class=
"char-damage"
>
Base Attack Damage: 64
</li>
<li><a
href=
"http://localhost:8000/hero/jester"
class=
"next-page"
>
More info
</a></li>
</ul>
</ul>
</li>
</li>
</ul>
</ul>
...
...
heroes/urls.py
View file @
1f7e3b95
from
django.conf.urls
import
url
from
django.conf.urls
import
url
from
django.contrib.staticfiles.urls
import
staticfiles_urlpatterns
from
.views
import
HomePageView
from
.views
import
HomePageView
from
.views
import
DetailCloudView
from
.views
import
DetailCloudView
...
@@ -10,4 +11,6 @@ urlpatterns = [
...
@@ -10,4 +11,6 @@ urlpatterns = [
url
(
r"^hero/cloud$"
,
DetailCloudView
.
as_view
(),
name
=
"detail_cloud"
),
url
(
r"^hero/cloud$"
,
DetailCloudView
.
as_view
(),
name
=
"detail_cloud"
),
url
(
r"^hero/sunflowey$"
,
DetailSunfloweyView
.
as_view
(),
name
=
"detail_sunflowey"
),
url
(
r"^hero/sunflowey$"
,
DetailSunfloweyView
.
as_view
(),
name
=
"detail_sunflowey"
),
url
(
r"^hero/jester$"
,
DetailJesterView
.
as_view
(),
name
=
"detail_jester"
),
url
(
r"^hero/jester$"
,
DetailJesterView
.
as_view
(),
name
=
"detail_jester"
),
]
]
\ No newline at end of file
urlpatterns
+=
staticfiles_urlpatterns
()
\ No newline at end of file
lab1_functional_test.py
View file @
1f7e3b95
from
selenium
import
webdriver
from
selenium
import
webdriver
import
unittest
import
unittest
import
time
class
NewVisitorTest
(
unittest
.
TestCase
):
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -19,7 +20,6 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -19,7 +20,6 @@ class NewVisitorTest(unittest.TestCase):
# She sees a list containing three heroes with their corresponding
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
# names, health points, and damage
char_list
=
self
.
browser
.
find_element_by_id
(
"char-list"
)
chars
=
[{
chars
=
[{
"name"
:
"Cloud"
,
"name"
:
"Cloud"
,
"hp"
:
"600"
,
"hp"
:
"600"
,
...
@@ -37,6 +37,8 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -37,6 +37,8 @@ class NewVisitorTest(unittest.TestCase):
}]
}]
for
char
in
chars
:
for
char
in
chars
:
char_list
=
self
.
browser
.
find_element_by_id
(
"char-list"
)
char_element
=
char_list
.
find_element_by_id
(
"char-"
+
char
[
"name"
]
.
lower
())
char_element
=
char_list
.
find_element_by_id
(
"char-"
+
char
[
"name"
]
.
lower
())
for
field
in
char
:
for
field
in
char
:
...
@@ -51,6 +53,8 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -51,6 +53,8 @@ class NewVisitorTest(unittest.TestCase):
next_page_button
=
char_element
.
find_element_by_class_name
(
"next-page"
)
next_page_button
=
char_element
.
find_element_by_class_name
(
"next-page"
)
next_page_button
.
click
()
next_page_button
.
click
()
time
.
sleep
(
1
)
page_source
=
self
.
browser
.
page_source
page_source
=
self
.
browser
.
page_source
self
.
assertIn
(
"Skills"
,
page_source
)
self
.
assertIn
(
"Skills"
,
page_source
)
...
@@ -79,9 +83,9 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -79,9 +83,9 @@ class NewVisitorTest(unittest.TestCase):
previous_page_button
.
click
()
previous_page_button
.
click
()
time
.
sleep
(
1
)
self
.
assertIn
(
'The Will of the Wisps Wiki'
,
self
.
browser
.
title
)
self
.
assertIn
(
'The Will of the Wisps Wiki'
,
self
.
browser
.
title
)
self
.
fail
(
'Finish the test!'
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
unittest
.
main
(
warnings
=
'ignore'
)
\ No newline at end of file
willowisp/__pycache__/settings.cpython-37.pyc
View file @
1f7e3b95
No preview for this file type
willowisp/settings.py
View file @
1f7e3b95
...
@@ -119,3 +119,7 @@ USE_TZ = True
...
@@ -119,3 +119,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL
=
'/static/'
STATIC_URL
=
'/static/'
STATICFILES_DIRS
=
[
os
.
path
.
join
(
BASE_DIR
,
"heroes/templates"
)
]
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment