Skip to content

This repo contains various example E2E & API tests for "OrangeHRM" & "Req-Res" using Cypress with Typescript and Page Object Model.

License

Notifications You must be signed in to change notification settings

darvinpatel/cypress-typescript-demo-ui-api

Repository files navigation

Test automation with Cypress Logo on Demo OrangeHRM & Req-Res

cypress_results

Sample Run | Video

Note

  • Demo OrangeHRM is a HR system and quite popular for testing advanced concepts
  • Req-Res is an online site for testing the backend with all the most common REST APIs.

Cypress Features

This tests are purely for Cypress features practice, usage of Page Object Model and API testing.

Getting Started

Prerequisites

The only requirement for this project is to have Node.js installed on your machine.

Troubleshooting

If you see an error like "command not found": This means Node.js is not installed or the system's PATH variable is not set correctly.

If you need to install Node.js: You can download and install it from the official Node.js website. Choose the version that matches your operating system.

Verify nodejs and npm are installed

node -v

This command will display the installed version of Node.js if it is installed. For example, it might return something like v16.13.0.

npm -v

This will display the installed version of npm if it is present.

Useful Commands

1. Clone repo to local

git clone https://github.com/darvinpatel/cypress-typescript-demo-ui-api

2. Install Cypress and Typescript to your DevDependencies

cd cypress-typescript-demo-ui-api
npm install cypress typescript @types/node @types/cypress --save-dev

3.1 Verify Cypress

npx cypress -v

This will display the installed version of cypress like this:

Cypress package version: 13.14.2
Cypress binary version: 13.14.2
Electron version: 27.3.10
Bundled Node version: 18.17.1

3.2 Verify Cypress

npx cypress verify

This used to verify that the Cypress installation is complete and functioning correctly. It would display output as:

✔  Verified Cypress! /Users/darwinpatel/Library/Caches/Cypress/13.14.2/Cypress.app

4. Open Cypress

npx cypress open

5. Run all tests in Cypress

npx cypress run

About

This repo contains various example E2E & API tests for "OrangeHRM" & "Req-Res" using Cypress with Typescript and Page Object Model.

Topics

Resources

License

Stars

Watchers

Forks