Crafting our initial acceptance test
Chapter 7 familiarized us with the notion of starting with an acceptance test – a test that’s approached from an end user’s standpoint, as opposed to a developer’s perspective. Essentially, we aim for our test to validate aspects a user would perceive or interact with on the web page, rather than technicalities such as function calls or class initializations.
Within the folder you created in the Technical requirements section (that is, weather-app
), create a Cypress test within cypress/e2e/weather.spec.cy.ts
:
describe('weather application', () => { it('displays the application title', () => { cy.visit('http://localhost:3000/'); cy.contains('Weather Application'); }); });
In this code snippet, we defined a test suite named weather application
. It uses the describe function in the Cypress testing...