Uploaded March 2024 | Updated September 2026, 1 week ago
In this exercise, I show how a typical test with "Command - Command - Command" can lead to flake when the application is slow to react to a particular command. By adding an assertion we can make the test runner "wait" as long as needed for the app to "catch up". Find the starting code in the repo github.com/bahmutov/flaky-test-cypress branch "level3" If you like hands-on testing coding challenges, check out my Cypress/Playwright courses at https://cypress.tips/courses
In this exercise, I show how a typical test with "Command - Command - Command" can lead to flake when the application is slow to react to a particular command. By adding an assertion we can make the test runner "wait" as long as needed for the app to "catch up". Find the starting code in the repo github.com/bahmutov/flaky-test-cypress branch "level3" If you like hands-on testing coding challenges, check out my Cypress/Playwright courses at https://cypress.tips/courses





![Remove Numbers From Strings
This video shows how to take multiple elements, remove numbers from each text, trim those strings, and confirm them.
cy.get(#fruit li) // jQuery Element[]
.map(innerText) // string[]
.mapInvoke(replace, /[ds]/g, ) // string[]
.should(deep.equal, [Apples, Grapes, Kiwi])
The retryable query commands cy.map and cy.mapInvoke come from my plugin https://github.com/bahmutov/cypress-map The full example is at https://glebbahmutov.com/cypress-examples Remove Numbers From Strings](https://i.ytimg.com/vi/OXiEJDjozQo/mqdefault.jpg)




