Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielweyer/ui-tests
Writing UI tests with Selenium Web Driver and Puppeteer
https://github.com/gabrielweyer/ui-tests
github-actions puppeteer selenium-webdriver ui-testing
Last synced: about 1 month ago
JSON representation
Writing UI tests with Selenium Web Driver and Puppeteer
- Host: GitHub
- URL: https://github.com/gabrielweyer/ui-tests
- Owner: gabrielweyer
- License: mit
- Created: 2018-12-23T00:10:18.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-04-20T16:06:59.000Z (7 months ago)
- Last Synced: 2024-04-20T17:55:59.308Z (7 months ago)
- Topics: github-actions, puppeteer, selenium-webdriver, ui-testing
- Language: C#
- Homepage:
- Size: 1.16 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# UI testing
Web sites have stepped up their defences against malicious activity. As a result I found myself trying to circumvent bot protection which wasn't the intention. I'm keeping this repository but I won't be working on it anymore.
I want to learn how to write UI tests. [Selenium WebDriver][selenium-webdriver] seems to be the most commonly used platform. I also stumbled upon [Puppeteer][puppeteer] and decided to use both libraries.
I decided to test [Goodreads][github] as this is one of the few sites I use that does not require Multi-Factor Authentication.
Over time I hope to see my tests' brittleness exposed which will give me the opportunity to make them more resilient. This example is a bit contrived as teams commonly use data attributes to ease `UI` testing.
As this project is a learning experience I wouldn't recommend being inspired by it (this is even more true for the `Puppeteer` / `TypeScript` tests where I've no idea what I'm doing :joy_cat:).
- [Selenium C# implementation README](./selenium-csharp/README.md)
- [Puppeteer implementation README](./puppeteer/README.md)## Configuration
Some tests require a `Goodreads` account to run.
The configuration of secrets is explained in the [Selenium C#](./selenium-csharp/README.md) and [Puppeteer](./puppeteer/README.md) `READMEs`.
## Tests
- Load a user profile and assert the full name
- Sign-in with a test user and assert that the "My Books" header link is present## Continuous Integration
I'm using [GitHub Actions][github-actions] to run the tests on every commit to `main`.
[![Build Status][github-actions-selenium-shield]][github-actions-selenium]
[![Build Status][github-actions-puppeteer-shield]][github-actions-puppeteer]
The builds steps are versioned with the code as `YAML`:
- [selenium-csharp.yml](./.github/workflows/selenium-csharp.yml)
- [puppeteer.yml](./.github/workflows/puppeteer.yml)The builds are also scheduled to run daily on weekdays. This is to prevent the tests from rotting when no changes are committed to them.
### Common build properties
- Builds are only triggered when the code changes. The `Puppeteer` build will not trigger when there are changes to the `Selenium C#` tests
- When a test fail, the test suite takes a screenshot which is then uploaded as an artifact
- Secret variables are passed as environment variables[selenium-webdriver]: https://www.seleniumhq.org/projects/webdriver/
[puppeteer]: https://developers.google.com/web/tools/puppeteer/
[github]: https://github.com/
[github-actions-selenium-shield]: https://github.com/gabrielweyer/ui-tests/actions/workflows/selenium-csharp.yml/badge.svg
[github-actions-selenium]: https://github.com/gabrielweyer/ui-tests/actions/workflows/selenium-csharp.yml
[github-actions-puppeteer-shield]: https://github.com/gabrielweyer/ui-tests/actions/workflows/puppeteer.yml/badge.svg
[github-actions-puppeteer]: https://github.com/gabrielweyer/ui-tests/actions/workflows/puppeteer.yml
[github-actions]: https://github.com/features/actions