Skip to content

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

Setup WSL and Cypress

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

Open Cypress

If everything is configured open Cypress by running

./node_modules/.bin/cypress open

Run the tests

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

Github Action

E2E Tests are configured to run on any merge/commit into the main branch

Examples

References

Clone this wiki locally