Skip to content

Commit 8e5cbf0

Browse files
authored
Require SeleniumLibrary 3.3.0 (#11)
* remove backport of presskeys * fix homepage * use jupyter-notebook for canonical command * quoting in bat * autobuild ftw * add changelog and more interlinkage, project command for docs * more fixes'n'stuff * nope, keeping our element screenshot for now * add output screenshotter for classic * eek, actually test on chrome, start working nteract outputs * nteract scrolling * formatting and doc generation output * more chrome devil hunting * just hide the status bar on nteract * use ctrl-enter in classic * add handlig for osx flower key * bye bye press keys * some more docs * wait for idle kernel on lab notebook launch * try waiting for kernel indicator first * try just sleeping * more waiting * eek apply css * also more waiting in classic * use a wait
1 parent 187bb84 commit 8e5cbf0

36 files changed

+429
-242
lines changed

anaconda-project.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,18 @@ commands:
7575
env_spec: rfjl37
7676

7777
install:win:
78-
windows: python -m pip install _artifacts\\sdist\\robotframework-jupyterlibrary-0.1.0.tar.gz
78+
windows: python -m pip install _artifacts\\sdist\\robotframework-jupyterlibrary-0.2.0.tar.gz
7979
--no-deps --ignore-installed -vv
8080
env_spec: win_rfjl37
8181

8282
docs:
8383
unix: sphinx-build -M html docs _artifacts/docs
8484
env_spec: rfjl37
8585

86+
docs:watch:
87+
unix: sphinx-autobuild docs _artifacts/docs
88+
env_spec: rfjl37
89+
8690
publish:pypi:
8791
unix: twine upload --repository-url https://upload.pypi.org/legacy/ _artifacts/{sdist,wheel}/*
8892
env_spec: rfjl37
@@ -102,16 +106,16 @@ env_specs:
102106
- python-chromedriver-binary
103107
- robotframework >=3.1
104108
- robotframework-lint
105-
- robotframework-seleniumlibrary >=3.2
109+
- robotframework-seleniumlibrary >=3.3
106110
- six
107111
- sphinx
108112
- sphinx_rtd_theme
113+
- sphinx-autobuild
109114
- pip:
110115
- nteract_on_jupyter
111116
channels:
112117
- conda-forge
113118
- defaults
114-
115119
rfjl37:
116120
inherit_from:
117121
- robotframework-jupyterlibrary

atest/acceptance/classic/10_notebook.robot

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ Library Process
66

77
*** Test Cases ***
88
IPython Notebook on Classic
9-
Open Notebook Classic
9+
Open Notebook Classic ${BROWSER}
1010
Launch a new Notebook Classic Notebook
1111
Add and Run Notebook Classic Code Cell print("hello world")
1212
Wait Until Notebook Classic Kernel Is Idle
1313
Current Notebook Classic Cell Output Should Contain hello world
1414
Capture Page Screenshot classic${/}ipython.png
15+
16+
IPython Notebook Outputs on Classic
17+
Open Notebook Classic ${BROWSER}
18+
Launch a new Notebook Classic Notebook
19+
: FOR ${i} IN RANGE ${10}
20+
\ Add and Run Notebook Classic Code Cell print("${i} hello world " * ${i ** 2})
21+
Wait Until Notebook Classic Kernel Is Idle
22+
Screenshot Each Output of Active Notebook Classic Document classic${/}ipython_outputs${/}

atest/acceptance/lab/00_shell.robot

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Library Process
66

77
*** Test Cases ***
88
Open JupyterLab
9-
Open JupyterLab
9+
Open JupyterLab ${BROWSER}
1010

1111
Get Help
12-
Open JupyterLab
12+
Open JupyterLab ${BROWSER}
1313
Open With JupyterLab Menu Help About JupyterLab
1414
Capture Element Screenshot css:.jp-Dialog-content lab${/}about.png
1515
Click Element css:${JLAB CSS ACCEPT}

atest/acceptance/lab/10_notebook.robot

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ Library Process
77

88
*** Test Cases ***
99
IPython Notebook on Lab
10-
Open JupyterLab
10+
Open JupyterLab ${BROWSER}
1111
Launch a new JupyterLab Document
1212
Add and Run JupyterLab Code Cell print("hello world")
1313
Wait Until JupyterLab Kernel Is Idle
1414
Current JupyterLab Cell Output Should Contain hello world
1515
Capture Page Screenshot lab${/}ipython.png
16+
Save JupyterLab Notebook
1617

1718
IPython Notebook Outputs on Lab
18-
Open JupyterLab
19+
Open JupyterLab ${BROWSER}
1920
Launch a new JupyterLab Document
2021
: FOR ${i} IN RANGE ${10}
2122
\ Add and Run JupyterLab Code Cell print("${i} hello world " * ${i ** 2})
2223
Wait Until JupyterLab Kernel Is Idle
2324
Screenshot Each Output of Active JupyterLab Document lab${/}ipython_outputs${/}
25+
Save JupyterLab Notebook

atest/acceptance/nteract/10_notebook.robot

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@ Library Process
66

77
*** Test Cases ***
88
IPython Notebook on nteract
9-
Open nteract
9+
Open nteract ${BROWSER}
1010
Launch a new nteract Notebook
1111
Add and Run nteract Code Cell print("hello world")
1212
Wait Until nteract Kernel Is Idle
1313
Current nteract Cell Output Should Contain hello world
1414
Capture Page Screenshot nteract${/}ipython.png
15+
Save nteract Notebook
16+
17+
IPython Notebook Outputs on nteract
18+
Open nteract ${BROWSER}
19+
Launch a new nteract Notebook
20+
: FOR ${i} IN RANGE ${10}
21+
\ Add and Run nteract Code Cell print("${i} hello world " * ${i ** 2})
22+
Wait Until nteract Kernel Is Idle
23+
Screenshot Each Output of Active nteract Document nteract${/}ipython_outputs${/}
24+
Save nteract Notebook

ci/steps.common.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ steps:
99
- ${{ if not(eq(parameters.name, 'Windows')) }}:
1010
- script: python setup.py sdist --dist-dir=_artifacts/sdist
1111
displayName: Build Source Distribution
12-
- script: python -m pip install _artifacts/sdist/robotframework-jupyterlibrary-0.1.0.tar.gz --no-deps --ignore-installed
12+
- script: python -m pip install _artifacts/sdist/robotframework-jupyterlibrary-0.2.0.tar.gz --no-deps --ignore-installed
1313
displayName: Install Source Distribution
1414

1515
- ${{ if eq(parameters.name, 'Windows') }}:
1616
- script: python setup.py sdist --dist-dir=_artifacts\sdist
1717
displayName: Build Source Distribution
18-
- script: python -m pip install _artifacts\sdist\robotframework-jupyterlibrary-0.1.0.tar.gz --no-deps --ignore-installed
18+
- script: python -m pip install _artifacts\sdist\robotframework-jupyterlibrary-0.2.0.tar.gz --no-deps --ignore-installed
1919
displayName: Install Source Distribution
2020

2121
- script: python -m scripts.atest
@@ -25,6 +25,10 @@ steps:
2525
- script: BROWSER=headlesschrome python -m scripts.atest
2626
displayName: Test on Chrome
2727

28+
- ${{ if eq(parameters.name, 'Windows') }}:
29+
- script: set "BROWSER=headlesschrome" && python -m scripts.atest
30+
displayName: Test on Chrome
31+
2832
- task: PublishTestResults@2
2933
displayName: Publish Test Results
3034
inputs:

ci/steps.conda.full.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ steps:
1818
python-chromedriver-binary
1919
python>=3.6,<3.7
2020
robotframework-lint
21-
robotframework-seleniumlibrary>=3.2
21+
robotframework-seleniumlibrary>=3.3
2222
robotframework>=3.1
2323
sphinx_rtd_theme
2424
- script: pip install nteract_on_jupyter --no-deps --ignore-installed -vv

ci/steps.conda.test.yml

+30-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
steps:
2-
- task: CondaEnvironment@1
3-
inputs:
4-
createOptions: -c conda-forge -c defaults
5-
createCustomEnvironment: true
6-
updateConda: false
7-
environmentName: robotframework-jupyterlibrary-test
8-
packageSpecs: >
9-
geckodriver
10-
jupyterlab>=0.35
11-
pillow
12-
python-chromedriver-binary
13-
python>=3.6,<3.7
14-
robotframework-seleniumlibrary>=3.2
15-
robotframework>=3.1
2+
- ${{ if not(eq(parameters.name, 'Windows')) }}:
3+
- task: CondaEnvironment@1
4+
inputs:
5+
createOptions: -c conda-forge -c defaults
6+
createCustomEnvironment: true
7+
updateConda: false
8+
environmentName: robotframework-jupyterlibrary-test
9+
packageSpecs: >
10+
geckodriver
11+
jupyterlab>=0.35
12+
pillow
13+
python-chromedriver-binary
14+
python>=3.6,<3.7
15+
robotframework-seleniumlibrary>=3.3
16+
robotframework>=3.1
17+
- ${{ if eq(parameters.name, 'Windows') }}:
18+
- task: CondaEnvironment@1
19+
inputs:
20+
createOptions: -c conda-forge -c defaults
21+
createCustomEnvironment: true
22+
updateConda: false
23+
environmentName: robotframework-jupyterlibrary-test
24+
packageSpecs: >
25+
geckodriver
26+
jupyterlab>=0.35
27+
pillow
28+
python-chromedriver-binary==2.42
29+
python>=3.6,<3.7
30+
robotframework-seleniumlibrary>=3.3
31+
robotframework>=3.1
1632
- script: pip install nteract_on_jupyter --no-deps --ignore-installed -vv
1733
displayName: Pip dependencies

docs/CI.ipynb

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# CI\n",
8+
"At first, you'll want to write your tests locally, and test them against as many local browsers as possible. However, to really test out your features, you'll want to:\n",
9+
"\n",
10+
"- run them against as many real browsers on other operating systems as possible\n",
11+
"- have easy access to human- and machine-readable test results and build assets\n",
12+
"- integration with development tools like GitHub\n",
13+
"\n",
14+
"Enter Continuous Integration (CI). "
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {},
20+
"source": [
21+
"## Cloud: Multi-Provider\n",
22+
"Historically, Jupyter projects have used a mix of free-as-in-beer-for-open source hosted services:\n",
23+
"- [Appveyor](https://www.appveyor.com) for Windows\n",
24+
"- [Circle-CI](https://circleci.com) for Linux\n",
25+
"- [TravisCI](https://travis-ci.org) for Linux and MacOS\n",
26+
"\n",
27+
"Each brings their own syntax, features, and constraints to building and maintaining robust CI workflows.\n",
28+
"\n",
29+
"> `JupyterLibrary` started on Travis-CI, but as soon as we wanted to support more platforms and browsers..."
30+
]
31+
},
32+
{
33+
"cell_type": "markdown",
34+
"metadata": {},
35+
"source": [
36+
"## Cloud: Azure Pipelines\n",
37+
"At the risk of putting all your eggs in one (proprietary) basket, [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) provides a single-file approach to automating all of your tests against reasonably modern versions of browsers. \n",
38+
"\n",
39+
"> `JupyterLibrary` is itself built on Azure, and looking at the [pipeline][] and various [jobs and steps][] used can provide the best patterns we have found.\n",
40+
"\n",
41+
"[pipeline]: https://github.com/bollwyvl/robotframework-jupyterlibrary/blob/master/azure-pipelines.yml\n",
42+
"[jobs and steps]: https://github.com/bollwyvl/robotframework-jupyterlibrary/tree/master/ci"
43+
]
44+
},
45+
{
46+
"cell_type": "markdown",
47+
"metadata": {},
48+
"source": [
49+
"## On-Premises: Jenkins\n",
50+
"If you are working on in-house projects, and/or have the ability to support it, [Jenkins](https://jenkins.io) is the gold standard for self-hosted continuous integration. It has almost limitless configurability, and commercial support is available."
51+
]
52+
},
53+
{
54+
"cell_type": "markdown",
55+
"metadata": {},
56+
"source": [
57+
"## Approach: It's Just Scripts\n",
58+
"No matter how shiny or magical your continuous integration tools appear the long-term well-being of your repo depends on techniques that are: \n",
59+
"- simple\n",
60+
"- cross-platform\n",
61+
"- frequently run outside of your CI\n",
62+
"\n",
63+
"Since this is Jupyter, this boils down to putting as much as possible into platform-independent python (and, when neccessary, nodejs) code. \n",
64+
"\n",
65+
"> `JupyterLibrary` uses a small collection of [scripts][], not shipped as part of the distribution, which handle the pipeline. In addition, this library uses [anaconda-project][] to manage multiple environment versions, and to combine multiple script invocations with different parameters into small, easy-to-remember (and complete) commands. Unfortunately, some of these approaches don't _quite_ work in Azure Pipelines, so some duplication of commands and dependencies are present.\n",
66+
"\n",
67+
"[scripts]: https://github.com/bollwyvl/robotframework-jupyterlibrary/tree/master/scripts\n",
68+
"[anaconda-project]: https://github.com/bollwyvl/robotframework-jupyterlibrary/blob/master/anaconda-project.yml"
69+
]
70+
}
71+
],
72+
"metadata": {
73+
"kernelspec": {
74+
"display_name": "Python 3",
75+
"language": "python",
76+
"name": "python3"
77+
},
78+
"language_info": {
79+
"codemirror_mode": {
80+
"name": "ipython",
81+
"version": 3
82+
},
83+
"file_extension": ".py",
84+
"mimetype": "text/x-python",
85+
"name": "python",
86+
"nbconvert_exporter": "python",
87+
"pygments_lexer": "ipython3",
88+
"version": "3.7.1"
89+
}
90+
},
91+
"nbformat": 4,
92+
"nbformat_minor": 2
93+
}

docs/HISTORY.ipynb

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# History"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"## 0.2.0\n",
15+
"- Require SeleniumLibrary 3.3.0 and remove backport of `Press Keys`\n",
16+
"- `Start New Jupyter Server` now has a default `command` of `jupyter-notebook` (instead of `jupyter`)\n",
17+
"- `Build Jupyter Server Arguments` no longer returns `notebook` as the first argument\n",
18+
"- Fix homepage URL for PyPI\n",
19+
"- Test on Chrome/Windows"
20+
]
21+
},
22+
{
23+
"cell_type": "markdown",
24+
"metadata": {},
25+
"source": [
26+
"## 0.1.0\n",
27+
"- Initial Release"
28+
]
29+
}
30+
],
31+
"metadata": {
32+
"kernelspec": {
33+
"display_name": "Python 3",
34+
"language": "python",
35+
"name": "python3"
36+
},
37+
"language_info": {
38+
"codemirror_mode": {
39+
"name": "ipython",
40+
"version": 3
41+
},
42+
"file_extension": ".py",
43+
"mimetype": "text/x-python",
44+
"name": "python",
45+
"nbconvert_exporter": "python",
46+
"pygments_lexer": "ipython3",
47+
"version": "3.7.1"
48+
}
49+
},
50+
"nbformat": 4,
51+
"nbformat_minor": 2
52+
}

docs/LIMITS.ipynb

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Limits"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"## `Press Keys` on MacOS/Chrome\n",
15+
"While SeleniumLibrary 3.3.0 added `Press Keys` which can target non-inputs, as of `chromedriver` version `2.45` the <kbd>⌘</kbd> key cannot be used. As this is the favored key for shortcuts, this means almost all of the client keyboard shortcuts just won't work if you are trying to test on MacOS.\n",
16+
"\n",
17+
"> **Workaround**\n",
18+
">\n",
19+
"> _If you are trying to `Press Keys` where the <kbd>⌘</kbd> key would be used, try to find a combination of simpler key combinations and mouse clicks._"
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": null,
25+
"metadata": {},
26+
"outputs": [],
27+
"source": []
28+
}
29+
],
30+
"metadata": {
31+
"kernelspec": {
32+
"display_name": "Python 3",
33+
"language": "python",
34+
"name": "python3"
35+
},
36+
"language_info": {
37+
"codemirror_mode": {
38+
"name": "ipython",
39+
"version": 3
40+
},
41+
"file_extension": ".py",
42+
"mimetype": "text/x-python",
43+
"name": "python",
44+
"nbconvert_exporter": "python",
45+
"pygments_lexer": "ipython3",
46+
"version": "3.7.1"
47+
}
48+
},
49+
"nbformat": 4,
50+
"nbformat_minor": 2
51+
}

0 commit comments

Comments
 (0)