Skip to content

Instantly share code, notes, and snippets.

@slawekradzyminski
Created March 2, 2023 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slawekradzyminski/228ac47119114e34406aff1c88f73fe2 to your computer and use it in GitHub Desktop.
Save slawekradzyminski/228ac47119114e34406aff1c88f73fe2 to your computer and use it in GitHub Desktop.
/// <reference types="cypress" />
describe('Awesome tests', () => {
beforeEach(() => {
cy.visit('https://www.awesome-testing.com/')
cy.viewport(1920, 1080)
console.log('This will be logged before cy.visit')
})
it('should find Cypress posts', () => {
cy.get('.gsc-input input').type('Cypress')
cy.get('.gsc-search-button input').then(($btn) => {
console.log('This will be logged after typing Cypress')
})
cy.get('.post-title').should('have.length.above', 1)
console.log('This will be logged after cy.visit')
})
afterEach(() => {
cy.wait(2000)
cy.log('This is Cypress logging hence it will log after waiting')
console.log('This will log after test before waiting')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment