Skip to content

Instantly share code, notes, and snippets.

@tkaczenko
Last active March 25, 2024 14:19
Show Gist options
  • Save tkaczenko/178af76ae5d86a998678f5353c0ec11c to your computer and use it in GitHub Desktop.
Save tkaczenko/178af76ae5d86a998678f5353c0ec11c to your computer and use it in GitHub Desktop.
How to run e2e on Windows with specific Chrome via WSL?

How to run e2e on Windows via WSL

Install X server

It allows to run Chrome in WSL and show the Chrome window on Windows.

  1. Download and install vcxsrv

  2. Run it. Most settings can be left by default except for the next one.

  3. Make sure to check to Disable access control

  4. In WSL, set the variable DISPLAY to the X server on Windows

    3.1 Edit .bashrc

    sudo nano .bashrc

    3.2 In the end, set

    export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0

Install Chromium of the specified version.

  1. Find Branch Base Position by Chrome version with OmahaProxy - Google Chrome. Currently on Jenkins, Branch Base Position is 1047731.

  2. Find the archive of the Chromium build by the link:

  3. Download chrome-linux.zip

  4. Copy .zip to WSL with Bash

cp /mnt/c/Users/Andrii_Tkachenko/Downloads/Linux_x64_1047731_chrome-linux.zip ~/workspaces/
  1. Unzip binaries
sudo unzip Linux_x64_1047731_chrome-linux.zip -d /opt/
  1. Create link
sudo ln -s /opt/chrome-linux/chrome /usr/bin/chrome

Run e2e script

Run e2e script from package.json for the project. Change properties in protractor.conf.js if required.

npm run e2e

Chromedriver and Chrome version compatibility matrix can be found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment