Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSLogic
Commits
9e31e9cb
Commit
9e31e9cb
authored
1 year ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
test: Add tests for users and forecasts
parent
72af8825
No related branches found
No related tags found
1 merge request
!154
Merge all Wildfly 26 compatible updates into develop
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
selenium/Makefile
+1
-1
1 addition, 1 deletion
selenium/Makefile
selenium/tests/test_selenium.py
+22
-1
22 additions, 1 deletion
selenium/tests/test_selenium.py
with
23 additions
and
2 deletions
selenium/Makefile
+
1
−
1
View file @
9e31e9cb
...
@@ -6,7 +6,7 @@ venv/touchfile: requirements.txt
...
@@ -6,7 +6,7 @@ venv/touchfile: requirements.txt
touch
.venv/touchfile
touch
.venv/touchfile
test
:
venv
test
:
venv
@
echo
'Run
ning Django application locally
'
@
echo
'Run
selenium tests
'
.
.venv/bin/activate
\
.
.venv/bin/activate
\
&&
pytest
&&
pytest
This diff is collapsed.
Click to expand it.
selenium/tests/test_selenium.py
+
22
−
1
View file @
9e31e9cb
...
@@ -10,7 +10,8 @@ from selenium.webdriver.support import expected_conditions as EC
...
@@ -10,7 +10,8 @@ from selenium.webdriver.support import expected_conditions as EC
@pytest.fixture
@pytest.fixture
def
browser
():
def
browser
():
chrome_options
=
webdriver
.
ChromeOptions
()
chrome_options
=
webdriver
.
ChromeOptions
()
chrome_options
.
add_argument
(
"
--headless
"
)
# Uncomment line below to prevent Chrome from opening
# chrome_options.add_argument("--headless")
driver
=
webdriver
.
Chrome
(
options
=
chrome_options
)
driver
=
webdriver
.
Chrome
(
options
=
chrome_options
)
driver
.
get
(
"
http://localhost/index.html
"
)
driver
.
get
(
"
http://localhost/index.html
"
)
...
@@ -72,3 +73,23 @@ def test_admin_apple_fruit_moth(browser):
...
@@ -72,3 +73,23 @@ def test_admin_apple_fruit_moth(browser):
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://localhost/applefruitmoth
"
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://localhost/applefruitmoth
"
link
.
click
()
link
.
click
()
assert
browser
.
title
==
"
Rognebærmøllstasjoner
"
assert
browser
.
title
==
"
Rognebærmøllstasjoner
"
def
test_admin_users
(
browser
):
browser
.
find_element
(
By
.
XPATH
,
'
//a[text()=
"
Admin
"
]
'
).
click
()
link
=
WebDriverWait
(
browser
,
20
).
until
(
EC
.
element_to_be_clickable
((
By
.
XPATH
,
'
//a[text()=
"
Users
"
]
'
))
)
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://localhost/user
"
link
.
click
()
assert
browser
.
title
==
"
Users
"
def
test_admin_forecasts
(
browser
):
browser
.
find_element
(
By
.
XPATH
,
'
//a[text()=
"
Admin
"
]
'
).
click
()
link
=
WebDriverWait
(
browser
,
20
).
until
(
EC
.
element_to_be_clickable
((
By
.
XPATH
,
'
//a[text()=
"
Forecasts
"
]
'
))
)
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://localhost/forecastConfiguration
"
link
.
click
()
assert
browser
.
title
==
"
Forecasts
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment