Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1606821886-practice
Commits
5830ee11
Commit
5830ee11
authored
Nov 06, 2019
by
Farah Alhaniy
Browse files
change to chrome
parent
198c3f56
Pipeline
#24104
passed with stages
in 12 minutes and 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
5830ee11
...
...
@@ -35,12 +35,16 @@ FunctionalTest:
image
:
python:3.7
stage
:
functional_test
before_script
:
-
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
-
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
-
pip3 install -r requirements.txt
-
apt-get update -qq && apt-get install -y -qq unzip
-
apt-get install -
q
y
--fix-missing --no-install-recommends xvfb firefox-esr
-
apt-get install -y
google-chrome-stable
-
apt-get install -y xvfb
-
wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz; mkdir geckodriver; tar -xzf geckodriver-v0.26.0-linux64.tar.gz -C geckodriver; export PATH=$PATH:$PWD/geckodriver;
-
pip3 install -r requirements.txt
-
python3 manage.py migrate --noinput
-
wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
-
unzip chromedriver_linux64.zip
-
python3 manage.py collectstatic --noinput
when
:
on_success
script
:
...
...
functional_tests/base.py
View file @
5830ee11
from
selenium.common.exceptions
import
WebDriverException
from
django.contrib.staticfiles.testing
import
StaticLiveServerTestCase
from
selenium
import
webdriver
from
selenium.webdriver.
firefox
.options
import
Options
from
selenium.webdriver.
chrome
.options
import
Options
import
time
import
environ
...
...
@@ -10,10 +10,14 @@ MAX_WAIT = 10
class
FunctionalTest
(
StaticLiveServerTestCase
):
def
setUp
(
self
):
options
=
Options
()
options
.
headless
=
True
self
.
browser
=
webdriver
.
Firefox
(
options
=
options
)
self
.
browser
.
implicitly_wait
(
5
)
chrome_options
=
Options
()
chrome_options
.
add_argument
(
'--dns-prefetch-disable'
)
chrome_options
.
add_argument
(
'--no-sandbox'
)
chrome_options
.
add_argument
(
'--headless'
)
chrome_options
.
add_argument
(
'disable-gpu'
)
self
.
browser
=
webdriver
.
Chrome
(
'./chromedriver'
,
chrome_options
=
chrome_options
)
self
.
browser
.
implicitly_wait
(
10
)
def
tearDown
(
self
):
self
.
browser
.
quit
()
...
...
functional_tests/test_simple_list_creation.py
View file @
5830ee11
from
.base
import
FunctionalTest
from
selenium
import
webdriver
from
selenium.webdriver.common.keys
import
Keys
from
selenium.webdriver.
firefox
.options
import
Options
from
selenium.webdriver.
chrome
.options
import
Options
...
...
@@ -70,11 +70,14 @@ class NewVisitorTest(FunctionalTest):
## We use a new browser session to make sure that no information
## of Edith's is coming through from cookies etc
self
.
browser
.
quit
()
options
=
Options
()
options
.
headless
=
True
self
.
browser
=
webdriver
.
Firefox
(
options
=
options
)
self
.
browser
.
implicitly_wait
(
5
)
chrome_options
=
Options
()
chrome_options
.
add_argument
(
'--dns-prefetch-disable'
)
chrome_options
.
add_argument
(
'--no-sandbox'
)
chrome_options
.
add_argument
(
'--headless'
)
chrome_options
.
add_argument
(
'disable-gpu'
)
self
.
browser
=
webdriver
.
Chrome
(
'./chromedriver'
,
chrome_options
=
chrome_options
)
self
.
browser
.
implicitly_wait
(
10
)
# Francis visits the home page. There is no sign of Edith's
# list
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment