1.What is Cypress and how is it different from other programming languages?
Cypress is a javascript-based end-to-end testing framework designed for automated web applications.
It provides real-time reloading, time travel debugging, and automatic waiting
and it has cross-platform support like Windows, Mac OS and Linux
2.List down a few cypress commands
cy.get()
cy.visit()
cy.click()
cy.type()
3.Provide examples of command chaining in Cypress
cy.visit(“http://www.google.com”)
cy.get(“#id”).type(“name”)
cy.get(“#button”).click()
4.How to handle Asynchronous operations in Cypress?
Implicit wait
Explicit wait
Promises
Async/Await
5. How to debug cypress code?
Using logs
Time travel debugging
snapshots- videos or screenshots
6. What are the best practices when writing test scripts in Cypress?
Use reusable commands in commands.js file
separate each test using it block
separate multiple tests using describe block
Use assertions when needed
Use proper names for individual tests
Handle asynchronous operations properly
7. Can the test be integrated with CI/CD pipelines?
Yes.
8. What plugins can be used with Cypress?
cucumber
mochaaweosme
9. How to handle data-driven testing in Cypress?
data files like JSON files can be kept inside the fixture folder. These files can be used to input multiple data by reading those files.
10. How do you handle network requests in Cypress?
cypress can modify and intercept network requests and responses using cy.intercept() command.
11. What are the challenges in Cypress?
It has limited browser support
it doesn’t support older versions of browsers
multiple tabs cannot be handled with Cypress
No comments:
Post a Comment