在柏树中等待重定向?

时间:2020-04-27 11:27:50

标签: automation xmlhttprequest cypress

我正在测试一个商店网站,该网站使用Bamboora作为测试其订单流程的一种方式。因此,我能做的就是等待Bamboora页面加载,我无法缝制找出方法是等待Bamboora发送XHR请求并重定向回商店,以便商店可以显示“订单”完成”。

这是当我单击将我带到Bamboora的按钮时的处理方法的代码。(https://www.bambora.com/

cy //confirmation before bambora
            .get('.sticky-bottom')
            .find('.innerwrapper-checkout-footer')
            .find('.v-btn')
            .click()
            .wait(6000)

在页面上,我需要等到Bamboora确认并完成付款,并且在手动测试时最多可以持续6-7秒。

enter image description here

这是我尝试使重定向到商店站点的可能性:

    cy
        .get('.credit-card-form__removeText___1PUtd')
        .click()
    cy
        .get('.buttons__debugContainerButton___2FwvW')
        .eq('0')
        .click()
    cy
        .get('.payment-card-start__payButton___3NC_4')
        .click()

    cy
        .request('https://t-carlsjrapp.dsgapps.dk/pending-order')

1 个答案:

答案 0 :(得分:0)

我认为Bambora已加载到iFrame中。我在work with iFrames in Cypress上找到了这篇文章。

我还没有测试过。