Skip to content

Commit 991ca71

Browse files
committed
fix: update create directory e2e test to match new submenu structure
1 parent 129918d commit 991ca71

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

tests/suites/tenant/summary/ActionsMenu.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import {RowTableAction} from './types';
66

77
export class ActionsMenu {
88
private menu: Locator;
9+
private subMenu: Locator;
10+
911
constructor(menu: Locator) {
1012
this.menu = menu;
13+
this.subMenu = menu.page().locator('.g-dropdown-menu__sub-menu');
1114
}
1215

1316
async isVisible(): Promise<boolean> {
@@ -29,6 +32,18 @@ export class ActionsMenu {
2932
await menuItem.click();
3033
}
3134

35+
async hoverItem(itemText: string): Promise<void> {
36+
const menuItem = this.menu.locator(`.g-menu__item:has-text("${itemText}")`);
37+
await menuItem.hover();
38+
}
39+
40+
async clickSubMenuItem(parentText: string, childText: string): Promise<void> {
41+
await this.hoverItem(parentText);
42+
const childItem = this.subMenu.locator(`.g-menu__item-content:has-text("${childText}")`);
43+
await childItem.waitFor({state: 'visible', timeout: VISIBILITY_TIMEOUT});
44+
await childItem.click();
45+
}
46+
3247
async isItemSelected(itemText: string): Promise<boolean> {
3348
const menuItem = this.menu.locator(`.g-menu__item:has-text("${itemText}")`);
3449
const className = (await menuItem.getAttribute('class')) || '';

tests/suites/tenant/summary/ObjectSummary.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,22 @@ export class ObjectSummary {
264264
await this.clickActionsMenuItem(menuItemText);
265265
}
266266

267+
async clickActionSubMenuItem(
268+
treeItemText: string,
269+
parentMenuText: string,
270+
childMenuText: string,
271+
): Promise<void> {
272+
await this.clickActionsButton(treeItemText);
273+
await this.clickActionsSubMenuItem(parentMenuText, childMenuText);
274+
}
275+
276+
async clickActionsSubMenuItem(
277+
parentMenuText: string,
278+
childMenuText: string,
279+
): Promise<void> {
280+
await this.actionsMenu.clickSubMenuItem(parentMenuText, childMenuText);
281+
}
282+
267283
async clickRefreshButton(): Promise<void> {
268284
await this.refreshButton.click();
269285
}

tests/suites/tenant/summary/objectSummary.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ test.describe('Object Summary', async () => {
258258
const directoryName = `test_dir_${Date.now()}`;
259259

260260
// Open actions menu and click Create directory
261-
await objectSummary.clickActionMenuItem('local', RowTableAction.CreateDirectory);
261+
await objectSummary.clickActionSubMenuItem('local', 'Create...', 'Directory');
262262
await expect(objectSummary.isCreateDirectoryModalVisible()).resolves.toBe(true);
263263

264264
// Create directory

0 commit comments

Comments
 (0)