nice-hamburger-65093
04/20/2023, 1:33 PMenough-truck-68085
04/20/2023, 3:47 PMnice-hamburger-65093
04/20/2023, 3:49 PMnice-hamburger-65093
04/20/2023, 3:52 PMenough-truck-68085
04/20/2023, 3:55 PMnice-hamburger-65093
04/20/2023, 3:57 PMnice-hamburger-65093
04/20/2023, 3:58 PMnice-hamburger-65093
04/20/2023, 4:00 PMnice-hamburger-65093
04/20/2023, 4:03 PMts
describe('mode demo disabled', () => {
let sessionId: string;
let orderId: string;
beforeEach(() => {
cy.request<{ data: { sessionId: string; orderId: string; } }>({
method: 'POST',
url: `${MERCHANT_API_HOST}/init`,
body: initParams,
}).as('init').then(res => {
sessionId = res.body.data.sessionId;
orderId = res.body.data.orderId;
});
cy.intercept('GET', `**/api/ip`, { fixture: 'api.ip.json' }).as('ip');
cy.intercept('POST', `**/purchase`, { fixture: 'success.json' }).as('purchase');
});
it('should display welcome message', () => {
cy.visit(
'',
{
onBeforeLoad(win: Cypress.AUTWindow) {
cy.spy(win, 'postMessage').as('postMessage');
},
},
);
cy.get('[data-testid="card-number"]').type(TEST_CARD_WITH_3DS_PAYMENT.cardNumber);
cy.get('[data-testid="expire"]').type(TEST_CARD_WITH_3DS_PAYMENT.expire);
cy.get('[data-testid="cvv"]').type(TEST_CARD_WITH_3DS_PAYMENT.cvv);
cy.get('[data-testid="name-on-card"]').type(TEST_CARD_WITH_3DS_PAYMENT.nameOnCard);
cy.get('[data-testid="submit"]').click();
cy.get('@postMessage').should('be.calledOnce');
});
});nice-hamburger-65093
04/20/2023, 4:05 PMnice-hamburger-65093
04/20/2023, 4:06 PMhttps://cdn.discordapp.com/attachments/1098602319907667998/1098640925141512322/Screenshot_2023-04-20_at_22.06.23.png▾
nice-hamburger-65093
04/20/2023, 4:07 PMnice-hamburger-65093
04/20/2023, 4:08 PMenough-truck-68085
04/20/2023, 4:18 PMip endpoint?
- From your image above the canceled ip request has a different initiator VM2523 ... than the second ip request that comes from the pay service. Can we confirm that this is the same endpoint
Also is there actually any issues with the second test or are you just wondering about the cancelled endpoint? It looks like maybe that endpoint is being called from some other source and maybe it shouldn't be? I don't know the BE at all but it might be worth just manually poking through the app and seeing if you see the same set of network calls as you do with Cypress. My guess is that you would see the same canceled endpoint just manually testing.
If you don't then the only thing other thing I can think of is that Cypress refreshes the state of the app when it runs the second test and it could be cancelling any in-progress requests when it clears and revisits the app for the second test, which would be expected of course.nice-hamburger-65093
04/20/2023, 4:24 PMnice-hamburger-65093
04/20/2023, 4:25 PMnice-hamburger-65093
04/20/2023, 4:26 PMhttps://cdn.discordapp.com/attachments/1098602319907667998/1098645838907064411/Screenshot_2023-04-20_at_22.26.08.png▾
nice-hamburger-65093
04/20/2023, 4:27 PMnice-hamburger-65093
04/20/2023, 4:28 PMnice-hamburger-65093
04/20/2023, 4:29 PMip enpoint?enough-truck-68085
04/20/2023, 4:39 PMhttps://cdn.discordapp.com/attachments/1098602319907667998/1098649132396195994/image.png▾
https://cdn.discordapp.com/attachments/1098602319907667998/1098649132647858226/image.png▾
nice-hamburger-65093
04/20/2023, 5:01 PMenough-truck-68085
04/20/2023, 5:04 PMnice-hamburger-65093
04/20/2023, 5:06 PMnice-hamburger-65093
04/20/2023, 5:11 PMcy.wait was before submitting form (request sent after form is submitted), and wherefore it fails with timeout, in Network tab request was in cancelled state, and this situation sent me on the wrong path 😁enough-truck-68085
04/20/2023, 5:11 PM