Skip to content

Commit

Permalink
[EuiContextMenu] Update FTR/E2E selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Oct 31, 2023
1 parent 4f211ca commit f4c7ac4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ export function ObservabilityLogExplorerPageObject({
},

getPanelEntries(contextMenu: WebElementWrapper) {
return contextMenu.findAllByCssSelector('.euiContextMenuItem:not([disabled])', 2000);
return contextMenu.findAllByCssSelector(
'button.euiContextMenuItem:not([disabled]):not([data-test-subj="contextMenuPanelTitleButton"])',
2000
);
},

getAllLogDatasetsButton() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export function MachineLearningDataFrameAnalyticsTableProvider({
public async assertJobActionViewButtonEnabled(analyticsId: string, expectedValue: boolean) {
await this.ensureJobActionsMenuOpen(analyticsId);
const actionMenuViewButton = await find.byCssSelector(
'[data-test-subj="mlAnalyticsJobViewButton"][class="euiContextMenuItem"]'
'.euiContextMenuItem[data-test-subj="mlAnalyticsJobViewButton"]'
);
const isEnabled = await actionMenuViewButton.isEnabled();
expect(isEnabled).to.eql(
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/functional/services/ml/data_visualizer_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export function MachineLearningDataVisualizerTableProvider(
await retry.tryForTime(30 * 1000, async () => {
await this.ensureActionsMenuOpen(fieldName);
const actionMenuViewInLensButton = await find.byCssSelector(
'[data-test-subj="dataVisualizerActionViewInLensButton"][class="euiContextMenuItem"]'
'.euiContextMenuItem[data-test-subj="dataVisualizerActionViewInLensButton"]'
);
const isEnabled = await actionMenuViewInLensButton.isEnabled();
expect(isEnabled).to.eql(
Expand Down Expand Up @@ -217,7 +217,7 @@ export function MachineLearningDataVisualizerTableProvider(
await this.ensureActionsMenuOpen(fieldName);

const button = await find.byCssSelector(
`[data-test-subj="${testSubj}"][class="euiContextMenuItem"]`
`.euiContextMenuItem[data-test-subj="${testSubj}"]`
);
await button.click();
await this.assertActionsMenuClosed(fieldName, testSubj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export const EXCEPTION_LIST_DETAIL_LINKED_TO_RULES_HEADER_MENU =
'[data-test-subj="exceptionListManagementRightSideMenuItemsLinkedRulesMenuEmptyButton"]';

export const EXCEPTION_LIST_DETAIL_LINKED_TO_RULES_HEADER_MENU_ITEM =
'[data-test-subj="exceptionListManagementRightSideMenuItemsLinkedRulesMenuMenuPanel"] div button';
'[data-test-subj="exceptionListManagementRightSideMenuItemsLinkedRulesMenuMenuPanel"] .euiContextMenuItem';

export const EXCEPTION_LIST_DETAIL_MENU_ITEMS =
'[data-test-subj="exceptionListManagementRightSideMenuItemsMenuActionsButtonIcon"]';
Expand Down

0 comments on commit f4c7ac4

Please sign in to comment.