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