无法在 Cypress.io 中加载本地主机 URL
Unable to load localhost URL in Cypress.io
我在 Cypress.io 中遇到问题,当我加载本地 URL 时,它每次都会出错。如官方文档所述,我什至在 cypress.json 文件中添加了 { "baseUrl": "http://localhost:4200" }。
以下是我的几个测试脚本:
it('successfully loads', () => {
cy.visit('http://localhost:4200/') // change URL to match your dev URL
})
it('successfully load', () => {
cy.visit('/') // change URL to match your dev URL
})
我不确定为什么在这种情况下会出现错误,但如果您只需要将其关闭 - 您可以在 cy.visit 调用下添加此行。该错误不应再次出现。
Cypress.on('uncaught:exception', (err, runnable) => { return false; })
我在 Cypress.io 中遇到问题,当我加载本地 URL 时,它每次都会出错。如官方文档所述,我什至在 cypress.json 文件中添加了 { "baseUrl": "http://localhost:4200" }。
以下是我的几个测试脚本:
it('successfully loads', () => {
cy.visit('http://localhost:4200/') // change URL to match your dev URL
})
it('successfully load', () => {
cy.visit('/') // change URL to match your dev URL
})
我不确定为什么在这种情况下会出现错误,但如果您只需要将其关闭 - 您可以在 cy.visit 调用下添加此行。该错误不应再次出现。
Cypress.on('uncaught:exception', (err, runnable) => { return false; })