-
Notifications
You must be signed in to change notification settings - Fork 4
E2E Tests Setup and Run
Stavros Kounis edited this page Jan 28, 2022
·
6 revisions
E2E tests are configured to run with Cypress. The tests are running with WSL2 with MobaXterm for XServer
Install the prerequisite packages in WSL2
sudo apt update
sudo apt install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
XServer Install MobaXterm and start it. It starts also an XServer.
Set the DISPLAY in .bashrc
# set DISPLAY variable to the IP automatically assigned to WSL2
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
Test the DISPLAY
echo $DISPLAY
# something like 192.168.64.1:0.0
Edit .bashrc and add the line
sudo /etc/init.d/dbus start &> /dev/null
Grant root access to dbus without password, but first set your favorite editor.
sudo update-alternatives --config editor
sudo visudo -f /etc/sudoers.d/dbus
In the editor add the line
<your_username> ALL = (root) NOPASSWD: /etc/init.d/dbus
Configure the Inbound Rules in the Windows Defender Firewall and allow all the connections for MobaXTerm
If everything is configured open Cypress by running
./node_modules/.bin/cypress open
Open Cypress and Listen for connections/tests. (see above)
Run the tests
npx cypress run
Run the test and record
npx cypress run --record --key 7d65b93d-1ff0-492a-99ef-db8532dc2935
E2E Tests are configured to run on any merge/commit into the main branch
- Drastically Simplify Testing on CI with Cypress GitHub Action
- Automatically run Cypress tests on every code push with GitHub Action and Docker
- Automate Node.js Website E2E Test with Cypress and GitHub Actions
- https://github.com/cypress-io/cypress-example-kitchensink/tree/master/.github/workflows
- chrome-headless.yml