timepicker migration (#136173)

This commit is contained in:
Rashmi Kulkarni 2022-07-12 09:25:14 -07:00 committed by GitHub
parent d533e8e789
commit cc119944b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,11 +24,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'doc_table:legacy': false,
};
const setTimeRange = async () => {
const fromTime = 'Apr 27, 2019 @ 23:56:51.374';
const toTime = 'Aug 23, 2019 @ 16:18:51.821';
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
};
const from = 'Apr 27, 2019 @ 23:56:51.374';
const to = 'Aug 23, 2019 @ 16:18:51.821';
describe('Discover Saved Searches', () => {
before('initialize tests', async () => {
@ -36,6 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.importExport.load(ecommerceSOPath);
await kibanaServer.uiSettings.update(defaultSettings);
await PageObjects.common.setTime({ from, to });
});
after('clean up archives', async () => {
@ -43,13 +41,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.importExport.unload(ecommerceSOPath);
await kibanaServer.uiSettings.unset('doc_table:legacy');
await PageObjects.common.unsetTime();
});
describe('Customize time range', () => {
it('should be possible to customize time range for saved searches on dashboards', async () => {
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.clickNewDashboard();
await setTimeRange();
await dashboardAddPanel.clickOpenAddPanel();
await dashboardAddPanel.addSavedSearch('Ecommerce Data');
expect(await dataGrid.getDocCount()).to.be(500);
@ -66,7 +64,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it(`should unselect saved search when navigating to a 'new'`, async function () {
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.selectIndexPattern('ecommerce');
await setTimeRange();
await filterBar.addFilter('category', 'is', `Men's Shoes`);
await queryBar.setQuery('customer_gender:MALE');