Skip to content

Commit 6e7104f

Browse files
authored
Selenium notebook tests (#1311)
1 parent 3c48be0 commit 6e7104f

11 files changed

Lines changed: 260 additions & 220 deletions

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ install:
2727

2828
test_script:
2929
- pip install -e . --no-deps --force-reinstall
30-
- pytest -n 2 -rxXs tests
30+
- pytest -n 2 -rxXs tests --ignore=tests/selenium

.github/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ The basic workflow for contributing is:
7171
pip install -r requirements.txt
7272
pip install -r requirements-dev.txt
7373
```
74-
6. Install Firefox, download [geckodriver](https://github.com/mozilla/geckodriver/releases)
75-
and put it in the PATH.
74+
6. Install Chrome, download [chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) and put it in the PATH.
7675
7. Make changes to your local copy of the folium repository
7776
8. Make sure the tests pass:
7877
* in the repository folder do `pip install -e . --no-deps` (needed for notebook tests)
79-
* run `python -m pytest tests`
8078
* run `flake8 folium --max-line-length=120`
79+
* run `python -m pytest tests --ignore=tests/selenium`
80+
* run `python -m pytest tests/selenium`
8181
* resolve all errors
8282
9. Commit those changes
8383
```

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ examples/results/*
1414
/_mac/*.xml
1515
/inspection/*.xml
1616
geckodriver.log
17+
geckodriver.exe
1718
geckodriver.tar.gz
1819
geckodriver/
20+
chromedriver.exe
21+
chromedriver/
1922
miniconda.sh
23+
latest_logs/
24+
*.nbconvert.ipynb

.travis.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77

88
addons:
99
firefox: latest
10+
# chrome addon fails to install
1011

1112
env:
1213
global:
@@ -21,6 +22,8 @@ matrix:
2122
env: PY=3.7
2223
- name: notebooks-code
2324
env: PY=3.7
25+
- name: selenium
26+
env: PY=3.7
2427
- name: latest-branca
2528
env: PY=3.7
2629
- name: docs
@@ -54,7 +57,18 @@ before_install:
5457
mkdir geckodriver
5558
tar -xzf geckodriver.tar.gz -C geckodriver
5659
export PATH=$PATH:$PWD/geckodriver
57-
60+
# Install Chrome
61+
- |
62+
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
63+
sudo dpkg -i google-chrome-stable_current_amd64.deb
64+
sudo apt-get install -y -f
65+
# sudo dpkg -i google-chrome-stable_current_amd64.deb
66+
# Install chromedriver
67+
- |
68+
wget https://chromedriver.storage.googleapis.com/$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip -O chromedriver.zip
69+
mkdir chromedriver
70+
unzip chromedriver.zip -d chromedriver
71+
export PATH=$PATH:$PWD/chromedriver
5872
5973
# Test source distribution.
6074
install:
@@ -72,13 +86,13 @@ script:
7286
fi
7387

7488
- if [[ $TRAVIS_JOB_NAME == 'default' ]]; then
75-
pytest /tmp -vv --ignore=tests/notebooks/test_notebooks.py ;
89+
pytest /tmp -vv --ignore=/tmp/tests/selenium ;
7690
fi
7791

7892
- if [[ $TRAVIS_JOB_NAME == 'latest-branca' ]]; then
7993
conda uninstall branca ;
8094
pip install git+https://github.com/python-visualization/branca.git ;
81-
pytest /tmp -vv --ignore=tests/notebooks/test_notebooks.py ;
95+
pytest /tmp -vv --ignore=/tmp/tests/selenium ;
8296
fi
8397

8498
- if [[ $TRAVIS_JOB_NAME == 'notebooks-conding-standard' ]]; then
@@ -91,6 +105,10 @@ script:
91105
pytest --nbval-lax /tmp/examples ;
92106
fi
93107

108+
- if [[ $TRAVIS_JOB_NAME == 'selenium' ]]; then
109+
pytest /tmp/tests/selenium -vv ;
110+
fi
111+
94112
# Docs
95113
- |
96114
if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then

examples/GeodedeticImageOverlay.ipynb

Lines changed: 11 additions & 36 deletions
Large diffs are not rendered by default.

examples/Plugins.ipynb

Lines changed: 32 additions & 32 deletions
Large diffs are not rendered by default.

examples/Quickstart.ipynb

Lines changed: 33 additions & 34 deletions
Large diffs are not rendered by default.

examples/SmoothFactor.ipynb

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

examples/TilesExample.ipynb

Lines changed: 19 additions & 99 deletions
Large diffs are not rendered by default.

examples/plugin-PolyLineOffset.ipynb

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)