Skip to content

Commit

Permalink
[Data Explorer][Discover][Functional Test] fix ciGroup 8 (#5104)
Browse files Browse the repository at this point in the history
Update index pattern fetch method in discover page due to changing to EuiComboBox.

Issue Resolve
#5103

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
  • Loading branch information
ananzh authored Sep 25, 2023
1 parent 8221fea commit f45e662
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const Sidebar: FC = ({ children }) => {
<EuiSplitPanel.Inner paddingSize="s" color="subdued" grow={false}>
<EuiComboBox
placeholder="Select a datasource"
data-test-subj="dataExplorerDSSelect"
singleSelection={{ asPlainText: true }}
options={options}
selectedOptions={selectedOption ? [selectedOption] : []}
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/management/_handle_alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default function ({ getService, getPageObjects }) {
it('should be able to discover and verify no of hits for alias1', async function () {
const expectedHitCount = '4';
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.selectIndexPattern('alias1*');
await retry.try(async function () {
expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount);
});
Expand Down
10 changes: 4 additions & 6 deletions test/functional/page_objects/discover_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
const opensearchChart = getService('opensearchChart');
const docTable = getService('docTable');
const dataGridTable = getService('dataGrid');
const comboBox = getService('comboBox');

/*
* This page is left unchanged since some of the other selenium tests, ex. dashboard tests, visualization tests
Expand Down Expand Up @@ -345,12 +346,9 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
await header.waitUntilLoadingHasFinished();
}

public async selectIndexPattern(indexPattern: string) {
await testSubjects.click('indexPattern-switch-link');
await find.setValue('[data-test-subj="indexPattern-switcher"] input', indexPattern);
await find.clickByCssSelector(
`[data-test-subj="indexPattern-switcher"] [title="${indexPattern}"]`
);
public async selectIndexPattern(indexPatternTitle: string) {
const dataExplorerComboBoxElement = await testSubjects.find('dataExplorerDSSelect');
await comboBox.setElement(dataExplorerComboBoxElement, indexPatternTitle);
await header.waitUntilLoadingHasFinished();
}

Expand Down

0 comments on commit f45e662

Please sign in to comment.