Skip to content

tux7P/Cypress-Typescript

Repository files navigation

This project contains

✅ POM, class structure, constructor for selectors, re-use of repetitive methods

✅ Tests: 10

- UI
    - Successfull login & logout
    - Unsuccessfull login with incorrect email
    - Unsuccessfull login with incorrect password
    - Incercept and validate backend call from frontend
    - Stubbing a response body and validate the response
    - Stubbing a response status without touching server and validate the response

- API
    - POST: Create customer record
    - GET: List customer records
    - PATCH: Update customer record
    - DELETE: Delete customer record

✅ Proper validation

✅ Use of intercepts - To validate backend calls through UI

✅ Github Actions setup on push to master branch

✅ Run tests in headless mode: yarn cypress:headless

✅ Cypress commands

✅ Aliases to wait for intercepts

✅ Integrated cypress dashboard for reporting

✅ Gropped API & UI test spec to run separately through node scripts

✅ Conventional commit style

To Run Tests

To Run Cypress E2E Tests Locally

# Install Dependencies
yarn

# Run all the tests in headless mode
yarn cypress:headless

# Run the tests in Cypress UI
yarn cypress:open

# Run UI Tests
yarn cypress:ui

# Run API Tests
yarn cypress:api

Important Links

  1. Page Objects - Link
  2. UI tests - Link
  3. API tests - Link
  4. Cypress commands - Link
  5. Intercepts & Alias - Link
  6. Github Actions workflow - Link
  7. package.json - Link
  8. cypress.config.js - Link
  9. Cypress Dashboard Report - Link

Directory Structure

.
├── README.md
├── cypress
│   ├── fixtures
│   │   └── example.json
│   ├── support
│   │   ├── Interfaces
│   │   │   ├── IBilling.ts
│   │   │   ├── ICustomer.ts
│   │   │   └── ILogin.ts
│   │   ├── PageObjects
│   │   │   ├── CustomerPage.ts
│   │   │   └── LoginPage.ts
│   │   ├── commands.ts
│   │   ├── e2e.ts
│   │   └── index.d.ts
│   ├── tests
│   │   ├── api
│   │   │   └── customer_api.cy.ts
│   │   └── ui
│   │       ├── customer.cy.ts
│   │       └── login.cy.ts
│   └── tsconfig.json
├── cypress.config.js
├── cypress.env.json
├── package.json
└── yarn.lock

8 directories, 18 files

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published