560 blogs tracked4,950 posts indexed

#cypress

12 posts · 1 company · newest first

1

Implicit Assertions Are More Readable (opens on the source site)

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…

productscypressexcerpt only · body stays at the source
From the web
7

Has It Not Happened Yet (opens on the source site)

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…

productstestingexcerpt only · body stays at the source
From the web
11

Copilot Instructions Example (opens on the source site)

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')…

advicecypressexcerpt only · body stays at the source
From the web
12 shown

Privacy choices

Reading never requires analytics. These choices last 90 days on this browser.

Essential sign-in and security storage always stays on. Read the privacy notice.