Cypress test not fails if test starts with Cypress.Promise

36 Views Asked by At

I am having issue when running test on Cypress.

My test function following is failing but the test status is passed. This happens if the test test starts with Cypress.Promise command. Could you please help?

it('waiting for answer', () => {
        new Cypress.Promise((resolve) => {
            resolve('ok')
        }).then((question) => {
            cy.get('x')
        })
    })

enter image description here

Note: it is working truly if the test not stars with Cypress.Promise command like below.

it('waiting for answer', () => {
        cy.request('www.google.com').then((response) => {
            new Cypress.Promise((resolve) => {
                resolve('ok')
            }).then((question) => {
                cy.get('x')
            })
        })
    })
0

There are 0 best solutions below