@@ -25,6 +25,11 @@ describe('getComponentsTree', () => {
2525 test (
2626 'gets component metadata, including iframes' ,
2727 setupTest ( async ( page , browser ) => {
28+ await page . runInsideIframe ( '#iframe-1' , true , async ( ) => {
29+ await page . runInsideIframe ( '#iframe-2' , true , async ( ) => {
30+ await page . waitForVisible ( '#sub-sub-target' ) ;
31+ } ) ;
32+ } ) ;
2833 const tree = await browser . execute ( ( ) => {
2934 return window . getComponentsTree ( ) ;
3035 } ) ;
@@ -47,24 +52,11 @@ describe('getComponentsTree', () => {
4752 test (
4853 'gets component metadata of sub-tree inside an iframe' ,
4954 setupTest ( async ( page , browser ) => {
50- // await new Promise(resolve => {
51- // setTimeout(resolve, 1000);
52- // });
53- // const st = await browser.execute(() => {
54- // const iframe = document.querySelector('#iframe-1') as HTMLIFrameElement;
55- // const iframeDocument = iframe!.contentDocument;
56- // const subTarget = iframeDocument!.querySelector('#sub-target') as HTMLElement;
57- // return subTarget;
58- // });
59- // console.log(st);
60- const html = await browser . execute ( ( ) => {
61- const iframe = document . querySelector ( '#iframe-1' ) as HTMLIFrameElement ;
62- const iframeDocument = iframe ! . contentDocument ! ;
63- const iframe2 = iframeDocument . querySelector ( '#iframe-2' ) as HTMLIFrameElement ;
64- const iframe2Document = iframe2 ! . contentDocument ;
65- return iframe2Document ! . body . innerHTML ;
55+ await page . runInsideIframe ( '#iframe-1' , true , async ( ) => {
56+ await page . runInsideIframe ( '#iframe-2' , true , async ( ) => {
57+ await page . waitForVisible ( '#sub-sub-target' ) ;
58+ } ) ;
6659 } ) ;
67- console . log ( html ) ;
6860 const tree = await browser . execute ( ( ) => {
6961 const iframe = document . querySelector ( '#iframe-1' ) as HTMLIFrameElement ;
7062 const iframeDocument = iframe ! . contentDocument ;
0 commit comments