Cypress can test the current subject using implicit assertions that I find more readable than the explicit Chai assertions. Recently I saw a Linkedin post that shows "before & after" API test using Cypress. Here is the screenshot included in the post. Right away, I want to say that the "after" test is better. It checks the response status first, then confirms the types and ranges of values, rather than hard codes the new item's id and creation date. The "after" test will probably pass, while the first test will probably fail really quickly on new runs. I like the general idea. But I think…
Well, I am happy to report Cypress-the-company is all in on test auto-healing in its new cy.prompt command (which I recreated locally as cypress-think plugin). Let's look at the screenshots Cypress put in the blog post: The test shows Cypress auto-healing in practice. The test had a prompt like "Turn on dark mode", which used to resolve to some button (unclear). Now the button is gone, but the test has been "auto-healed" to find another button. We can see the details of the healing by clicking on the "Turn on dark mode" step in the Command Log: Please do not use any auto-healing in your…
Using The New NPM OIDC Trusted Publishing Workflow At the end of 2025, NPM registry revoked all personal NPM tokens that I used to publish new NPM package releases. This change improves the security of the entire NPM publishing workflow, but has disrupted my CI process. For example, the new feature of cypress-timestamps has not been released, failing with the error "SemanticReleaseError: Invalid npm token.". Hmm, what do we do now? We could use publish to NPM using local npm CLI commands, entering the 2FA token, etc. But I really hate this idea. I have more than 400 NPM packages, so the…
Do not confuse negative assertion with a quick timeout. Let me get back to the testing of negative states one more time. Recently, I have read a pretty good blog post How to test that cache works with Cypress by Walmyr. A piece of Cypress test syntax caught my eye: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 cy.search(randomWord).then(() => { expect(count, `network calls to fetch ${randomWord}`).to.equal( 1, ) cy.wait('@random') cy.search(randomWord).then(() => { expect( count, `network calls to fetch ${randomWord}`, ).to.equal(1) }) }) The test above confirms that the web page caches the search…
I have described using Use Copilot Instructions And Page Objects to quickly develop end-to-end Cypress tests. This blog post gives another concrete example. You can find the source code in the repo bahmutov/copilot-instructions-example. First, I wrote a page object file to implement common TodoMVC application test commands: visit the app and wait for it to load reset the backend data to zero todos or the given number of items cypress/e2e/todomvc.po.js1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 export const TodoMVC = { visit() { cy.step('visit the app')…
Imagine you are testing a TodoMVC application, and you need to complete all items. You simply click every checkbox and confirm the applic
Read at the source
Your visit, your choice.
Optional Google Analytics helps us understand visits. Microsoft Clarity records masked interactions to improve the site. Optional tools stay off unless you choose them. Privacy details.