Skip to content

Commit

Permalink
Webdriver Recorder 5.0 (Selenium 4 and More) (#27)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Thomas Thorogood authored Jan 5, 2022
1 parent 0bf2a22 commit 8f53c68
Show file tree
Hide file tree
Showing 38 changed files with 2,927 additions and 765 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/build-and-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: 3.7
- uses: abatilo/[email protected]
- uses: nanasess/[email protected]
- run: poetry install
- run: poetry run tox
- uses: abatilo/[email protected]
- uses: nanasess/setup-chromedriver@v1
- run: poetry install --no-interaction
- run: ./validate-strict.sh
id: tox
- if: always()
id: check-artifacts
run: |
ls -alh
if [[ -f "./webdriver-report/report.json" ]]
then
echo "::set-output name=upload-webdriver-report::true"
fi
if [[ -f "./htmlcov/index.html" ]]
then
echo "::set-output name=upload-coverage-report::true"
fi
- if: always() && steps.check-artifacts.outputs.upload-webdriver-report
uses: actions/upload-artifact@v2
with:
name: web test storyboards for for ${{ github.sha }}
path: ./webdriver-report
- if: always() && steps.check-artifacts.outputs.upload-coverage-report
uses: actions/upload-artifact@v2
with:
name: Test reports for ${{ github.sha }}
path: ./webdriver-report/index.html
name: coverage report for ${{ github.sha }}
path: ./htmlcov
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
from a ${{ github.event_name }} at
<${{ env.commit_url }} | commit ${{ steps.configure.outputs.short-sha }}>
- run: poetry run tox
- run: ./validate-strict.sh
id: run-tests

- if: always()
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
webdriver-report/
.docker

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -74,4 +75,3 @@ target/

# pyenv
.python-version

16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ghcr.io/uwit-iam/poetry:latest AS env-base
RUN apt-get update && apt-get install -y curl jq

FROM env-base AS poetry-base
WORKDIR /webdriver
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root --no-interaction

FROM poetry-base as webdriver-source
WORKDIR /webdriver
COPY ./webdriver_recorder ./webdriver_recorder
ENV PYTHONPATH="/webdriver"
COPY ./entrypoint.sh ./
ENTRYPOINT ["/webdriver/entrypoint.sh"]

FROM poetry-base AS webdriver-native
WORKDIR /webdriver
COPY ./webdriver_recorder ./webdriver_recorder
COPY ./entrypoint.sh ./
RUN poetry install --no-interaction && rm pyproject.toml poetry.lock
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 8f53c68

Please sign in to comment.