DK
Size: a a a
DK
O
O
DK
DK
O
O
m
DK
O
O
DK
if (str !== “iowerfjoiefj”) {
throw new Error(“error”)
}
m
cy.on()очень странно работает, завязывать в нее проверки не стоит
O
if (str !== “iowerfjoiefj”) {
throw new Error(“error”)
}
cy.on('window:alert', (str) => {
console.log("DEBUG_TEST", str[0]);
if (str !== "test") {
throw new Error("error")
}
})
O
DK
const stub = cy.stub()
cy.on ('window:alert', stub)
cy.get('button').contains('Click me!').click()
.then(() => {
expect(stub.getCall(0)).to.be.calledWith('I am an alert box!')
})
DK
m
O
O
const stub = cy.stub()
cy.on ('window:alert', stub)
cy.get('button').contains('Click me!').click()
.then(() => {
expect(stub.getCall(0)).to.be.calledWith('I am an alert box!')
})