Skip to content

elfro/e2e-playground

Repository files navigation

e2e-playground

This project is a playground to practice e2e tests.

The OrangeHRM demo project was chosen since it provides guest user pages, admin panel and allows to use API request to setup necessary test environment.

Test Report is deployed to GH pages.

Setup Pre-Requisites

Node.js v.18.17.0 +

npm 9.6.0 +

Installation

  1. Clone a project locally and switch to the project directory:
git clone git@github.com:elfro/e2e-playground.git && cd e2e-playground
  1. Install packages:
npm ci
  1. Install browsers
npx playwright install
  1. Copy .env.example file to the root of the project with .env file name.
cp .env.example .env
  1. Set USERNAME and PASSWORD values by copying them from the main auth page of OrangeHRM app.

Auth credentials

  1. Run tests:
npm run test

or in UI mode:

npm run test:pw-ui
  1. View Test Report:
npm run allure:open

Tech Stack

  • Programming language: programming language
  • Test library: test library
  • Test Reporter: test reporter
  • To generate test data: library to generate test data
  • To check code syntax and style: static code analysis tool, code formatter
  • CI: CI/CD

Project Structure

Terminology

Spec file contains the test itself.

Fixture, Setup files contain the project dependencies that are used to prepare environment for each test.

Component class usually contains all element selectors and methods to interact with those elements inside this component.

Page class consists of Components and may contain a method for page action that requires the work with several components.

Client provides the API with the specific library / service that can be used in the tests.

Helper does general tasks that could be useful in different places. The most common representatives are:

  • WebElementHelper: basic Element actions are defined here;

Data Factory generates necessary test data of the specific type.

Type file represents the common object type that can be met in the project, like API response data or the UI data.

Constants, Enum use to represent the single or group of constants.


The following test cases are covered:

  1. Filters work properly on Vacancies page

    video.webm
    video.webm
  2. Filters work properly on Candidates page

    video.webm
  3. The newly applied candidate from Apply Vacancy page appears on the Candidates page.

    video.webm

About

A playground for experimenting with Playwright

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published