【问题标题】:Cypress test stops to execute in the middle of codeCypress 测试在代码中间停止执行
【发布时间】:2019-04-11 06:18:58
【问题描述】:

这是我的代码:

context('Actions', () => {
    beforeEach(() => {
        cy.visit('http://www.staging.365dropship.com') 
        cy.contains('Login').click()
        cy.wait(10000)
          .get('#fancybox-frame').then(($iframe) => {
                const $body = $iframe.contents().find('body')
                cy.wrap($body).find('#login-username').type('testtust100@gmail.com')
                cy.wrap($body).find('#login-password').type('1234567')
                cy.wrap($body).find('button').click()
            })     
    })

    it('continue', () => {
        cy.wait(10000)
        cy.url().should('include', '/owner/index')
        cy.get('a.icon-sale').click()
        cy.wait(10000)
    })

})

在登录测试无缘无故停止执行后的第一次等待,并且日志中没有错误...有人可以帮我解决我的错误吗?

that is the last screen I caught before test stops, the wait is not complete

after I got this

【问题讨论】:

    标签: cypress


    【解决方案1】:

    上述测试在我这里运行良好。我猜这些凭据已知无效,但它在我期望它失败的地方失败了:

    【讨论】:

    • 谢谢 J 先生。我使用了不同的凭据,没关系。就在单击按钮登录后,下一个等待没有完成,它不会尝试断言。测试在等待过程中停止,我看到屏幕显示没有要运行的测试...
    • 你能添加截图或截屏之类的东西吗?目前信息还不足以继续运行。
    • 上述测试也适用于我,现在由于凭据无效而失败。
    • 对我来说,它也使用无效的凭据运行。我认为问题从框架切换到原始窗口时开始。我不知道如何在此处粘贴截屏视频...我可以发送它,或者您可以使用此凭据运行代码 login 'testtust100@gmail.com' pass '1234567'
    • 确实是iframe改成原来的window了。使用有效的凭据我有同样的问题。我完全没有使用 iframe 的经验,尤其是 iframe 和无 iframe 的组合。但是请将此信息添加到原始帖子和标题中,因为这对于重现您的问题至关重要。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多