赛普拉斯没有捕获最新的XHR请求

时间:2020-05-18 03:23:18

标签: xmlhttprequest cypress

这是我的代码:

const getIframeDocument = () => {
    return cy
        .get('iframe[id="login-iframe"]')
        .its('0.contentDocument').should('exist')
}

const getIframeBody = () => {
    // get the document
    return getIframeDocument()
        // automatically retries until body is loaded
        .its('body').should('not.be.undefined')
        // wraps "body" DOM element to allow
        // chaining more Cypress commands, like ".find(...)"
        .then(cy.wrap)
}

const username = Cypress.env('username')
const password = Cypress.env('password')
context('Misc', () => {
    beforeEach('test', () => {
        cy.visit('.........GOUT=&loginChannel=PC')
    })
    it('test', () => {
        getIframeBody().find('.domain-body-input-control-username').should('exist').type(usename)
        getIframeBody().find('.domain-body-input-control-userpass').should('exist').type(password)
        getIframeBody().find('.domain-body-submit-control-submit').should('exist').click()
        cy.wait(5000)
        cy.visit('https:/....sale/index.htm#/shop?_k=qf0gj0')
        cy.get('.anticon-qrcode').should('exist')
    })
})

enter image description here enter image description here

赛普拉斯可以捕获其他XHR请求,但是赛普拉斯不会捕获最后的XHR请求“ commonSearch”。我不知道为什么?

0 个答案:

没有答案