Skip to content

Commit

Permalink
docs(e2e): fixes for the root e2e submodule README
Browse files Browse the repository at this point in the history
Co-authored-by: Yuliya Adamska <yadamska@exadel.com>
Co-authored-by: Dmitry Shovchko <dshovchko@exadel.com>
  • Loading branch information
3 people committed Feb 15, 2024
1 parent 928efcd commit 0efaa74
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

## Introduction
This is an internal package for visual automation testing the ESL.
It is designed to be used by the ESL team to test ESL library by checking visual consistency of `@exadel/esl-webside` submodule.
It is designed to be used by the ESL team to test the ESL library by checking the visual consistency of `@exadel/esl-website` submodule.

## Installation

There is no extra pre-conditions to develop new visual tests locally,
There are no extra pre-conditions to develop new visual tests locally,
everything to start will be already installed with root package installation.

**⚠️ Except for one critical thing: all final snapshots should be created on Linux based OS (Ubuntu latest version is recommended) ⚠️**
**⚠️ Except for one critical thing: all final snapshots should be created on Linux based OS (the latest version of Ubuntu is recommended) ⚠️**

Visual testing depends on fonts rendering so snapshots created on different OS may be different.
The main (remote) environment for visual testing runs via GitHub Workflows on Ubuntu latest version.
Visual testing depends on font rendering so snapshots created on different OS may be different.
The main (remote) environment for visual testing runs via GitHub Workflows on the latest version of Ubuntu.

### Creating snapshots and running existing tests on Windows

Expand All @@ -28,7 +28,7 @@ To create snapshots on Windows, you need to use WSL (Windows Subsystem for Linux
nvm install node@20
nvm use node@20
```
4. Install cromium browser (https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps#install-google-chrome-for-linux):
4. Install Chromium browser (https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps#install-google-chrome-for-linux):
```bash
sudo apt-get update
sudo apt-get install -y chromium-browser
Expand All @@ -38,9 +38,9 @@ To create snapshots on Windows, you need to use WSL (Windows Subsystem for Linux
sudo apt install libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
```
Note: you might need to restart your subsystem after steps 4 and 5.
6. Open project folder via WSL terminal and run `npm install` to ensure all dependencies are installed.
6. Open the project folder via WSL terminal and run `npm install` to ensure all dependencies are installed.
7. Use `e2e` package scripts to create snapshots and run tests:
- `npm run test:e2e` (in the root package) or `npm run run` (in sub-package) to run all tests (missing snapshots will be created automatically)
- `npm run test:e2e` (in the root package) or `npm run run` (in the sub-package) to run all tests (missing snapshots will be created automatically)
- `npm run test:e2e:update` (in the root package) or `npm run run:update` (in sub-package) to update all snapshots

### Creating snapshots and running existing tests on Mac
Expand All @@ -49,10 +49,10 @@ TODO: add instructions for Mac OS

### Creating snapshots and running existing tests on Linux

To create snapshots on Linux, you can use any Linux distribution, but Ubuntu latest version is recommended.
To create snapshots on Linux, you can use any Linux distribution, but the latest version of Ubuntu is recommended.

1. Install ESL root package and all dependencies according to the root package README.md.
2. Ensure you have chromium browser installed:
1. Install the ESL root package and all dependencies according to the root package README.md.
2. Ensure you have Chromium browser installed:
```bash
sudo apt-get update
sudo apt-get install -y chromium-browser
Expand All @@ -69,18 +69,17 @@ Use explicit workspace name to run following commands from the root package.

- `npm run run` - run all visual tests (run server automatically, create missing snapshots)
- `npm run run:update` - update all snapshots (run server automatically)
- `npm run run:server` - shortcut to run server for visual tests (uses `esl-webside` package)
- `npm run run:server` - shortcut to run server for visual tests (uses `esl-website` package)
- `npm run run:update:only` - update all snapshots, does not run server (ensure you run server manually)
- `npm run run:server:only` - run server for visual tests, does not run tests

Note: default server port for visual tests is `3007`.


## Updating snapshots using GitHub project workflow

The Automated tests workflow allows you to trigger it manually, it will update all snapshots and commit changes on the branch you specify.

Make sure you have permissions to run workflows in the ESL repository or ask the ESL Maintainers team to run the proper update for you.
Make sure you have permission to run workflows in the ESL repository or ask the ESL Maintainers team to run the proper update for you.

To trigger the workflow manually, follow these steps:

Expand Down

0 comments on commit 0efaa74

Please sign in to comment.