- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to implement tags in Cypress?
We can implement tags in Cypress. Cypress has tags - .only and .skip. While the .only tag is utilized to execute the it block to which it is tagged, the .skip tag is utilized to exclude the it block to which it is tagged.
Example
Implementation with .only
describe('Tutorialspoint', function() //it block with tag .only it.only('First Test', function() { cy.log("First Test") }) //it block with tag .only It.only('Second Test', function() { cy.log("Second Test") }) it('Third Test', function() { cy.log("Third Test") }) })
Execution Results
The output logs show that the it blocks (First and Second Test) with the .only tags only got executed.
Example
Implementation with .skip
describe('Tutorialspoint', function() it('First Test', function() { cy.log("First Test") }) it('Second Test', function() { cy.log("Second Test") }) //it block with tag .skip it.skip('Third Test', function() { cy.log("Third Test") }) })
Execution Result
The output logs show that the it block (Third Test) with the .skip tag got skipped from the execution.
- Related Articles
- How to implement hooks in Cypress?
- How to upload a file in Cypress?
- How to humanize tags in Django?
- How to perform data-driven testing in Cypress?
- How to create a Mochawesome report in Cypress?
- How to create a Junit report in Cypress?
- How to create a teamcity report in Cypress?
- How to import the tags in Azure?
- How to get documents by tags in MongoDB?
- How to remove empty tags using BeautifulSoup in Python?
- How to remove HTML Tags with RegExp in JavaScript?
- Various Locators in Cypress
- Text Validations in Cypress
- Asynchronous Nature in Cypress
- How to use Boto3 to add tags in AWS Glue Resources

Advertisements