此路径不起作用/////
我想在这里访问
describe('Second GA Tracking', () => {
it('should be called', () => {
cy.server();
// cy.fixture('cypress/fixture/fixture.json').as('@getSecondGA');
cy.visit(chps.url);
cy.wait('UA-5883199-36').then((img) => {
assert.isNotNull(img.response.body.data, 'Second GA Tracking call has data');
});
});
});
答案 0 :(得分:0)
您错过了cy.route()
通话。试试这个:
describe('Second GA Tracking', () => {
it('should be called', () => {
cy.server();
cy.route('**UA-5883199-36**').as('getRequest');
cy.visit(chps.url);
cy.wait('@getRequest').then(request => {
assert.isNotNull(request.response.body.data, 'Second GA Tracking call has data');
});
});
});