Test Automation Stack

In our application we have input field which accepts decimal value and it has upper and lower limit. So I had to write assertion to check what is the mode of input, the maximum and minimum value the field accepts.

With cypress, using should function we can assert for attributes key and value one by one (chaining multiple should/and)

But I wanted to validate multiple attributes in one go. As we know, then() method of cypress accepts function as parameter and we can write a new function to return an object(jquery attributes return namenodemap by default and we need to convert it to an object)

Once I have the object, I can use chai’s include function to validate multiple attributes in one go.

Leave a comment

I’m Gurudatt

Profile Pic

With over 12 years of quality assurance experience, i have used various test automation tools and testing concepts and helped organization and teams to speed up testing process effectively. I’m also a Cypress.io Ambassador and BrowserStack Champion.

Let’s connect

Discover more from Test Automation Stack

Subscribe now to keep reading and get access to the full archive.

Continue reading