-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add performance test for toggling open list view
- Loading branch information
Showing
7 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
async function toggleListView() { | ||
await page.click( | ||
'.edit-post-header-toolbar__list-view-toggle, .edit-site-header-toolbar__list-view-toggle' | ||
); | ||
} | ||
|
||
async function isListViewOpen() { | ||
return await page.evaluate( () => { | ||
return !! document.querySelector( | ||
'.edit-post-header-toolbar__list-view-toggle.is-pressed, .edit-site-header-toolbar__list-view-toggle.is-pressed' | ||
); | ||
} ); | ||
} | ||
|
||
/** | ||
* Opens list view | ||
*/ | ||
export async function openListView() { | ||
const isOpen = await isListViewOpen(); | ||
if ( ! isOpen ) { | ||
await toggleListView(); | ||
} | ||
} | ||
|
||
/** | ||
* Closes list view | ||
*/ | ||
export async function closeListView() { | ||
const isOpen = await isListViewOpen(); | ||
if ( isOpen ) { | ||
await toggleListView(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters