Skip to content

Commit

Permalink
Fix functional 3 and 4 for discover legacy (#5822)
Browse files Browse the repository at this point in the history
* fix 3 and 4

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* fix functional 3 and 4

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* dashboard expect

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

---------

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
  • Loading branch information
abbyhu2000 committed Feb 7, 2024
1 parent 1f0c1b0 commit e38e1c4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
12 changes: 11 additions & 1 deletion test/functional/apps/dashboard/dashboard_filter_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ export default function ({ getService, getPageObjects }) {
const opensearchArchiver = getService('opensearchArchiver');
const opensearchDashboardsServer = getService('opensearchDashboardsServer');
const browser = getService('browser');
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'visualize', 'timePicker']);
const PageObjects = getPageObjects([
'common',
'dashboard',
'header',
'visualize',
'timePicker',
'discover',
]);

describe('dashboard filter bar', () => {
before(async () => {
Expand Down Expand Up @@ -185,6 +192,9 @@ export default function ({ getService, getPageObjects }) {
describe('saved search filtering', function () {
before(async () => {
await filterBar.ensureFieldEditorModalIsClosed();
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.timePicker.setDefaultDataRange();
Expand Down
15 changes: 13 additions & 2 deletions test/functional/apps/dashboard/dashboard_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ export default function ({ getService, getPageObjects }) {
const opensearchDashboardsServer = getService('opensearchDashboardsServer');
const security = getService('security');
const dashboardPanelActions = getService('dashboardPanelActions');
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'visualize', 'timePicker']);
const PageObjects = getPageObjects([
'common',
'dashboard',
'header',
'visualize',
'timePicker',
'discover',
]);

describe('dashboard filtering', function () {
this.tags('includeFirefox');
Expand All @@ -72,6 +79,10 @@ export default function ({ getService, getPageObjects }) {

describe('adding a filter that excludes all data', () => {
before(async () => {
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.timePicker.setDefaultDataRange();
await dashboardAddPanel.addEveryVisualization('"Filter Bytes Test"');
Expand Down Expand Up @@ -219,7 +230,7 @@ export default function ({ getService, getPageObjects }) {
});

it('saved searches', async () => {
await dashboardExpect.savedSearchRowCount(1);
await testSubjects.existOrFail('docTableExpandToggleColumn');
});

it('vega', async () => {
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/dashboard/dashboard_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export default function ({ getService, getPageObjects }) {

describe('dashboard state', function describeIndexTests() {
before(async function () {
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.switchDiscoverTable('new');
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.initTests();
await PageObjects.dashboard.preserveCrossAppState();
await browser.refresh();
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/dashboard_time_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ export default function ({ getService, getPageObjects }) {
fields: ['bytes', 'agent'],
});
// Current data grid loads 100 rows per page by default with inspect button and time range
await dashboardExpect.dataGridTableCellCount(400);
await dashboardExpect.savedSearchRowCountFromLegacyTable(100);

// Set to time range with no data
await PageObjects.timePicker.setAbsoluteRange(
'Jan 1, 2000 @ 00:00:00.000',
'Jan 1, 2000 @ 01:00:00.000'
);
await dashboardExpect.dataGridTableCellCount(0);
await dashboardExpect.savedSearchRowCountFromLegacyTable(0);
});

it('Timepicker start, end, interval values are set by url', async () => {
Expand Down

0 comments on commit e38e1c4

Please sign in to comment.