Know Your Test Automation Tools : Working with Cypress
Kushan Shalindra Amarasiri
Head of Quality Engineering at Social Catfish
We are in an era of test automation and it is at its peak. There are various test automation tools available in the market. Existing test automation tools are getting updated while new tools enter to the market to overcome the limitations of current?test tools available. There are tools for Web Services/ Web Applications/ Desktop and mobile automation.
As mentioned in my previous articles, if you want to be an awesome test automation engineer learning the automation tool stack is the utmost important thing that you should do. Do not rely on just one or two tools. Keep moving up the ladder by learning each tool and be a flexible and fully-fledged test automation engineer.?
The tool that I'm going to let my community know in this article is called Cypress.io, which is new to the test automation arena. My sincere thanks should go to Joe Colantonio, who is also a guru in test automation arena. His article on Cypress allowed me to investigate more on this test tool further.
Cypress is an end to end frontend test automation tool which has come up recently and its based on Node.JS. Cypress is based on latest Java Scripting technology, which will handle modern web applications based on Anjular.JS or React.JS.
Going through this new great test automation tool I learned lot of its features. They are simply fantastic.
Lets look at how we can get started with Cypress.io. First we have to download and install Node.js as it uses Node.js and run on top of it.
??? npm install cypress
The cypress installation will be downloaded and installed in your machine.
After installing open up Cypress.io test runner by typing the following command in your command line.
node_modules\.bin\cypress open
It automatically takes the available .js files in your ..\cypress\integration folder. Next create the following code snippet in your favorite js editor or notepad.
///?<reference?types="cypress"?/>
describe('Kushan?First?Test',?function(){
????it('Guru?99?Login',function(){
????????cy.visit('https://demo.guru99.com/v4/')
????????cy.get('body?>?form?>?table?>?tbody?>?tr:nth-child(1)?>?td:nth-child(2)?>?input[type=text]').type('mngr332873')
????????cy.get('body?>?form?>?table?>?tbody?>?tr:nth-child(2)?>?td:nth-child(2)?>?input[type=password]').type('umEtyvy')
????????cy.get('body?>?form?>?table?>?tbody?>?tr:nth-child(3)?>?td:nth-child(2)?>?input[type=submit]:nth-child(1)').click()
????????cy.get('body?>?table?>?tbody?>?tr?>?td?>?table?>?tbody?>?tr.heading3?>?td').should('have.text',?'Manger?Id?:?mngr332873')
????})
})
Hope this article gave the heads up on how to jump start test automation with new tool like Cypress.io, and explore the wonderful features it gives. We will explore more functionality of Cypress.io in more upcoming articles. So stay tuned.
Quality Assurance Lead |Cypress | Appium| Postman| JMeter |ZapProxy |ISEB CFTL |
3 年Kushan Shalindra Amarasiri how about a Cypress meetup group
Quality Assurance Lead |Cypress | Appium| Postman| JMeter |ZapProxy |ISEB CFTL |
3 年Cypress is a nice tool to work with :)
ISTQB | SFC? | SSYB? | Agile | Manual & Automation Testing | WebDriverIO(TS) | Playwright(TS) | Selenium(Java) | Lead Quality Assurance Analyst
3 年Well Articulated..!!