YuriyPent / Cypress-Web-Automation

Cypress Web Automation Testing from Zero to Hero
MIT License
0 stars 0 forks source link
css cypress html javascript typescript

Cypress Web Automation Testing from Zero to Hero

Install

Add configuration in cypress.json

{
    "baseUrl": "http://localhost:4200",
    "ignoreTestFiles": "**/examples/*",
    "viewportHeight": 768,
    "viewportWidth": 1024
}

CLI

Cypress-plugin-retries

Reporters

Docker

Cross Browser Testing

// Run the test if Cypress is run via Firefox
it('Download extension in Firefox', { browser: 'firefox' }, () => {
  cy.get('#dl-extension')
    .should('contain', 'Download Firefox Extension')
})

// Run happy path tests if Cypress is run via Firefox
describe('happy path suite', { browser: 'firefox' }, () => {
  it('...')
  it('...')
  it('...')
})

// Ignore test if Cypress is running via Chrome
// This test is not recorded to the Cypress Dashboard
it('Show warning outside Chrome', {  browser: '!chrome' }, () => {
  cy.get('.browser-warning')
    .should('contain', 'For optimal viewing, use Chrome browser')
})