mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
timepicker-url sync functional test (#115173)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
04a61bfcd4
commit
b9024c6ad5
2 changed files with 25 additions and 3 deletions
|
@ -42,7 +42,7 @@ export default function ({ loadTestFile }) {
|
|||
loadTestFile(require.resolve('./beats/listing'));
|
||||
loadTestFile(require.resolve('./beats/beat_detail'));
|
||||
|
||||
// loadTestFile(require.resolve('./time_filter'));
|
||||
loadTestFile(require.resolve('./time_filter'));
|
||||
loadTestFile(require.resolve('./enable_monitoring'));
|
||||
|
||||
loadTestFile(require.resolve('./setup/metricbeat_migration'));
|
||||
|
|
|
@ -12,22 +12,44 @@ export default function ({ getService, getPageObjects }) {
|
|||
const PageObjects = getPageObjects(['header', 'timePicker']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const clusterList = getService('monitoringClusterList');
|
||||
const browser = getService('browser');
|
||||
|
||||
const assertTimePickerRange = async (start, end) => {
|
||||
const timeConfig = await PageObjects.timePicker.getTimeConfig();
|
||||
expect(timeConfig.start).to.eql(start);
|
||||
expect(timeConfig.end).to.eql(end);
|
||||
};
|
||||
|
||||
describe('Timefilter', () => {
|
||||
const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects);
|
||||
|
||||
const from = 'Aug 15, 2017 @ 21:00:00.000';
|
||||
const to = 'Aug 16, 2017 @ 00:00:00.000';
|
||||
|
||||
before(async () => {
|
||||
await setup('x-pack/test/functional/es_archives/monitoring/multicluster', {
|
||||
from: 'Aug 15, 2017 @ 21:00:00.000',
|
||||
to: 'Aug 16, 2017 @ 00:00:00.000',
|
||||
from,
|
||||
to,
|
||||
});
|
||||
await clusterList.assertDefaults();
|
||||
await clusterList.closeAlertsModal();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await tearDown();
|
||||
});
|
||||
|
||||
it('syncs timepicker with url hash updates', async () => {
|
||||
await assertTimePickerRange(from, to);
|
||||
|
||||
await browser.execute(() => {
|
||||
const hash = window.location.hash;
|
||||
window.location.hash = hash.replace(/time:\(([^)]+)\)/, 'time:(from:now-15m,to:now)');
|
||||
});
|
||||
|
||||
await assertTimePickerRange('~ 15 minutes ago', 'now');
|
||||
});
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/48910
|
||||
it.skip('should send another request when clicking Refresh', async () => {
|
||||
await testSubjects.click('querySubmitButton');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue