Skip to content

Commit

Permalink
feat(e2e): Add AppAction to expand the entire tree
Browse files Browse the repository at this point in the history
  • Loading branch information
ozyx committed Nov 17, 2022
1 parent 9c40514 commit a720fd6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions e2e/appActions.js
Expand Up @@ -189,6 +189,20 @@ async function openObjectTreeContextMenu(page, url) {
});
}

/**
* Expands the entire object tree (every expandable tree item).
* @param {import('@playwright/test').Page} page
*/
async function expandEntireTree(page) {
const treePane = page.locator('#tree-pane');
const collapsedTreeItems = treePane.locator('role=treeitem[expanded=false]');
let count = await collapsedTreeItems.count();
while (count > 0) {
await collapsedTreeItems.first().locator('.c-disclosure-triangle').click();
count = await collapsedTreeItems.count();
}
}

/**
* Gets the UUID of the currently focused object by parsing the current URL
* and returning the last UUID in the path.
Expand Down Expand Up @@ -332,6 +346,7 @@ async function setEndOffset(page, offset) {
module.exports = {
createDomainObjectWithDefaults,
expandTreePaneItemByName,
expandEntireTree,
createPlanFromJSON,
openObjectTreeContextMenu,
getHashUrlToDomainObject,
Expand Down

0 comments on commit a720fd6

Please sign in to comment.