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
19db5c55
Commit
19db5c55
authored
1 year ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Add Edge. Refactor hostname.
parent
32e10273
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
selenium/tests/test_selenium.py
+18
-8
18 additions, 8 deletions
selenium/tests/test_selenium.py
with
18 additions
and
8 deletions
selenium/tests/test_selenium.py
+
18
−
8
View file @
19db5c55
...
...
@@ -7,7 +7,12 @@ from selenium.webdriver.support import expected_conditions as EC
# https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/python/README.md
# BROWSER = 'chrome'
BROWSER
=
"
firefox
"
# BROWSER = "firefox"
BROWSER
=
"
edge
"
HOST_URL
=
"
http://vipslogic-local.no/
"
#HOST_URL = "https://logic.testvips.nibio.no"
#HOST_URL = "https://logic.vips.nibio.no"
@pytest.fixture
...
...
@@ -20,10 +25,15 @@ def browser():
firefox_options
=
webdriver
.
FirefoxOptions
()
firefox_options
.
headless
=
False
driver
=
webdriver
.
Firefox
(
options
=
firefox_options
)
elif
BROWSER
==
"
edge
"
:
edge_options
=
webdriver
.
EdgeOptions
()
edge_options
.
headless
=
False
driver
=
webdriver
.
Edge
(
options
=
edge_options
)
else
:
raise
Exception
(
"
Browser must be set to either chrome or firefox
"
)
driver
.
get
(
"
http://vipslogic/index.html
"
)
#driver.get("http://vipslogic/index.html")
driver
.
get
(
f
"
{
HOST_URL
}
/index.html
"
)
assert
driver
.
title
==
"
Please log in
"
driver
.
implicitly_wait
(
0.5
)
...
...
@@ -45,7 +55,7 @@ def test_admin_organisms(browser):
link
=
WebDriverWait
(
browser
,
15
).
until
(
EC
.
element_to_be_clickable
((
By
.
XPATH
,
'
//a[text()=
"
Organisms
"
]
'
))
)
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://vipslogic
/organism
"
assert
link
.
get_attribute
(
"
href
"
)
==
f
"
{
HOST_URL
}
/organism
"
link
.
click
()
assert
browser
.
title
==
"
Organisms
"
link
=
WebDriverWait
(
browser
,
15
).
until
(
...
...
@@ -60,7 +70,7 @@ def test_admin_scheduling(browser):
link
=
WebDriverWait
(
browser
,
10
).
until
(
EC
.
element_to_be_clickable
((
By
.
XPATH
,
'
//a[text()=
"
Scheduling
"
]
'
))
)
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://vipslogic
/scheduling
"
assert
link
.
get_attribute
(
"
href
"
)
==
f
"
{
HOST_URL
}
/scheduling
"
link
.
click
()
assert
browser
.
title
==
"
Scheduling overview
"
...
...
@@ -70,7 +80,7 @@ def test_admin_organization_group(browser):
link
=
WebDriverWait
(
browser
,
10
).
until
(
EC
.
element_to_be_clickable
((
By
.
XPATH
,
'
//a[text()=
"
Organization groups
"
]
'
))
)
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://vipslogic
/organizationgroup
"
assert
link
.
get_attribute
(
"
href
"
)
==
f
"
{
HOST_URL
}
/organizationgroup
"
link
.
click
()
assert
browser
.
title
==
"
Organization groups
"
...
...
@@ -80,7 +90,7 @@ def test_admin_apple_fruit_moth(browser):
link
=
WebDriverWait
(
browser
,
10
).
until
(
EC
.
element_to_be_clickable
((
By
.
XPATH
,
'
//a[text()=
"
Apple fruit moth
"
]
'
))
)
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://vipslogic
/applefruitmoth
"
assert
link
.
get_attribute
(
"
href
"
)
==
f
"
{
HOST_URL
}
/applefruitmoth
"
link
.
click
()
assert
browser
.
title
==
"
Rognebærmøllstasjoner
"
...
...
@@ -90,7 +100,7 @@ def test_admin_users(browser):
link
=
WebDriverWait
(
browser
,
20
).
until
(
EC
.
element_to_be_clickable
((
By
.
XPATH
,
'
//a[text()=
"
Users
"
]
'
))
)
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://vipslogic
/user
"
assert
link
.
get_attribute
(
"
href
"
)
==
f
"
{
HOST_URL
}
/user
"
link
.
click
()
WebDriverWait
(
browser
,
20
).
until
(
EC
.
visibility_of_element_located
((
By
.
XPATH
,
"
//h1[text()=
'
Users
'
]
"
))
...
...
@@ -103,7 +113,7 @@ def test_admin_forecasts(browser):
link
=
WebDriverWait
(
browser
,
20
).
until
(
EC
.
element_to_be_clickable
((
By
.
XPATH
,
'
//a[text()=
"
Forecasts
"
]
'
))
)
assert
link
.
get_attribute
(
"
href
"
)
==
"
http://vipslogic
/forecastConfiguration
"
assert
link
.
get_attribute
(
"
href
"
)
==
f
"
{
HOST_URL
}
/forecastConfiguration
"
link
.
click
()
WebDriverWait
(
browser
,
20
).
until
(
EC
.
visibility_of_element_located
((
By
.
XPATH
,
"
//h1[text()=
'
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