Found 30 Articles for Cypress

How to implement tags in Cypress?

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:43:30

754 Views

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.ExampleImplementation with .onlydescribe('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 ResultsThe output ... Read More

How to implement hooks in Cypress?

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:40:03

418 Views

We can implement hooks in Cypress. Cypress Hooks are used to carrying out certain operations prior/post every/each test. Some of the common hooks are −before – Executes once prior execution any tests within a describe block.after – Executes once post-execution all tests within a describe block.beforeEach – Executes prior execution of the individual it blocks within a describe block.afterEach – Executes post-execution of the individual it blocks within a describe block.ExampleImplementationdescribe('Tutorialspoint', function() {    before(function() {       // executes once prior all tests in it block       cy.log("Before hook")    })    after(function() {       ... Read More

Explain the working of Cypress.

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:34:27

113 Views

The below diagram explains the working of the Cypress −Automation tools like Selenium work by running outside the browser. However, Cypress has a different architecture. It runs within the browser. Cypress is based on the server - Node.js.There is a continuous interaction of Cypress with the Node.js and they work in – coordination with each other. As a result, Cypress can be utilized for testing both the front and backend of the application.Cypress is thus capable of handling the tasks performed in a real-time on the UI and simultaneously perform actions outside of the browser. The basic differences between Cypress ... Read More

How to create a teamcity report in Cypress?

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:03:24

594 Views

We can create a teamcity report in Cypress. To install the package for teamcity report, run the command −   npm install cypress-teamcity-reporter --save-devTo generate a report for all specs in the integration folder of the Cypress project, run the command −   npx cypress run --reporter teamcity

How to create a Junit report in Cypress?

Debomita Bhattacharjee
Updated on 19-Nov-2021 10:01:36

2K+ Views

We can create a Junit report in Cypress. To install the package for the JUnit report, run the command −   npm install cypress-junit-reporter --save-devExampleImplementation in cypress.json{ "reporter": "junit", "reporterOptions": { "mochaFile": "cypress/results/results.xml", "toConsole": true } }If we run multiple tests in a run and wish to have a unique report for individual spec files, we have to add [hash] in the mochaFile parameter in cypress.json.ExampleImplementation in cypress.json to avoid overriding report{ "reporter": "junit", ... Read More

Cypress Test Automation

Debomita Bhattacharjee
Updated on 05-Aug-2020 12:24:49

1K+ Views

Cypress supports most of the modern applications built on React, Angular and so on. Often Cypress is compared with automation tools like Selenium. There are a lot of debates on which is a better tool [Cypress and Selenium] with respect to automation.However both Cypress and Selenium both have a set of advantages and disadvantages and it is up to the user’s requirements that we should take up a tool. Let us now discuss some of the differences between Selenium and Cypress as listed below −Cypress is available for use in the form of framework or npm. It is considered as ... Read More

Cypress Dashboard for Test Automation

Debomita Bhattacharjee
Updated on 05-Aug-2020 12:23:21

301 Views

Cypress Dashboard is an option that enables us to see the recorded tests and gives us detail on the events that took place during execution. It gives a visual display of the test execution, their reports and status of the runs. It is a useful tool while we are executing tests in the CI environment.Benefits of Cypress Dashboard are listed below −It gives information on the count of the number of test cases that passed, failed or skipped during execution.It gives full information on stack trace of the tests that got failed.It captures screenshots for failed test cases or when ... Read More

Handling Frames with Cypress

Debomita Bhattacharjee
Updated on 05-Aug-2020 12:19:54

1K+ Views

Cypress in its earlier versions was not capable of handling frames. However in its latest version, they have given us the solution to automate scenarios with frames. A frame is an html structure which resides inside another html structure.If we want to access an element which is inside a frame, first of all Cypress has to move its focus from the entire web page to the frame and then it interacts with the elements inside that frame. We have to install a plugin to work with frames in Cypress.We shall run the command npm install –D cypress-iframe from the project ... Read More

Handling Child Windows with Cypress

Debomita Bhattacharjee
Updated on 05-Aug-2020 12:17:31

1K+ Views

Sometimes on clicking a link or button, it opens to another window often known as the child window. Cypress has a unique way of handling child windows unlike other automation tools like Selenium and Protractor. It basically keeps no information on the child window by shifting its focus from the parent to the child window.Now let us understand why a link or a button opens a new webpage on a different tab considered as a child. This is due to the attribute target set in the html for that element. If omitted, it shall open in the same window.Cypress cannot ... Read More

Mouse over Actions with Cypress

Debomita Bhattacharjee
Updated on 05-Aug-2020 12:15:32

2K+ Views

The mouseover actions are very common in web pages where a list of elements becomes visible once we hover on it. Cypress does not support mouse over actions like other automation tools like Selenium as it considers it to be flaky.Cypress shall manipulate DOM elements to perform mouse over actions. Cypress takes the help of show() method in JQuery. The show() method displays the elements which are hidden [ having the CSS property display:none] and selected. Also, the show() method only works with the immediate parent in the DOM of the hidden element.Now to invoke any JQuery function, Cypress takes ... Read More

Advertisements