jeudi 17 octobre 2019

Test inside an iframe for payment (Cypress)?

I am trying to test inside an iframe and I have searched all over the internet. Here is what most people are doing which I have tried as well, but it didn't work. So I wanted to show the reason why it's not possible to test iframe with Cypress.

 .get('iframe').then(function ($iframe) {
            console.log($iframe);
            const $body = $iframe.contents().find('body')
            console.log($body[0]);

          cy
            .wrap($body.first())
            .find('input')
            .type('4242424242424242')
});

Here is the console.log:

enter image description here

Aucun commentaire:

Enregistrer un commentaire