Categories
Technology

Tips & Tricks for Cypress

Photo by Hunter Haley on Unsplash

This is a collection of simple and recurring scenarios when writing Cypress tests. For more complex recipes, check the official doc.

  • Setup
    • Abort cypress after first failed test
    • Read a test file from fixtures
  • Assertions
    • Assert the text of a page (string or number)
    • Assert the number of elements selected
    • Assert the result of two Cypress commands
  • Actions
    • Upload a file
  • Selectors
    • Given a list, return row that contains specific text
    • Selector is flaky due to page redesigns
    • Type text into input field and press enter
    • Select element inside iframe
    • Use selector X to narrow down area, and then use selector Y to find element
  • Waits
    • Wait until a network (ie. HTTP/XHR) request resolves
    • Wait until a condition becomes true
  • Mocks
    • Force a specific response to an HTTP request
Categories
Technology

Framework review: Cypress

Photo by Herbert Goetsch on Unsplash

Fast and reliable testing for anything that runs in a browser. It uses Javascript to make setting up, writing, running and debugging tests easy — for QAs and developers.

Official website

Categories
Technology

Creating a test strategy using questions

He doesn’t have a test strategy ☝️

Categories
Technology

Framework review: Karate

Photo by Thao Le Hoang on Unsplash

Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into a single, unified framework. You don’t have to compile (Java) code. Just write tests in a readable syntax.

Official website

Categories
Technology

Infrastructure testing (Ruby): InSpec + Azure

Infra testing is mostly uncharted territory