MCPcopy Index your code
hub / github.com/angular/angular / enterIframe

Function enterIframe

devtools/cypress/support/commands.js:14–28  ·  view source on GitHub ↗

* Selects an Iframe and returns its body when it's done loading. * @param {string} selector - The selector for the iframe. * @returns {Function} A function that returns the wrapped body of the iframe.

(selector)

Source from the content-addressed store, hash-verified

12 * @returns {Function} A function that returns the wrapped body of the iframe.
13 */
14function enterIframe(selector) {
15 return cy.get(selector, {log: false}).then({timeout: 30000}, async (frame) => {
16 const contentWindow = frame.prop('contentWindow');
17
18 while (
19 contentWindow.location.toString() === 'about:blank' ||
20 contentWindow.document.readyState !== 'complete'
21 ) {
22 await new Promise((resolve) => setTimeout(resolve));
23 }
24
25 // return the body of the iframe wrapped in cypress
26 return () => cy.wrap(contentWindow.document.body);
27 });
28}
29
30Cypress.Commands.add('enterIframe', enterIframe);

Callers

nothing calls this directly

Calls 6

setTimeoutFunction · 0.85
thenMethod · 0.65
getMethod · 0.65
toStringMethod · 0.65
wrapMethod · 0.65
propMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…