http://www.technicalpage.net/search/label/SQL

Cypress Interview Questions, part 1

 YouTube: To watch in YouTube click here

 

1. What is Cypress?

It is a web based test ( front end ) automation tool. It is a java script based open source test automation tool.

 

2. How you install cypress ?

To install Cypress, you need to install Node.js first. Then you install cypress using below command:

npm install cypress.

 

3. What are the programming languages supported by cypress ?

Java Script and Type Script

 

4. What are the browsers supported by Cypress ?

 

  • Chrome
  • Firefox
  • Edge
  • Chromium
  • Electron

 

5. Does cypress support selenium ?

No, unlike selenium, cyress runs code inside browser.

 

6. What are the hooks in cypress ?

The hooks in Cypress are:

before(), beforeEach(), after(), afterEach().

 

7. What locators are supported by Cypress ?

Cypress supports: CSS Selector and also xpath after adding the plugin cypress-xpath.

 

 8. How can you create a test suite in Cypress ?

In Cypress, you create a describe() block, inside the describe block you create tests using it() blocks. The describe() blocks are the test suites and the it() blocks are the test cases.

For example:

describe('Test Suite name or description', () => {

    it('testcase1 name or description', () => {

        //code

    })

    it('testcase2 name or description', () => {

        //code

    })

})

 

 9. How can you verify the title of a page in Cypress ?

You can use below code to verify the page title:

cy.title().should(‘eq’, ‘Enter Page Title here’)

 

10. How can you check if the locator/object is visible or not ?

You can verify using below code :

cy.get(‘CSS Selector’).should(‘be.visible’)

No comments:

Post a Comment