Uploaded September 2024 | Updated September 2026, 1 week ago
This video solves a Cypress test problem the user asked. The application shows an account number: a 9-digit number. The test should wait for the number and then compare its value. I explain the problem with the initial solution and then show how to write this test. Find the full code at glebbahmutov.com/cypress-examples/recipes/parse-account-number.html
This video solves a Cypress test problem the user asked. The application shows an account number: a 9-digit number. The test should wait for the number and then compare its value. I explain the problem with the initial solution and then show how to write this test. Find the full code at glebbahmutov.com/cypress-examples/recipes/parse-account-number.html






![Confirm Sorted Attributes
If you need to get an attribute from each DOM element, and you dont care about the order, you should compare sorted arrays. This video shows how to grab a data-... attribute using plain Cypress syntax and cypress-map plugins. Find the full recipe at https://glebbahmutov.com/cypress-examples Here is the cypress-map solution
// the expected SKU numbers
const skus = [00991C, 00100C, 00500A, 0044B].sort()
cy.get(#purchases li)
.map(dataset.sku)
.invoke(sort)
.print()
.should(deep.equal, skus) Confirm Sorted Attributes](https://i.ytimg.com/vi/sVb5MU2AkqE/mqdefault.jpg)



