Skip to content

Commit

Permalink
test: fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avallete committed Apr 2, 2021
1 parent e789a2e commit c2e282e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cypress/integration/simple.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ describe('test extension', () => {
// TODO: Add more e2e tests when youtube webapp is not a nightmare to work with cypress anymore
// as today, it's near impossible to do anything close to end user interactions (like login)
it('extension load and set run attr to <html> tag', () => {
// mock youtube website to avoid redirect to 'https://consent.youtube.com'
cy.intercept('https://www.youtube.com', {
statusCode: 200,
body: '<html><body><div>mocked youtube</div></body></html>',
})
cy.visit('https://www.youtube.com')
cy.get('html').should('have.attr', `data-${U.id}-has-run`)
})
Expand Down

0 comments on commit c2e282e

Please sign in to comment.