This action runs end-to-end tests generated from Selenium IDE and generates a report based on the results. Failed tests will have screenshots uploaded as artifacts.
Currently, tests are run in the Chrome browser only. However, I am planning on eventually adding other browsers in the future. Contributions are also welcome!
-
Download Selenium IDE extension for either Chrome or Firefox
-
Create a new project and add your tests using the extension.
-
Export the file in the
.side
format and save it anywhere in your repository. -
Add one of the example snippets as a starting point and you're good to go!
Input | Required | Description |
---|---|---|
url | false | The Base URL to use when running the tests. Defaults to the url in the project. |
token | true | The ${{secrets.GITHUB_TOKEN}} or a Personal Access Token to authenticate with the Docker Registry. |
name: Run Website E2E Tests
on: [push, pull_request]
jobs:
build:
permissions:
statuses: write
checks: write
contents: write
pull-requests: write
actions: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Website E2E Tests
uses: Dylan700/selenium-ide-action@latest
with:
token: ${{secrets.GITHUB_TOKEN}}
name: Run Website E2E Tests
on: [push, pull_request]
jobs:
build:
permissions:
statuses: write
checks: write
contents: write
pull-requests: write
actions: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Website E2E Tests
uses: Dylan700/selenium-ide-action@latest
with:
url: http://development.mysite.com
token: ${{secrets.GITHUB_TOKEN}}
The nature of automated browser testing can be flaky. Please be aware that tests may fail due to services such as Cloudflare blocking the requests or issues with loading times etc.
Warning
Make sure your workflow file includes permissions as shown in the example file. Not including these permissions will cause the report generation to fail.
Contributions are welcome! If you have something to add or fix, just make a pull request to be reviewed. I can also point you in the right direction if you need assistance.
If you would like to run the main dockerfile locally for testing, just execute the run.sh
file. Don't forget to also include a .side
file to be discovered!