Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Espino_181877_Lab1
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
Joaquin
Espino_181877_Lab1
Commits
44e837b2
Commit
44e837b2
authored
Mar 07, 2020
by
Joaquin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Views
parent
8277e6c6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
1 deletion
+59
-1
geckodriver.exe
geckodriver.exe
+0
-0
geckodriver.log
geckodriver.log
+0
-0
urls.py
heroes/urls.py
+10
-0
lab1_functional_test.py
lab1_functional_test.py
+46
-0
settings.py
willowisp/settings.py
+1
-0
urls.py
willowisp/urls.py
+2
-1
No files found.
geckodriver.exe
deleted
100644 → 0
View file @
8277e6c6
File deleted
geckodriver.log
0 → 100644
View file @
44e837b2
heroes/urls.py
View file @
44e837b2
from
django.conf.urls
import
url
from
.views
import
HeroesView
,
CloudView
,
SunfloweyView
,
JesterView
urlpatterns
=
[
url
(
r'^heroes$'
,
HeroesView
.
as_view
(),
name
=
'heroes_show'
),
url
(
r'^hero/clouds$'
,
CloudView
.
as_view
(),
name
=
'cloud_show'
),
url
(
r'^hero/sunflowey$'
,
SunfloweyView
.
as_view
(),
name
=
'sunflowey_show'
),
url
(
r'^hero/jester$'
,
JesterView
.
as_view
(),
name
=
'jester_show'
),
]
\ No newline at end of file
lab1_functional_test.py
0 → 100644
View file @
44e837b2
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
self
.
assertIn
(
self
.
browser
.
current_url
,
'http://localhost:8000/heroes'
)
# 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/cloud'
)
self
.
assertIn
(
'Health Points'
,
self
.
browser
.
find_element_by_id
(
'hero_health'
)
.
text
)
self
.
assertIn
(
'Base Attack Damage'
,
self
.
browser
.
find_element_id
(
'hero_attack'
)
.
text
)
self
.
assertIn
(
'Skills'
,
self
.
browser
.
find_element_id
(
'hero_skills'
)
.
text
)
self
.
assertIn
(
'Lore'
,
self
.
browser
.
find_element_id
(
'hero_lore'
)
.
text
)
self
.
assertIn
(
'.png'
,
self
.
browser
.
find_element_id
(
'hero_image'
)
.
get_attribute
(
'src'
))
# She spots the page title and header mentions the name of the hero she selected.
self
.
assertIn
(
'Detail - '
,
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
.
fail
(
'Finish the test!'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
\ No newline at end of file
willowisp/settings.py
View file @
44e837b2
...
...
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'heroes'
,
]
MIDDLEWARE
=
[
...
...
willowisp/urls.py
View file @
44e837b2
...
...
@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from
django.conf.urls
import
url
from
django.conf.urls
import
include
,
url
from
django.contrib
import
admin
urlpatterns
=
[
url
(
r'^admin/'
,
admin
.
site
.
urls
),
url
(
r''
,
include
(
'heroes.urls'
)),
]
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