Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add swith to datagrid table and fix ciGroup1 #5816

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/functional/apps/context/_context_navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default function ({ getService, getPageObjects }) {
before(async function () {
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
await PageObjects.discover.clickFieldListItemDetails(columnName);
await PageObjects.discover.clickFieldListPlusFilter(columnName, value);
Expand Down
2 changes: 2 additions & 0 deletions test/functional/apps/context/_date_nanos.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default function ({ getService, getPageObjects }) {

describe('context view for date_nanos', () => {
before(async function () {
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await security.testUser.setRoles([
'opensearch_dashboards_admin',
'opensearch_dashboards_date_nanos',
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/context/_discover_navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default function ({ getService, getPageObjects }) {
before(async () => {
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');

for (const columnName of TEST_COLUMN_NAMES) {
await PageObjects.discover.clickFieldListItemAdd(columnName);
Expand Down
4 changes: 3 additions & 1 deletion test/functional/apps/context/_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ export default function ({ getService, getPageObjects }) {
const browser = getService('browser');
const testSubjects = getService('testSubjects');

const PageObjects = getPageObjects(['common', 'context']);
const PageObjects = getPageObjects(['common', 'context', 'discover']);

describe('context filters', function contextSize() {
beforeEach(async function () {
await browser.refresh();
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID, {
columns: TEST_COLUMN_NAMES,
});
Expand Down
4 changes: 3 additions & 1 deletion test/functional/apps/context/_size.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ export default function ({ getService, getPageObjects }) {
const opensearchDashboardsServer = getService('opensearchDashboardsServer');
const retry = getService('retry');
const dataGrid = getService('dataGrid');
const PageObjects = getPageObjects(['context']);
const PageObjects = getPageObjects(['common', 'context', 'discover']);
let expectedRowLength = 2 * TEST_DEFAULT_CONTEXT_SIZE + 1;

describe('context size', function contextSize() {
before(async function () {
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await opensearchDashboardsServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
Expand Down
4 changes: 4 additions & 0 deletions test/functional/apps/management/_scripted_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export default function ({ getService, getPageObjects }) {
const fromTime = 'Sep 17, 2015 @ 06:31:44.000';
const toTime = 'Sep 18, 2015 @ 18:31:44.000';
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await PageObjects.discover.selectIndexPattern('logstash-*');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);

Expand Down Expand Up @@ -279,6 +280,7 @@ export default function ({ getService, getPageObjects }) {
const fromTime = 'Sep 17, 2015 @ 06:31:44.000';
const toTime = 'Sep 18, 2015 @ 18:31:44.000';
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await PageObjects.discover.selectIndexPattern('logstash-*');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);

Expand Down Expand Up @@ -375,6 +377,7 @@ export default function ({ getService, getPageObjects }) {
const fromTime = 'Sep 17, 2015 @ 06:31:44.000';
const toTime = 'Sep 18, 2015 @ 18:31:44.000';
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await PageObjects.discover.selectIndexPattern('logstash-*');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);

Expand Down Expand Up @@ -473,6 +476,7 @@ export default function ({ getService, getPageObjects }) {
const fromTime = 'Sep 17, 2015 @ 19:22:00.000';
const toTime = 'Sep 18, 2015 @ 07:00:00.000';
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await PageObjects.discover.selectIndexPattern('logstash-*');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);

Expand Down
26 changes: 26 additions & 0 deletions test/functional/page_objects/discover_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,32 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
`Could not find a clickable list item for column "${columnName}" with list item "${title}".`
);
}

public async switchDiscoverTable(tableType: string) {
await retry.try(async () => {
const switchButton = await testSubjects.find('datagridTableButton');
const buttonText = await switchButton.getVisibleText();

if (tableType === 'new' && buttonText.includes('Try new Discover')) {
await switchButton.click();
} else if (tableType === 'legacy' && buttonText.includes('Use legacy Discover')) {
await switchButton.click();
}
});

// Wait for the query input to be visible
await this.waitForQueryInput();
}

async waitForQueryInput() {
// Wait for the query input to be visible
await retry.try(async () => {
const queryInputVisible = await testSubjects.exists('queryInput');
if (!queryInputVisible) {
throw new Error('Query input not yet visible');
}
});
}
}

return new DiscoverPage();
Expand Down
Loading