HEWEB24: Onlocking the power of automation

Monday, September 23rd, 2024

Unlocking the power of automation: An introduction to end-to-end testing

Paul Gilzow — Platform.sh

Every year we’re asked to “do more with less” while budgets continue to shrink. As a development team, how do we continue to manage all our responsibilities while taking on even more? Automation.

Notes:

  • Cypress – Open source products that really streamlines the process
    • Not Selenium based
    • Super fast
    • Support all major browsers (except Safari for now)
  • Installing Cypress
    • npm install cypress –save-dev
    • Set up testing script (spec)
      • Visit page
      • Grab title, confirm that it is correct cy.get(‘title’)
        • Starts at root
      • .should(‘contain’, ‘HighEdWeb 2024’)
  • Testing
    • Break down into simplest steps
    • Test “happy” and “unhappy” paths
    • Phases:
      • Arrange (Set up application space)
      • Act: (Take steps)
      • Assert (did it succeed)
    • Write tests so they are independent of each other
    • Config – can define base URL to wrok against different enviroments
      • Variable stack and can be overwritten
  • Managing state of applications
    • Stub requests
    • Static user (need to prep the DB with real user)
      • May effect later tests (as user does stuff)
    • Dynamic user
  • Every test is done in an incognito window (which will screw with logged in functionality)
    • Answer is to set up login function to include on other tests
  • Can also save session information cy.session and pass it in

Leave a Reply

You know you want to...