Skip to content

Cypress.IO website testing for magento luma template

Notifications You must be signed in to change notification settings

knospe-/cypress-io-magento-luma

 
 

Repository files navigation

Testing for Magento

Magento_Logo

Important

This project is inspired by elgentos/magento2-cypress-testing-suite: https://github.com/elgentos/magento2-cypress-testing-suite

Installation

Initialize a new repo

$ npm init with ncatestify/cypress-io-magento-luma 

Fill name and description.

Navigate into project folder and install dependencies.

$ cd <project-folder>
$ npm install

Setup

Update BaseUrl in cypress.config.ts.

baseUrl: 'https://m2.demo.webvisum.de'

If necessary update selectors under cypress/fixtures/selectors.

Run

$ npx cypress run

Or if you want to use the GUI

$ npx cypress open or $ npm run cypress:open

Test features

Testify base tests

  • Validates imprint is clickable
  • Validates request to internal links returns status code 200
  • Validates internal links are loading
  • Validates no google servies are loaded
  • Validates request to images returns status code 200
  • Validates Page has only one h1 headline
  • Validates request to invalid path returns status code 404

TESTIFY Commands

Validate all internal links return status code 200

cy.ttEveryInternalLinkStatusOk()

Validate all images return status code 200

cy.ttValidateAllImagesResponseStatusOk()

Validate all internal links are loading

cy.ttEveryInternalLinkIsLoading()

Return all internal links as array

cy.ttGetInternalLinks()

Validate imprint is clickable

cy.ttValidateImprintClickable()

Validate no google services are being loaded

cy.ttValidateNoGoogleServices()

Run all TESTIFY base tests

cy.ttRunTestifyBaseTests()

Check for accesibility issues

cy.ttAccessibility()

Run all TESTIFY page content validation tests

cy.ttValidatePageContent()

Validate page has only one headline

cy.ttOnlyOneH1()

Validate invalid path returns 404 error

cy.ttInvalidPath404()

TESTIFY Cypress Commands

Add first item on page to basket

cy.addFirstItemToBasket()

Sort items by price

cy.sortByPrice()

Switch direction in which items on page are sorted

cy.switchSortingDirection()

Search for given argument and validate results are for the given argument

cy.searchForWordAndValidate(searchword: string)

Login to Account with email and password

cy.doLogin(email: string, password: string)

Set limit for amount of results on a single page

cy.setListLimitAndValidate(limit: string)

Validate first result on first page differs to first result on second page

cy.paginationValidation()

Navigate to shopping cart page

cy.navigateToShoppingCart()

Remove product from shopping cart with given ID

cy.removeItemFromShoppingCart(articleID: number)

Increase quantity of product with given ID by one

cy.increaseShoppingCartItemQuantity(articleID: number)

Get total price of shopping cart

cy.getShoppingCartPrice();

Open Source project by TESTIFY.TEAM

TESTIFY.TEAM - WE FIND BUGS. AUTOMATED.

German YouTube Cypress.IO Live Coding Playlist

How to start with this Cypress.IO template on YouTube

About

Cypress.IO website testing for magento luma template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%