Giter Site home page Giter Site logo

assignment_cypress's Introduction

Assignment_cypress

Getting Started

  • To install Cypress and add it as dev dependency: npm i cypress -D
  • To install cucumber plugin npm install --save-dev cypress-cucumber-preprocessor

Configuration

  • Configuration can be found at cypress.json

Test Scripts

The cypress-cucumber-preprocessor adds support for using feature files when testing with Cypress. All features files are present in cypress/integration/ contains test scenario description using gherkin and step defination files are also placed in cypress/integration/

Test script are writtrn using custom commands in cypress/support/commands.js These new defined commands can be reused in spec files as explained below:

Feature: Guess the word

  # The first example has two steps
  Scenario: Maker starts a game
    When the Maker starts a game
    Then the Maker waits for a Breaker to join
Cypress.Commands.add("listLen",() =>{
    originalLen = cy.get('.view > label').length;
    completeLen = cy.get('.completed > .view > label').length 
    count = Number(originalLen)-Number(completeLen)   
})
Then('to verify list length', (newItem) => {
	cy.listLen();	    
    })

Test Reports

  • To install junit npm install --save-dev cypress-multi-reporters mocha-junit-reporter
  • Screenshots are placed in cypress\screenshots folder
  • Videos are placed in cypress\videos folder
  • Junit reports can also be checked in 'Test' tab in Azure Pipeline

Execution

  • To run test scripts in headless mode: npx cypress run
  • To run test scripts in browser: npx cypress open
  • To execute in docker: docker-compose -f docker-compose.yml up
  • To run from azure pipeline use cypress/azure-pipeline.yml pipeline status is added here Build Status
  • To run using GitHub Action use file Assignment_cypress/.github/workflows status added here TestExecution

To view more detail on cypress click here

assignment_cypress's People

Contributors

shwetapachori avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.