Skip to content

Commit 8f53c68

Browse files
author
Thomas Thorogood
authored
Webdriver Recorder 5.0 (Selenium 4 and More) (#27)
* Add Docker support * Autodetect platform and chromedriver install directory * Remove cruft files * Bump version to 5.0; update selenium major version * 5.0 Bugfixes and backend feature updates - Improves error-catching story to limit long tracebacks when an element can't be found - Fix occasional circular dependency when loading the browser_context fixture - Support "DISABLE_SESSION_BROWSER" environment variable for use cases where this behavior is not desired. - Remove extra internal setup for the Chrome and Remote classes - Reduce likelihood of temporary worker files getting "stuck" in the report directory; this can still happen with forced terminations - Screenshots are now saved as separate files, instead of being embedded in the report HTML - Reports can now be saved as JSON - Adds annotations to screenshots for smarter handling - Adds utility to export an HTML report from JSON * Update tests for 5.0 features * New template for 5.0 - Test results now collapsed under test name for easier navigation - Screenshots now show any preserved captions - Expand/Collapse all buttons - Button to copy test ID to clipboard - Button to copy test result permalink to clipboard - Ability to only show failed tests * Add "validate-strict.sh" for doing strict checks when pushing * Update documentation; add examples for onboarding. * Restore release workflow that was accidentally removed. * Revert version to alpha build; the workflow should do the actual promotion.
1 parent 0bf2a22 commit 8f53c68

38 files changed

+2927
-765
lines changed

.github/workflows/build-and-validate.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,30 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v1
14-
- uses: actions/setup-python@v2
15-
with:
16-
python-version: 3.7
17-
- uses: abatilo/[email protected]
18-
- uses: nanasess/[email protected]
19-
- run: poetry install
20-
- run: poetry run tox
14+
- uses: abatilo/[email protected]
15+
- uses: nanasess/setup-chromedriver@v1
16+
- run: poetry install --no-interaction
17+
- run: ./validate-strict.sh
18+
id: tox
2119
- if: always()
20+
id: check-artifacts
21+
run: |
22+
ls -alh
23+
if [[ -f "./webdriver-report/report.json" ]]
24+
then
25+
echo "::set-output name=upload-webdriver-report::true"
26+
fi
27+
if [[ -f "./htmlcov/index.html" ]]
28+
then
29+
echo "::set-output name=upload-coverage-report::true"
30+
fi
31+
- if: always() && steps.check-artifacts.outputs.upload-webdriver-report
32+
uses: actions/upload-artifact@v2
33+
with:
34+
name: web test storyboards for for ${{ github.sha }}
35+
path: ./webdriver-report
36+
- if: always() && steps.check-artifacts.outputs.upload-coverage-report
2237
uses: actions/upload-artifact@v2
2338
with:
24-
name: Test reports for ${{ github.sha }}
25-
path: ./webdriver-report/index.html
39+
name: coverage report for ${{ github.sha }}
40+
path: ./htmlcov

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
from a ${{ github.event_name }} at
104104
<${{ env.commit_url }} | commit ${{ steps.configure.outputs.short-sha }}>
105105
106-
- run: poetry run tox
106+
- run: ./validate-strict.sh
107107
id: run-tests
108108

109109
- if: always()

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
webdriver-report/
2+
.docker
23

34
# Byte-compiled / optimized / DLL files
45
__pycache__/
@@ -74,4 +75,3 @@ target/
7475

7576
# pyenv
7677
.python-version
77-

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ghcr.io/uwit-iam/poetry:latest AS env-base
2+
RUN apt-get update && apt-get install -y curl jq
3+
4+
FROM env-base AS poetry-base
5+
WORKDIR /webdriver
6+
COPY pyproject.toml poetry.lock ./
7+
RUN poetry install --no-root --no-interaction
8+
9+
FROM poetry-base as webdriver-source
10+
WORKDIR /webdriver
11+
COPY ./webdriver_recorder ./webdriver_recorder
12+
ENV PYTHONPATH="/webdriver"
13+
COPY ./entrypoint.sh ./
14+
ENTRYPOINT ["/webdriver/entrypoint.sh"]
15+
16+
FROM poetry-base AS webdriver-native
17+
WORKDIR /webdriver
18+
COPY ./webdriver_recorder ./webdriver_recorder
19+
COPY ./entrypoint.sh ./
20+
RUN poetry install --no-interaction && rm pyproject.toml poetry.lock

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)