Skip to content

Commit

Permalink
Require SeleniumLibrary 3.3.0 (#11)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bollwyvl authored Jan 6, 2019
1 parent 187bb84 commit 8e5cbf0
Show file tree
Hide file tree
Showing 36 changed files with 429 additions and 242 deletions.
10 changes: 7 additions & 3 deletions anaconda-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@ commands:
env_spec: rfjl37

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

docs:
unix: sphinx-build -M html docs _artifacts/docs
env_spec: rfjl37

docs:watch:
unix: sphinx-autobuild docs _artifacts/docs
env_spec: rfjl37

publish:pypi:
unix: twine upload --repository-url https://upload.pypi.org/legacy/ _artifacts/{sdist,wheel}/*
env_spec: rfjl37
Expand All @@ -102,16 +106,16 @@ env_specs:
- python-chromedriver-binary
- robotframework >=3.1
- robotframework-lint
- robotframework-seleniumlibrary >=3.2
- robotframework-seleniumlibrary >=3.3
- six
- sphinx
- sphinx_rtd_theme
- sphinx-autobuild
- pip:
- nteract_on_jupyter
channels:
- conda-forge
- defaults

rfjl37:
inherit_from:
- robotframework-jupyterlibrary
Expand Down
10 changes: 9 additions & 1 deletion atest/acceptance/classic/10_notebook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ Library Process

*** Test Cases ***
IPython Notebook on Classic
Open Notebook Classic
Open Notebook Classic ${BROWSER}
Launch a new Notebook Classic Notebook
Add and Run Notebook Classic Code Cell print("hello world")
Wait Until Notebook Classic Kernel Is Idle
Current Notebook Classic Cell Output Should Contain hello world
Capture Page Screenshot classic${/}ipython.png

IPython Notebook Outputs on Classic
Open Notebook Classic ${BROWSER}
Launch a new Notebook Classic Notebook
: FOR ${i} IN RANGE ${10}
\ Add and Run Notebook Classic Code Cell print("${i} hello world " * ${i ** 2})
Wait Until Notebook Classic Kernel Is Idle
Screenshot Each Output of Active Notebook Classic Document classic${/}ipython_outputs${/}
4 changes: 2 additions & 2 deletions atest/acceptance/lab/00_shell.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Library Process

*** Test Cases ***
Open JupyterLab
Open JupyterLab
Open JupyterLab ${BROWSER}

Get Help
Open JupyterLab
Open JupyterLab ${BROWSER}
Open With JupyterLab Menu Help About JupyterLab
Capture Element Screenshot css:.jp-Dialog-content lab${/}about.png
Click Element css:${JLAB CSS ACCEPT}
6 changes: 4 additions & 2 deletions atest/acceptance/lab/10_notebook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ Library Process

*** Test Cases ***
IPython Notebook on Lab
Open JupyterLab
Open JupyterLab ${BROWSER}
Launch a new JupyterLab Document
Add and Run JupyterLab Code Cell print("hello world")
Wait Until JupyterLab Kernel Is Idle
Current JupyterLab Cell Output Should Contain hello world
Capture Page Screenshot lab${/}ipython.png
Save JupyterLab Notebook

IPython Notebook Outputs on Lab
Open JupyterLab
Open JupyterLab ${BROWSER}
Launch a new JupyterLab Document
: FOR ${i} IN RANGE ${10}
\ Add and Run JupyterLab Code Cell print("${i} hello world " * ${i ** 2})
Wait Until JupyterLab Kernel Is Idle
Screenshot Each Output of Active JupyterLab Document lab${/}ipython_outputs${/}
Save JupyterLab Notebook
12 changes: 11 additions & 1 deletion atest/acceptance/nteract/10_notebook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@ Library Process

*** Test Cases ***
IPython Notebook on nteract
Open nteract
Open nteract ${BROWSER}
Launch a new nteract Notebook
Add and Run nteract Code Cell print("hello world")
Wait Until nteract Kernel Is Idle
Current nteract Cell Output Should Contain hello world
Capture Page Screenshot nteract${/}ipython.png
Save nteract Notebook

IPython Notebook Outputs on nteract
Open nteract ${BROWSER}
Launch a new nteract Notebook
: FOR ${i} IN RANGE ${10}
\ Add and Run nteract Code Cell print("${i} hello world " * ${i ** 2})
Wait Until nteract Kernel Is Idle
Screenshot Each Output of Active nteract Document nteract${/}ipython_outputs${/}
Save nteract Notebook
8 changes: 6 additions & 2 deletions ci/steps.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ steps:
- ${{ if not(eq(parameters.name, 'Windows')) }}:
- script: python setup.py sdist --dist-dir=_artifacts/sdist
displayName: Build Source Distribution
- script: python -m pip install _artifacts/sdist/robotframework-jupyterlibrary-0.1.0.tar.gz --no-deps --ignore-installed
- script: python -m pip install _artifacts/sdist/robotframework-jupyterlibrary-0.2.0.tar.gz --no-deps --ignore-installed
displayName: Install Source Distribution

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

- script: python -m scripts.atest
Expand All @@ -25,6 +25,10 @@ steps:
- script: BROWSER=headlesschrome python -m scripts.atest
displayName: Test on Chrome

- ${{ if eq(parameters.name, 'Windows') }}:
- script: set "BROWSER=headlesschrome" && python -m scripts.atest
displayName: Test on Chrome

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
Expand Down
2 changes: 1 addition & 1 deletion ci/steps.conda.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ steps:
python-chromedriver-binary
python>=3.6,<3.7
robotframework-lint
robotframework-seleniumlibrary>=3.2
robotframework-seleniumlibrary>=3.3
robotframework>=3.1
sphinx_rtd_theme
- script: pip install nteract_on_jupyter --no-deps --ignore-installed -vv
Expand Down
44 changes: 30 additions & 14 deletions ci/steps.conda.test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
steps:
- task: CondaEnvironment@1
inputs:
createOptions: -c conda-forge -c defaults
createCustomEnvironment: true
updateConda: false
environmentName: robotframework-jupyterlibrary-test
packageSpecs: >
geckodriver
jupyterlab>=0.35
pillow
python-chromedriver-binary
python>=3.6,<3.7
robotframework-seleniumlibrary>=3.2
robotframework>=3.1
- ${{ if not(eq(parameters.name, 'Windows')) }}:
- task: CondaEnvironment@1
inputs:
createOptions: -c conda-forge -c defaults
createCustomEnvironment: true
updateConda: false
environmentName: robotframework-jupyterlibrary-test
packageSpecs: >
geckodriver
jupyterlab>=0.35
pillow
python-chromedriver-binary
python>=3.6,<3.7
robotframework-seleniumlibrary>=3.3
robotframework>=3.1
- ${{ if eq(parameters.name, 'Windows') }}:
- task: CondaEnvironment@1
inputs:
createOptions: -c conda-forge -c defaults
createCustomEnvironment: true
updateConda: false
environmentName: robotframework-jupyterlibrary-test
packageSpecs: >
geckodriver
jupyterlab>=0.35
pillow
python-chromedriver-binary==2.42
python>=3.6,<3.7
robotframework-seleniumlibrary>=3.3
robotframework>=3.1
- script: pip install nteract_on_jupyter --no-deps --ignore-installed -vv
displayName: Pip dependencies
93 changes: 93 additions & 0 deletions docs/CI.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# CI\n",
"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",
"\n",
"- run them against as many real browsers on other operating systems as possible\n",
"- have easy access to human- and machine-readable test results and build assets\n",
"- integration with development tools like GitHub\n",
"\n",
"Enter Continuous Integration (CI). "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Cloud: Multi-Provider\n",
"Historically, Jupyter projects have used a mix of free-as-in-beer-for-open source hosted services:\n",
"- [Appveyor](https://www.appveyor.com) for Windows\n",
"- [Circle-CI](https://circleci.com) for Linux\n",
"- [TravisCI](https://travis-ci.org) for Linux and MacOS\n",
"\n",
"Each brings their own syntax, features, and constraints to building and maintaining robust CI workflows.\n",
"\n",
"> `JupyterLibrary` started on Travis-CI, but as soon as we wanted to support more platforms and browsers..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Cloud: Azure Pipelines\n",
"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",
"\n",
"> `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",
"\n",
"[pipeline]: https://github.com/bollwyvl/robotframework-jupyterlibrary/blob/master/azure-pipelines.yml\n",
"[jobs and steps]: https://github.com/bollwyvl/robotframework-jupyterlibrary/tree/master/ci"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## On-Premises: Jenkins\n",
"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."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Approach: It's Just Scripts\n",
"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",
"- simple\n",
"- cross-platform\n",
"- frequently run outside of your CI\n",
"\n",
"Since this is Jupyter, this boils down to putting as much as possible into platform-independent python (and, when neccessary, nodejs) code. \n",
"\n",
"> `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",
"\n",
"[scripts]: https://github.com/bollwyvl/robotframework-jupyterlibrary/tree/master/scripts\n",
"[anaconda-project]: https://github.com/bollwyvl/robotframework-jupyterlibrary/blob/master/anaconda-project.yml"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
52 changes: 52 additions & 0 deletions docs/HISTORY.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# History"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 0.2.0\n",
"- Require SeleniumLibrary 3.3.0 and remove backport of `Press Keys`\n",
"- `Start New Jupyter Server` now has a default `command` of `jupyter-notebook` (instead of `jupyter`)\n",
"- `Build Jupyter Server Arguments` no longer returns `notebook` as the first argument\n",
"- Fix homepage URL for PyPI\n",
"- Test on Chrome/Windows"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 0.1.0\n",
"- Initial Release"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
51 changes: 51 additions & 0 deletions docs/LIMITS.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Limits"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## `Press Keys` on MacOS/Chrome\n",
"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",
"\n",
"> **Workaround**\n",
">\n",
"> _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._"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 8e5cbf0

Please sign in to comment.