Skip to content

This repository contains a demo implementation of Cypress, using javascript as the programming language. The page objects pattern is implemented here.

License

Notifications You must be signed in to change notification settings

antonyfuentes/cypress-javascript-page-objects

Repository files navigation

Automated UI testing project, implemented with Cypress

Cypress is a next generation front end testing tool built for the modern web. It address the key pain points developers and QA engineers face when testing modern applications. For more information visit: https://www.cypress.io/

Local setup

macOS:

  • First install NodeJs: brew install node
  • Then install the dependencies from package.json with the following command: npm install
  • If this is your first time running cypress, then also run npx cypress install
  • For more info, check the official install guide

Running tests locally

  • Before running any tests please make sure that the following two env variables are defined in your system:
    • CYPRESS_ECOMMERCE_USER
    • CYPRESS_ECOMMERCE_PASS
  • To open Cypress' GUI run npx cypress open. The you will be able to run the tests from there
  • If you want to run the tests from your terminal, simply run: npm run test:chrome
  • Also, if you are interested in running tests that belong to a specific tag:
    • First declare the following variable: export CYPRESS_grepTags=@YourTag
    • And then run the tests usimg the npm command mentioned above

Tests implemented:

  • Nine tests in total were implemented as part of this framework using JavaScript as the backbone programming language
  • The page object pattern and page factory approach were used
  • Some tests rely on intectations with the API as well to gather data required by the tests. Which demonstrates one of the greatest features incorporated in Cypress
  • Application under test: https://github.com/antonyfuentes/testing-playground
  • This project also already includes the necessary changes to allow it to run on Gitlab CI

See the tests in action:

image description

About

This repository contains a demo implementation of Cypress, using javascript as the programming language. The page objects pattern is implemented here.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published