Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
8fe96859
Verified
Commit
8fe96859
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
[Tests] Always run Selenium tests
parent
c7305c36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
biscuit/core/tests/browser/test_selenium.py
+37
-14
37 additions, 14 deletions
biscuit/core/tests/browser/test_selenium.py
poetry.lock
+836
-130
836 additions, 130 deletions
poetry.lock
pyproject.toml
+1
-0
1 addition, 0 deletions
pyproject.toml
tox.ini
+1
-7
1 addition, 7 deletions
tox.ini
with
875 additions
and
151 deletions
biscuit/core/tests/browser/test_selenium.py
+
37
−
14
View file @
8fe96859
import
sys
import
pytest
if
'
--driver
'
not
in
sys
.
argv
:
pytest
.
skip
(
'
Selenium driver not configured
'
,
allow_module_level
=
True
)
from
django.test
import
LiveServerTestCase
webdriver
=
pytest
.
importorskip
(
'
selenium.webdriver
'
)
class
SeleniumTests
(
LiveServerTestCase
):
__test__
=
False
@classmethod
def
setUpClass
(
cls
):
super
().
setUpClass
()
cls
.
selenium
.
set_window_size
(
1920
,
1080
)
cls
.
selenium
.
implicitly_wait
(
10
)
@classmethod
def
tearDownClass
(
cls
):
cls
.
selenium
.
quit
()
super
().
tearDownClass
()
def
test_index
(
self
):
self
.
selenium
.
get
(
self
.
live_server_url
+
'
/
'
)
assert
'
BiscuIT
'
in
self
.
selenium
.
title
self
.
selenium
.
save_screenshot
(
'
screenshots/index.png
'
)
class
SeleniumTestsChromium
(
SeleniumTests
):
__test__
=
True
@classmethod
def
setUpClass
(
cls
):
options
=
webdriver
.
ChromeOptions
()
options
.
add_argument
(
'
--headless
'
)
options
.
add_argument
(
'
--no-headless
'
)
options
.
add_argument
(
'
--disable-shm-usage
'
)
@pytest.fixture
def
chrome_options
(
chrome_options
):
chrome_options
.
add_argument
(
'
--headless
'
)
chrome_options
.
add_argument
(
'
--no-sandbox
'
)
chrome_options
.
add_argument
(
'
--disable-dev-shm-usage
'
)
return
chrome_options
cls
.
selenium
=
webdriver
.
Chrome
(
options
=
options
)
def
test_index
(
selenium
):
selenium
.
get
(
'
http://app:8000/
'
)
assert
'
BiscuIT
'
in
selenium
.
title
selenium
.
save_screenshot
(
'
screenshots/index.png
'
)
super
().
setUpClass
()
This diff is collapsed.
Click to expand it.
poetry.lock
+
836
−
130
View file @
8fe96859
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
0
View file @
8fe96859
...
...
@@ -70,6 +70,7 @@ pytest-django = "^3.7"
pytest-django-testing-postgresql
=
"^0.1"
tox
=
"^3.14"
pytest-cov
=
"^2.8"
selenium
=
"^3.141.0"
[build-system]
requires
=
["poetry>
=
0.12
"]
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
1
−
7
View file @
8fe96859
...
...
@@ -6,13 +6,7 @@ envlist = default
whitelist_externals
=
poetry
pytest
skip_install
=
true
commands
=
pytest -p no:selenium --pylama --cov=biscuit biscuit/core/
[testenv:selenium]
whitelist_externals
=
poetry
pytest
skip_install
=
true
commands
=
pytest --driver {env:SELENIUM_DRIVER:Chrome} biscuit/core/
commands
=
pytest --pylama --cov=biscuit biscuit/core/
[pylama]
linters
=
pycodestyle,pyflakes,radon
...
...
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