Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
/ ui-tests Public archive

Writing UI tests with Selenium Web Driver and Puppeteer

License

Notifications You must be signed in to change notification settings

gabrielweyer/ui-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 seems to be the most commonly used platform. I also stumbled upon Puppeteer and decided to use both libraries.

I decided to test Goodreads 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 😹).

Configuration

Some tests require a Goodreads account to run.

The configuration of secrets is explained in the Selenium C# and Puppeteer 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 to run the tests on every commit to main.

Build Status

Build Status

The builds steps are versioned with the code as YAML:

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

About

Writing UI tests with Selenium Web Driver and Puppeteer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •