Changeset 56090
- Timestamp:
- 06/28/2023 10:57:48 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/e2e/specs/edit-posts.test.js
r56089 r56090 28 28 await page.waitForSelector( '#the-list .type-post' ); 29 29 30 // Wait for the editor iframe to load, and switch to it as the active content frame. 31 const editorFrame = await page.waitForSelector( 'iframe[name="editor-canvas"]' ); 30 // Expect there to be one row in the post list. 31 const posts = await page.$$( '#the-list .type-post' ); 32 expect( posts.length ).toBe( 1 ); 32 33 33 const innerFrame = await editorFrame.contentFrame();34 const [ firstPost ] = posts; 34 35 35 // Wait for title field to render onscreen. 36 await innerFrame.waitForSelector( '.editor-post-title__input' ); 37 38 // Expect to now be in the editor with the correct post title shown. 39 const editorPostTitleInput = await innerFrame.$x( 40 `//h1[contains(@class, "editor-post-title__input")][contains(text(), "${ title }")]` 36 // Expect the title of the post to be correct. 37 const postTitle = await firstPost.$x( 38 `//a[contains(@class, "row-title")][contains(text(), "${ title }")]` 41 39 ); 42 40 expect( postTitle.length ).toBe( 1 ); … … 57 55 await editLink.click(); 58 56 59 // Edit the post. 60 await page.waitForNavigation(); 57 // Wait for the editor iframe to load, and switch to it as the active content frame. 58 const editorFrame = await page.waitForSelector( 'iframe[name="editor-canvas"]' ); 59 60 const innerFrame = await editorFrame.contentFrame(); 61 61 62 62 // Wait for title field to render onscreen. 63 await page.waitForSelector( '.editor-post-title__input' );63 await innerFrame.waitForSelector( '.editor-post-title__input' ); 64 64 65 65 // Expect to now be in the editor with the correct post title shown. 66 const editorPostTitleInput = await page.$x(66 const editorPostTitleInput = await innerFrame.$x( 67 67 `//h1[contains(@class, "editor-post-title__input")][contains(text(), "${ title }")]` 68 68 );
Note: See TracChangeset
for help on using the changeset viewer.