You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this simple page (a notfound page) in vue2 (but it's simple plain HTML):
NotFound.vue
<template>
<section>
<base-card>
<h2 id="notFoundTitle">This isn't the page you are looking for.</h2>
<p>
404 - This page could not be found - check out all our
<router-link to="/coaches">coaches</router-link>
</p>
</base-card>
</section>
</template>
now i created this simple test in Cypress:
notLogged.cy.js
let siteUrl = 'https://my.site/'
describe('Tests for pages without login', () => {
describe('Tests for the home page', () => {
it('Tests the not found page', async () => {
let url = siteUrl + '/stuff'
cy.visit(url)
let pageTitle = cy.get('#notFoundTitle')
let pagePar = cy.get('p')
expect(pageTitle).to.exist
expect(pagePar).to.exist
pageTitle.should('have.text', "This isn't the page you are looking for.")
pagePar.should('contain', '404')
})
})
})
When I run npm run cypress:run everything works fine and says that the 2 tests have passed.
BUT when I run npm run cypress:open and i use chrome for e2e testing, it throws an absurd error, shown in image:
and this doesn't makes absolutely ANY sense, since i am not searching for 'p' and 'have.text' !
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have this simple page (a notfound page) in vue2 (but it's simple plain HTML):
NotFound.vue
now i created this simple test in Cypress:
notLogged.cy.js
my
package.json
file is:When I run
npm run cypress:run
everything works fine and says that the 2 tests have passed.BUT when I run
npm run cypress:open
and i use chrome for e2e testing, it throws an absurd error, shown in image:and this doesn't makes absolutely ANY sense, since i am not searching for 'p' and 'have.text' !
Does someone have an idea why?
Beta Was this translation helpful? Give feedback.
All reactions