QAAutomationLabs

QAAutomationLabs

Way to upgrade your skills

How to run all Specs /or selected Spec in Cypress v11.2.0

Problem Statement The ability to ‘Run all specs’ or ‘Run filtered specs’ will be removed in Cypress 10.0. For many of the users, the existing implementation “was broken” for them because of how cypress originally architectured... Read More "How to run all Specs /or selected Spec in Cypress v11.2.0"

How To Run Tests With Cypress and Cucumber

How To Run Tests With Cypress and Cucumber This blog was originally published at https://www.lambdatest.com/learning-hub/cypress-cucumber-tutorial Overview Cucumber is a well-known Behavior-Driven Development (BDD) framework that lets developers implement (or perform) end-to-end testing. The Cucumber framework is fundamentally designed to... Read More "How To Run Tests With Cypress and Cucumber"

Cypress API Automation Using Plugin Cypress-plugin-API

This blog covers how we can do API automation using the cypress API plugin “cypress-plugin-api” by Filip Hric Problem Statement At present in Cypress, we don’t have a way to see API calls in the... Read More "Cypress API Automation Using Plugin Cypress-plugin-API"

How To Run Cypress Tests In Azure DevOps Pipeline

This blog was originally published at https://www.lambdatest.com/blog/run-cypress-tests-in-azure-devops/ How To Run Cypress Tests In Azure DevOps Pipeline When software developers took years to create and introduce new products to the market is long gone. Users (or consumers)... Read More "How To Run Cypress Tests In Azure DevOps Pipeline"
Featured

Running End-to-End Cypress Test cases In Google Cloud Build Pipeline

This blog cover how we can set up the code in google cloud and run the cypress test case

Pre-Condition

  1. User already logged in to Google Cloud
  2. User in google cloud Dashboard https://console.cloud.google.com/home/dashboard
  3. Code already pushed in GitHub

Steps to Set up the Code In Google Cloud

Step 1: In the Dashboard from the left side click on ‘Cloud Build” under CI/CD section

Cypress google cloud integration

Step 2 Click on Cloud Build -> Triggers

Cypress google cloud

After clicking on the Triggers below screen is open

Cypress google cloud integration

Step 3 Enter Name, Select the Region

Cypress google cloud integration

Step 4 Select Source and Connect to the repository

Cypress google cloud integration

Step 5 Select GitHub Account and Select the repository

Cypress google cloud integration git repo

The project package.json file looks like the one given below.

We will run test cases by giving cy:report in our .yaml file

{
“name”: “cypress_dashboard”,
“version”: “1.0.0”
“description”: “”,
“main”: “index.js”,
“scripts”: {
“cleanup”: “rm -fr cypress/reports”,
“merge_reports”: “mochawesome-merge cypress/reports/mochawesome-report/*.json > output.json”,
“mochawesome_report”: “marge — reportDir cypress/reports/mochawesome-html-report -t Cypress_Test_Report -p Cypress_HMTL_Report -f Cypress_HMTL_Report — charts true output.json”,
“cy_dashboard”: “cypress run — record — key aeed922c-98af-4143–9e77-f97c6c900754”,
“cy:report”: “npm run cleanup && npm run cy_dashboard && npm run merge_reports && npm run mochawesome_report”
},
“author”: “Kailash”,
“license”: “ISC”,
“devDependencies”: {
“cypress”: “9.7.0”,
“mocha”: “8.3.2”,
“mochawesome”: “6.2.2”,
“mochawesome-merge”: “4.2.0”
}
}

Step 6 Under the Configuration select “Cloud Build configuration file (.yaml or .json)”

cloudbuild.yaml file looks like see below

In the below YAML we can see first we are installing dependencies then in Cypress image /include:7.0.1 we are running our test cases

Cypress google cloud integration .yaml file

Step 7 Click on the “Create” button below the screen open

End to End Cypress Test cases

Steps to Run End-to-End Cypress Test cases

Step 1 Click on the RUN button from the above screen

Cypress google cloud integration

Step 2 Click on the RUN TRIGGER button from the above screen. Build start running

Cypress google cloud integration

The test case starts running see the below screen

End to End Cypress Test cases
Cypress google cloud integration

☕️ Happy testing! ☕️