It doesn't work at cy.wrap($doc.find("#input")).type("test", { force: true }): CypressError: Timed out retrying: Expected to find element: 'undefined', but never found it.
it('iframe - check it', function () {
cy.visit("https://jsfiddle.net/1w9jpnxo/1/");
cy.get("iframe[name='result']").then($iframe => {
const $doc = $iframe.contents();
cy.wrap($doc.find("#input")).type("test", { force: true });
//cy.wrap($doc.find("#submit")).click({ force: true });
});
})
"cypress": "^3.8.3"
Above is the common practice in internet but it doesn't work for me.
I also read through the open proposal on https://docs.cypress.io/faq/questions/using-cypress-faq.html?#How-do-I-test-elements-inside-an-iframe but cannot understand what the solution is.