Control Data Randomness From The Test @gleb
Control Data Randomness From The Test  @gleb
Uploaded February 2025 | Updated September 2026, 1 week ago
The simplest end-to-end Cypress tests are tests that control the data and remove all randomness. In this video, I show how to stub the "Math.random" method the application calls to get random item ids. By stubbing this method, the test forces the application to always create items with the same deterministic id. Checking if that item is shown in the DOM becomes declarative command, without any need for "cy.then" or aliases. Find the source code in the pull request github.com/bahmutov/todomvc-callback-example/pull/4
Control Data Randomness From The TestConfirm Input Labels Using DOM Element PropertyBonus 132: Prove the Qwik event handler downloadThe Difference Between cy.get And cy.find CommandsCheck CSS ResourcesRemove Numbers From StringsCustom Assertion Catches Elements Overflowing The ContainerLesson d2: Halloween pumpkinscypress-if Plugin Supports Cypress v12+: Close The Popup Dialog If It Is VisibleSelect DOM Elements Using CSS OR SelectorTest AG Grid Table Using Cypress And Cypress-Map PluginFind Table Column Index
gleb bahmutov |

Control Data Randomness From The Test

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER