From a984cbef71ea9d30c19c13778fc7fb8dc4ed9af6 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Sat, 4 Apr 2020 10:53:36 +0300 Subject: [PATCH 01/10] enable w3c for chrome --- test/functional/page_objects/discover_page.ts | 9 ++++++--- test/functional/services/remote/webdriver.ts | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 10652ce3ec4b2..fa268f5612004 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -130,20 +130,23 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider public async clickHistogramBar() { const el = await elasticChart.getCanvas(); + const x = browser.isW3CEnabled ? 0 : 200; await browser .getActions() - .move({ x: 200, y: 20, origin: el._webElement }) + .move({ x, y: 20, origin: el._webElement }) .click() .perform(); } public async brushHistogram() { const el = await elasticChart.getCanvas(); + const x1 = browser.isW3CEnabled ? -300 : 200; + const x2 = browser.isW3CEnabled ? -100 : 400; await browser.dragAndDrop( - { location: el, offset: { x: 200, y: 20 } }, - { location: el, offset: { x: 400, y: 30 } } + { location: el, offset: { x: x1, y: 20 } }, + { location: el, offset: { x: x2, y: 30 } } ); } diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts index 382543822d8ac..7926a37c959fc 100644 --- a/test/functional/services/remote/webdriver.ts +++ b/test/functional/services/remote/webdriver.ts @@ -107,7 +107,7 @@ async function attemptToCreateCommand( chromeOptions.push('headless', 'disable-gpu', 'remote-debugging-port=9222'); } chromeCapabilities.set('goog:chromeOptions', { - w3c: false, + w3c: true, args: chromeOptions, }); chromeCapabilities.set('goog:loggingPrefs', { browser: 'ALL' }); From 40b9dbdab8cbe422a2dc65a2c2403c83f9a07b5d Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Sat, 4 Apr 2020 16:20:24 +0300 Subject: [PATCH 02/10] update maps tests --- test/functional/page_objects/common_page.ts | 31 ++++++------------- test/functional/page_objects/discover_page.ts | 9 ++---- test/functional/services/remote/webdriver.ts | 1 + .../core_plugins/application_leave_confirm.ts | 2 ++ .../functional/apps/maps/add_layer_panel.js | 4 +++ x-pack/test/functional/apps/maps/discover.js | 4 +++ .../apps/maps/documents_source/search_hits.js | 4 +++ .../apps/maps/es_geo_grid_source.js | 12 +++++++ .../import_geojson/add_layer_import_panel.js | 4 +++ .../import_geojson/file_indexing_panel.js | 4 +++ x-pack/test/functional/apps/maps/joins.js | 1 + .../test/functional/apps/maps/layer_errors.js | 4 +++ .../test/functional/apps/maps/sample_data.js | 3 ++ .../apps/maps/visualize_create_menu.js | 4 +++ .../test/functional/page_objects/gis_page.js | 27 ++++++++++------ 15 files changed, 76 insertions(+), 38 deletions(-) diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index de4917ef2b1b3..fc7860eecc830 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -43,7 +43,6 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo appConfig: {}; ensureCurrentUrl: boolean; shouldLoginIfPrompted: boolean; - shouldAcceptAlert: boolean; useActualUrl: boolean; } @@ -127,13 +126,7 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo } private async navigate(navigateProps: NavigateProps) { - const { - appConfig, - ensureCurrentUrl, - shouldLoginIfPrompted, - shouldAcceptAlert, - useActualUrl, - } = navigateProps; + const { appConfig, ensureCurrentUrl, shouldLoginIfPrompted, useActualUrl } = navigateProps; const appUrl = getUrl.noAuth(config.get('servers.kibana'), appConfig); await retry.try(async () => { @@ -141,7 +134,9 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo log.debug(`navigateToActualUrl ${appUrl}`); await browser.get(appUrl); } else { - await CommonPage.navigateToUrlAndHandleAlert(appUrl, shouldAcceptAlert); + log.debug(`navigateToUrl ${appUrl}`); + await browser.get(appUrl); + // await CommonPage.navigateToUrlAndHandleAlert(appUrl, shouldAcceptAlert); } const currentUrl = shouldLoginIfPrompted @@ -167,7 +162,6 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo basePath = '', ensureCurrentUrl = true, shouldLoginIfPrompted = true, - shouldAcceptAlert = true, useActualUrl = false, } = {} ) { @@ -180,7 +174,6 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo appConfig, ensureCurrentUrl, shouldLoginIfPrompted, - shouldAcceptAlert, useActualUrl, }); } @@ -200,7 +193,6 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo basePath = '', ensureCurrentUrl = true, shouldLoginIfPrompted = true, - shouldAcceptAlert = true, useActualUrl = true, } = {} ) { @@ -214,7 +206,6 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo appConfig, ensureCurrentUrl, shouldLoginIfPrompted, - shouldAcceptAlert, useActualUrl, }); } @@ -228,18 +219,12 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo async navigateToActualUrl( appName: string, hash?: string, - { - basePath = '', - ensureCurrentUrl = true, - shouldLoginIfPrompted = true, - shouldAcceptAlert = true, - } = {} + { basePath = '', ensureCurrentUrl = true, shouldLoginIfPrompted = true } = {} ) { await this.navigateToUrl(appName, hash, { basePath, ensureCurrentUrl, shouldLoginIfPrompted, - shouldAcceptAlert, useActualUrl: true, }); } @@ -252,7 +237,7 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo async navigateToApp( appName: string, - { basePath = '', shouldLoginIfPrompted = true, shouldAcceptAlert = true, hash = '' } = {} + { basePath = '', shouldLoginIfPrompted = true, hash = '' } = {} ) { let appUrl: string; if (config.has(['apps', appName])) { @@ -274,7 +259,9 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo await retry.tryForTime(defaultTryTimeout * 2, async () => { let lastUrl = await retry.try(async () => { // since we're using hash URLs, always reload first to force re-render - await CommonPage.navigateToUrlAndHandleAlert(appUrl, shouldAcceptAlert); + log.debug('navigate to: ' + appUrl); + await browser.get(appUrl); + // await CommonPage.navigateToUrlAndHandleAlert(appUrl, shouldAcceptAlert); await this.sleep(700); log.debug('returned from get, calling refresh'); await browser.refresh(); diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index fa268f5612004..22b41c25b14f3 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -130,23 +130,20 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider public async clickHistogramBar() { const el = await elasticChart.getCanvas(); - const x = browser.isW3CEnabled ? 0 : 200; await browser .getActions() - .move({ x, y: 20, origin: el._webElement }) + .move({ x: 0, y: 20, origin: el._webElement }) .click() .perform(); } public async brushHistogram() { const el = await elasticChart.getCanvas(); - const x1 = browser.isW3CEnabled ? -300 : 200; - const x2 = browser.isW3CEnabled ? -100 : 400; await browser.dragAndDrop( - { location: el, offset: { x: x1, y: 20 } }, - { location: el, offset: { x: x2, y: 30 } } + { location: el, offset: { x: -300, y: 20 } }, + { location: el, offset: { x: -100, y: 30 } } ); } diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts index 7926a37c959fc..3bf5b865aa7ba 100644 --- a/test/functional/services/remote/webdriver.ts +++ b/test/functional/services/remote/webdriver.ts @@ -110,6 +110,7 @@ async function attemptToCreateCommand( w3c: true, args: chromeOptions, }); + chromeCapabilities.set('unexpectedAlertBehaviour', 'accept'); chromeCapabilities.set('goog:loggingPrefs', { browser: 'ALL' }); const session = await new Builder() diff --git a/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts b/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts index f892e52754c57..7dfc7d53fbfae 100644 --- a/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts +++ b/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts @@ -47,6 +47,8 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider expect(await browser.getCurrentUrl()).to.eql(getKibanaUrl('/app/appleave1')); }); it('allows navigation if user click confirm on the confirmation dialog', async () => { + const alert = await browser.getAlert(); + await alert?.accept(); await PageObjects.common.navigateToApp('appleave1'); await appsMenu.clickLink('AppLeave 2'); diff --git a/x-pack/test/functional/apps/maps/add_layer_panel.js b/x-pack/test/functional/apps/maps/add_layer_panel.js index c5834ab977610..ada7a17d3db74 100644 --- a/x-pack/test/functional/apps/maps/add_layer_panel.js +++ b/x-pack/test/functional/apps/maps/add_layer_panel.js @@ -20,6 +20,10 @@ export default function({ getService, getPageObjects }) { await PageObjects.maps.selectVectorLayer(LAYER_NAME); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage(); + }); + it('should show unsaved layer in layer TOC', async () => { const vectorLayerExists = await PageObjects.maps.doesLayerExist(LAYER_NAME); expect(vectorLayerExists).to.be(true); diff --git a/x-pack/test/functional/apps/maps/discover.js b/x-pack/test/functional/apps/maps/discover.js index ce33596476755..2b0f5f85a321a 100644 --- a/x-pack/test/functional/apps/maps/discover.js +++ b/x-pack/test/functional/apps/maps/discover.js @@ -15,6 +15,10 @@ export default function({ getService, getPageObjects }) { await PageObjects.common.navigateToApp('discover'); }); + afterEach(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + it('should link geo_shape fields to Maps application', async () => { await PageObjects.discover.selectIndexPattern('geo_shapes*'); await PageObjects.discover.clickFieldListItem('geometry'); diff --git a/x-pack/test/functional/apps/maps/documents_source/search_hits.js b/x-pack/test/functional/apps/maps/documents_source/search_hits.js index 44668b20603a4..6c9280c59988d 100644 --- a/x-pack/test/functional/apps/maps/documents_source/search_hits.js +++ b/x-pack/test/functional/apps/maps/documents_source/search_hits.js @@ -15,6 +15,10 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('document example'); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + async function getRequestTimestamp() { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/apps/maps/es_geo_grid_source.js b/x-pack/test/functional/apps/maps/es_geo_grid_source.js index 62acf13e4d860..b232cf2749654 100644 --- a/x-pack/test/functional/apps/maps/es_geo_grid_source.js +++ b/x-pack/test/functional/apps/maps/es_geo_grid_source.js @@ -90,6 +90,10 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('geo grid heatmap example'); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + const LAYER_ID = '3xlvm'; const HEATMAP_PROP_NAME = '__kbn_heatmap_weight__'; @@ -140,6 +144,10 @@ export default function({ getPageObjects, getService }) { await inspector.close(); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + it('should contain geotile_grid aggregation elasticsearch request', async () => { await inspector.open(); await inspector.openInspectorRequestsView(); @@ -219,6 +227,10 @@ export default function({ getPageObjects, getService }) { await inspector.close(); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + it('should contain geotile_grid aggregation elasticsearch request', async () => { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js b/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js index 5bad43779fe57..ea233878a42c6 100644 --- a/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js +++ b/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js @@ -31,6 +31,10 @@ export default function({ getPageObjects }) { await PageObjects.maps.closeOrCancelLayer(); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage(); + }); + it('should add GeoJSON file to map', async () => { const layerLoadedInToc = await PageObjects.maps.doesLayerExist(IMPORT_FILE_PREVIEW_NAME); expect(layerLoadedInToc).to.be(true); diff --git a/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js b/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js index 218f74678001c..f5b342d539901 100644 --- a/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js +++ b/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js @@ -49,6 +49,10 @@ export default function({ getService, getPageObjects }) { await PageObjects.maps.waitForLayerAddPanelClosed(); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + it('should not activate add layer button until indexing succeeds', async () => { await indexPoint(); diff --git a/x-pack/test/functional/apps/maps/joins.js b/x-pack/test/functional/apps/maps/joins.js index 89a6c6ea82e53..7986a83f282d2 100644 --- a/x-pack/test/functional/apps/maps/joins.js +++ b/x-pack/test/functional/apps/maps/joins.js @@ -33,6 +33,7 @@ export default function({ getPageObjects, getService }) { after(async () => { await inspector.close(); + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); }); it('should re-fetch join with refresh timer', async () => { diff --git a/x-pack/test/functional/apps/maps/layer_errors.js b/x-pack/test/functional/apps/maps/layer_errors.js index ae58d38171fb7..58e77e7062fdb 100644 --- a/x-pack/test/functional/apps/maps/layer_errors.js +++ b/x-pack/test/functional/apps/maps/layer_errors.js @@ -14,6 +14,10 @@ export default function({ getPageObjects }) { await PageObjects.maps.loadSavedMap('layer with errors'); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + describe('ESSearchSource with missing index pattern id', () => { const MISSING_INDEX_ID = 'idThatDoesNotExitForESSearchSource'; const LAYER_NAME = MISSING_INDEX_ID; diff --git a/x-pack/test/functional/apps/maps/sample_data.js b/x-pack/test/functional/apps/maps/sample_data.js index bc6f96167b3c4..644f2be19fbcc 100644 --- a/x-pack/test/functional/apps/maps/sample_data.js +++ b/x-pack/test/functional/apps/maps/sample_data.js @@ -45,6 +45,7 @@ export default function({ getPageObjects, getService, updateBaselines }) { after(async () => { await PageObjects.maps.existFullScreen(); + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.home.removeSampleDataSet('ecommerce'); @@ -72,6 +73,7 @@ export default function({ getPageObjects, getService, updateBaselines }) { after(async () => { await PageObjects.maps.existFullScreen(); + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.home.removeSampleDataSet('flights'); @@ -101,6 +103,7 @@ export default function({ getPageObjects, getService, updateBaselines }) { after(async () => { await PageObjects.maps.existFullScreen(); + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.home.removeSampleDataSet('logs'); diff --git a/x-pack/test/functional/apps/maps/visualize_create_menu.js b/x-pack/test/functional/apps/maps/visualize_create_menu.js index ed0c153b9f99d..333377dde7003 100644 --- a/x-pack/test/functional/apps/maps/visualize_create_menu.js +++ b/x-pack/test/functional/apps/maps/visualize_create_menu.js @@ -14,6 +14,10 @@ export default function({ getPageObjects }) { await PageObjects.visualize.navigateToNewVisualization(); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + it('should show maps application in create menu', async () => { const hasMapsApp = await PageObjects.visualize.hasMapsApp(); expect(hasMapsApp).to.equal(true); diff --git a/x-pack/test/functional/page_objects/gis_page.js b/x-pack/test/functional/page_objects/gis_page.js index 700575220297e..a224e4feac075 100644 --- a/x-pack/test/functional/page_objects/gis_page.js +++ b/x-pack/test/functional/page_objects/gis_page.js @@ -16,6 +16,7 @@ export function GisPageProvider({ getService, getPageObjects }) { const find = getService('find'); const queryBar = getService('queryBar'); const comboBox = getService('comboBox'); + const browser = getService('browser'); function escapeLayerName(layerName) { return layerName.split(' ').join('_'); @@ -102,11 +103,11 @@ export function GisPageProvider({ getService, getPageObjects }) { // use the search filter box to narrow the results down to a single // entry, or at least to a single page of results - async loadSavedMap(name) { + async loadSavedMap(name, options = { isOnUnsavedMap: false }) { log.debug(`Load Saved Map ${name}`); await retry.try(async () => { - await this.searchForMapWithName(name); + await this.searchForMapWithName(name, options); await this.selectMap(name); await PageObjects.header.waitUntilLoadingHasFinished(); @@ -128,10 +129,10 @@ export function GisPageProvider({ getService, getPageObjects }) { await PageObjects.header.waitUntilLoadingHasFinished(); } - async openNewMap() { + async openNewMap(options = { isOnUnsavedMap: false }) { log.debug(`Open new Map`); - await this.gotoMapListingPage(); + await this.gotoMapListingPage(options); await testSubjects.click('newMapLink'); } @@ -163,10 +164,10 @@ export function GisPageProvider({ getService, getPageObjects }) { return exists; } - async searchForMapWithName(name) { + async searchForMapWithName(name, options = { isOnUnsavedMap: false }) { log.debug(`searchForMapWithName: ${name}`); - await this.gotoMapListingPage(); + await this.gotoMapListingPage(options); await retry.try(async () => { const searchFilter = await testSubjects.find('searchFilter'); @@ -192,20 +193,26 @@ export function GisPageProvider({ getService, getPageObjects }) { return hits; } - async gotoMapListingPage() { + async gotoMapListingPage(options = { isOnUnsavedMap: false }) { log.debug('gotoMapListingPage'); const onPage = await this.onMapListingPage(); if (!onPage) { await retry.try(async () => { - await PageObjects.common.navigateToUrl('maps', '/', { basePath: this.basePath }); + if (options.isOnUnsavedMap === true) { + await testSubjects.click('~breadcrumb & ~first'); + const alert = await browser.getAlert(); + await alert.accept(); + } else { + await PageObjects.common.navigateToUrl('maps', '/', { basePath: this.basePath }); + } const onMapListingPage = await this.onMapListingPage(); if (!onMapListingPage) throw new Error('Not on map listing page.'); }); } } - async getMapCountWithName(name) { - await this.gotoMapListingPage(); + async getMapCountWithName(name, options = { isOnUnsavedMap: false }) { + await this.gotoMapListingPage(options); log.debug(`getMapCountWithName: ${name}`); await this.searchForMapWithName(name); From 31f43fd6788546cf76534e3eea2390e882be2283 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Sat, 4 Apr 2020 22:25:02 +0300 Subject: [PATCH 03/10] update maps tests --- .../functional/apps/maps/documents_source/search_hits.js | 6 +++++- x-pack/test/functional/apps/maps/vector_styling.js | 4 ++++ x-pack/test/functional/apps/maps/visualize_create_menu.js | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/x-pack/test/functional/apps/maps/documents_source/search_hits.js b/x-pack/test/functional/apps/maps/documents_source/search_hits.js index 6c9280c59988d..9b5dad017fb30 100644 --- a/x-pack/test/functional/apps/maps/documents_source/search_hits.js +++ b/x-pack/test/functional/apps/maps/documents_source/search_hits.js @@ -16,7 +16,7 @@ export default function({ getPageObjects, getService }) { }); after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + await PageObjects.maps.gotoMapListingPage(); }); async function getRequestTimestamp() { @@ -89,6 +89,10 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.setLayerQuery('logstash', 'machine.os.raw : "ios"'); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + it('should apply layer query to search request', async () => { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/apps/maps/vector_styling.js b/x-pack/test/functional/apps/maps/vector_styling.js index 78898f1d1a4d0..2e3b55bd572e3 100644 --- a/x-pack/test/functional/apps/maps/vector_styling.js +++ b/x-pack/test/functional/apps/maps/vector_styling.js @@ -14,6 +14,10 @@ export default function({ getPageObjects }) { await PageObjects.maps.loadSavedMap('document example'); }); + after(async () => { + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + }); + describe('categorical styling', () => { before(async () => { await PageObjects.maps.openLayerPanel('logstash'); diff --git a/x-pack/test/functional/apps/maps/visualize_create_menu.js b/x-pack/test/functional/apps/maps/visualize_create_menu.js index 333377dde7003..1a4f174ee60b8 100644 --- a/x-pack/test/functional/apps/maps/visualize_create_menu.js +++ b/x-pack/test/functional/apps/maps/visualize_create_menu.js @@ -15,7 +15,7 @@ export default function({ getPageObjects }) { }); after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); + await PageObjects.maps.gotoMapListingPage(); }); it('should show maps application in create menu', async () => { From faf71ff25f16b9ed6e1ce96141f22b7cc1c3ecb8 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Sat, 4 Apr 2020 23:09:58 +0300 Subject: [PATCH 04/10] update common_page --- test/functional/page_objects/common_page.ts | 37 ++----------------- .../core_plugins/application_leave_confirm.ts | 2 - 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index fc7860eecc830..861dc187d5b9f 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -47,37 +47,6 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo } class CommonPage { - /** - * Navigates the browser window to provided URL - * @param url URL - * @param shouldAcceptAlert pass 'true' if browser alert should be accepted - */ - private static async navigateToUrlAndHandleAlert(url: string, shouldAcceptAlert: boolean) { - log.debug('Navigate to: ' + url); - try { - await browser.get(url); - } catch (navigationError) { - log.debug('Error navigating to url'); - const alert = await browser.getAlert(); - if (alert && alert.accept) { - if (shouldAcceptAlert) { - log.debug('Should accept alert'); - try { - await alert.accept(); - } catch (alertException) { - log.debug('Error accepting alert'); - throw alertException; - } - } else { - log.debug('Will not accept alert'); - throw navigationError; - } - } else { - throw navigationError; - } - } - } - /** * Returns Kibana host URL */ @@ -136,7 +105,8 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo } else { log.debug(`navigateToUrl ${appUrl}`); await browser.get(appUrl); - // await CommonPage.navigateToUrlAndHandleAlert(appUrl, shouldAcceptAlert); + const alert = await browser.getAlert(); + await alert?.accept(); } const currentUrl = shouldLoginIfPrompted @@ -261,7 +231,8 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo // since we're using hash URLs, always reload first to force re-render log.debug('navigate to: ' + appUrl); await browser.get(appUrl); - // await CommonPage.navigateToUrlAndHandleAlert(appUrl, shouldAcceptAlert); + const alert = await browser.getAlert(); + await alert?.accept(); await this.sleep(700); log.debug('returned from get, calling refresh'); await browser.refresh(); diff --git a/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts b/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts index 7dfc7d53fbfae..f892e52754c57 100644 --- a/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts +++ b/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts @@ -47,8 +47,6 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider expect(await browser.getCurrentUrl()).to.eql(getKibanaUrl('/app/appleave1')); }); it('allows navigation if user click confirm on the confirmation dialog', async () => { - const alert = await browser.getAlert(); - await alert?.accept(); await PageObjects.common.navigateToApp('appleave1'); await appsMenu.clickLink('AppLeave 2'); From 37e4df8bf13d4d44f5f11525f9fb0822cec0dfef Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Sat, 4 Apr 2020 23:21:43 +0300 Subject: [PATCH 05/10] Revert "update maps tests" This reverts commit 31f43fd6788546cf76534e3eea2390e882be2283. --- .../functional/apps/maps/documents_source/search_hits.js | 6 +----- x-pack/test/functional/apps/maps/vector_styling.js | 4 ---- x-pack/test/functional/apps/maps/visualize_create_menu.js | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/x-pack/test/functional/apps/maps/documents_source/search_hits.js b/x-pack/test/functional/apps/maps/documents_source/search_hits.js index 9b5dad017fb30..6c9280c59988d 100644 --- a/x-pack/test/functional/apps/maps/documents_source/search_hits.js +++ b/x-pack/test/functional/apps/maps/documents_source/search_hits.js @@ -16,7 +16,7 @@ export default function({ getPageObjects, getService }) { }); after(async () => { - await PageObjects.maps.gotoMapListingPage(); + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); }); async function getRequestTimestamp() { @@ -89,10 +89,6 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.setLayerQuery('logstash', 'machine.os.raw : "ios"'); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - it('should apply layer query to search request', async () => { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/apps/maps/vector_styling.js b/x-pack/test/functional/apps/maps/vector_styling.js index 2e3b55bd572e3..78898f1d1a4d0 100644 --- a/x-pack/test/functional/apps/maps/vector_styling.js +++ b/x-pack/test/functional/apps/maps/vector_styling.js @@ -14,10 +14,6 @@ export default function({ getPageObjects }) { await PageObjects.maps.loadSavedMap('document example'); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - describe('categorical styling', () => { before(async () => { await PageObjects.maps.openLayerPanel('logstash'); diff --git a/x-pack/test/functional/apps/maps/visualize_create_menu.js b/x-pack/test/functional/apps/maps/visualize_create_menu.js index 1a4f174ee60b8..333377dde7003 100644 --- a/x-pack/test/functional/apps/maps/visualize_create_menu.js +++ b/x-pack/test/functional/apps/maps/visualize_create_menu.js @@ -15,7 +15,7 @@ export default function({ getPageObjects }) { }); after(async () => { - await PageObjects.maps.gotoMapListingPage(); + await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); }); it('should show maps application in create menu', async () => { From d147206fe696434bfedf3620d49bf64a112108b6 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Sun, 5 Apr 2020 12:36:13 +0300 Subject: [PATCH 06/10] revert changes to maps tests --- test/functional/page_objects/common_page.ts | 2 ++ .../functional/apps/maps/add_layer_panel.js | 4 --- x-pack/test/functional/apps/maps/discover.js | 4 --- .../apps/maps/documents_source/search_hits.js | 4 --- .../apps/maps/es_geo_grid_source.js | 12 --------- .../import_geojson/add_layer_import_panel.js | 4 --- .../import_geojson/file_indexing_panel.js | 4 --- x-pack/test/functional/apps/maps/joins.js | 5 ---- .../test/functional/apps/maps/layer_errors.js | 4 --- .../test/functional/apps/maps/sample_data.js | 3 --- .../apps/maps/visualize_create_menu.js | 4 --- .../test/functional/page_objects/gis_page.js | 27 +++++++------------ 12 files changed, 12 insertions(+), 65 deletions(-) diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index 861dc187d5b9f..f06baeb7a4167 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -105,6 +105,7 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo } else { log.debug(`navigateToUrl ${appUrl}`); await browser.get(appUrl); + // accept alert if it pops up const alert = await browser.getAlert(); await alert?.accept(); } @@ -231,6 +232,7 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo // since we're using hash URLs, always reload first to force re-render log.debug('navigate to: ' + appUrl); await browser.get(appUrl); + // accept alert if it pops up const alert = await browser.getAlert(); await alert?.accept(); await this.sleep(700); diff --git a/x-pack/test/functional/apps/maps/add_layer_panel.js b/x-pack/test/functional/apps/maps/add_layer_panel.js index ada7a17d3db74..c5834ab977610 100644 --- a/x-pack/test/functional/apps/maps/add_layer_panel.js +++ b/x-pack/test/functional/apps/maps/add_layer_panel.js @@ -20,10 +20,6 @@ export default function({ getService, getPageObjects }) { await PageObjects.maps.selectVectorLayer(LAYER_NAME); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage(); - }); - it('should show unsaved layer in layer TOC', async () => { const vectorLayerExists = await PageObjects.maps.doesLayerExist(LAYER_NAME); expect(vectorLayerExists).to.be(true); diff --git a/x-pack/test/functional/apps/maps/discover.js b/x-pack/test/functional/apps/maps/discover.js index 2b0f5f85a321a..ce33596476755 100644 --- a/x-pack/test/functional/apps/maps/discover.js +++ b/x-pack/test/functional/apps/maps/discover.js @@ -15,10 +15,6 @@ export default function({ getService, getPageObjects }) { await PageObjects.common.navigateToApp('discover'); }); - afterEach(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - it('should link geo_shape fields to Maps application', async () => { await PageObjects.discover.selectIndexPattern('geo_shapes*'); await PageObjects.discover.clickFieldListItem('geometry'); diff --git a/x-pack/test/functional/apps/maps/documents_source/search_hits.js b/x-pack/test/functional/apps/maps/documents_source/search_hits.js index 6c9280c59988d..44668b20603a4 100644 --- a/x-pack/test/functional/apps/maps/documents_source/search_hits.js +++ b/x-pack/test/functional/apps/maps/documents_source/search_hits.js @@ -15,10 +15,6 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('document example'); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - async function getRequestTimestamp() { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/apps/maps/es_geo_grid_source.js b/x-pack/test/functional/apps/maps/es_geo_grid_source.js index b232cf2749654..62acf13e4d860 100644 --- a/x-pack/test/functional/apps/maps/es_geo_grid_source.js +++ b/x-pack/test/functional/apps/maps/es_geo_grid_source.js @@ -90,10 +90,6 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('geo grid heatmap example'); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - const LAYER_ID = '3xlvm'; const HEATMAP_PROP_NAME = '__kbn_heatmap_weight__'; @@ -144,10 +140,6 @@ export default function({ getPageObjects, getService }) { await inspector.close(); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - it('should contain geotile_grid aggregation elasticsearch request', async () => { await inspector.open(); await inspector.openInspectorRequestsView(); @@ -227,10 +219,6 @@ export default function({ getPageObjects, getService }) { await inspector.close(); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - it('should contain geotile_grid aggregation elasticsearch request', async () => { await inspector.open(); await inspector.openInspectorRequestsView(); diff --git a/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js b/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js index ea233878a42c6..5bad43779fe57 100644 --- a/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js +++ b/x-pack/test/functional/apps/maps/import_geojson/add_layer_import_panel.js @@ -31,10 +31,6 @@ export default function({ getPageObjects }) { await PageObjects.maps.closeOrCancelLayer(); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage(); - }); - it('should add GeoJSON file to map', async () => { const layerLoadedInToc = await PageObjects.maps.doesLayerExist(IMPORT_FILE_PREVIEW_NAME); expect(layerLoadedInToc).to.be(true); diff --git a/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js b/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js index f5b342d539901..218f74678001c 100644 --- a/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js +++ b/x-pack/test/functional/apps/maps/import_geojson/file_indexing_panel.js @@ -49,10 +49,6 @@ export default function({ getService, getPageObjects }) { await PageObjects.maps.waitForLayerAddPanelClosed(); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - it('should not activate add layer button until indexing succeeds', async () => { await indexPoint(); diff --git a/x-pack/test/functional/apps/maps/joins.js b/x-pack/test/functional/apps/maps/joins.js index 7986a83f282d2..e40acb1d8b891 100644 --- a/x-pack/test/functional/apps/maps/joins.js +++ b/x-pack/test/functional/apps/maps/joins.js @@ -31,11 +31,6 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('join example'); }); - after(async () => { - await inspector.close(); - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - it('should re-fetch join with refresh timer', async () => { async function getRequestTimestamp() { await PageObjects.maps.openInspectorRequest('meta_for_geo_shapes*.shape_name'); diff --git a/x-pack/test/functional/apps/maps/layer_errors.js b/x-pack/test/functional/apps/maps/layer_errors.js index 58e77e7062fdb..ae58d38171fb7 100644 --- a/x-pack/test/functional/apps/maps/layer_errors.js +++ b/x-pack/test/functional/apps/maps/layer_errors.js @@ -14,10 +14,6 @@ export default function({ getPageObjects }) { await PageObjects.maps.loadSavedMap('layer with errors'); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - describe('ESSearchSource with missing index pattern id', () => { const MISSING_INDEX_ID = 'idThatDoesNotExitForESSearchSource'; const LAYER_NAME = MISSING_INDEX_ID; diff --git a/x-pack/test/functional/apps/maps/sample_data.js b/x-pack/test/functional/apps/maps/sample_data.js index 644f2be19fbcc..bc6f96167b3c4 100644 --- a/x-pack/test/functional/apps/maps/sample_data.js +++ b/x-pack/test/functional/apps/maps/sample_data.js @@ -45,7 +45,6 @@ export default function({ getPageObjects, getService, updateBaselines }) { after(async () => { await PageObjects.maps.existFullScreen(); - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.home.removeSampleDataSet('ecommerce'); @@ -73,7 +72,6 @@ export default function({ getPageObjects, getService, updateBaselines }) { after(async () => { await PageObjects.maps.existFullScreen(); - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.home.removeSampleDataSet('flights'); @@ -103,7 +101,6 @@ export default function({ getPageObjects, getService, updateBaselines }) { after(async () => { await PageObjects.maps.existFullScreen(); - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.home.removeSampleDataSet('logs'); diff --git a/x-pack/test/functional/apps/maps/visualize_create_menu.js b/x-pack/test/functional/apps/maps/visualize_create_menu.js index 333377dde7003..ed0c153b9f99d 100644 --- a/x-pack/test/functional/apps/maps/visualize_create_menu.js +++ b/x-pack/test/functional/apps/maps/visualize_create_menu.js @@ -14,10 +14,6 @@ export default function({ getPageObjects }) { await PageObjects.visualize.navigateToNewVisualization(); }); - after(async () => { - await PageObjects.maps.gotoMapListingPage({ isOnUnsavedMap: true }); - }); - it('should show maps application in create menu', async () => { const hasMapsApp = await PageObjects.visualize.hasMapsApp(); expect(hasMapsApp).to.equal(true); diff --git a/x-pack/test/functional/page_objects/gis_page.js b/x-pack/test/functional/page_objects/gis_page.js index a224e4feac075..700575220297e 100644 --- a/x-pack/test/functional/page_objects/gis_page.js +++ b/x-pack/test/functional/page_objects/gis_page.js @@ -16,7 +16,6 @@ export function GisPageProvider({ getService, getPageObjects }) { const find = getService('find'); const queryBar = getService('queryBar'); const comboBox = getService('comboBox'); - const browser = getService('browser'); function escapeLayerName(layerName) { return layerName.split(' ').join('_'); @@ -103,11 +102,11 @@ export function GisPageProvider({ getService, getPageObjects }) { // use the search filter box to narrow the results down to a single // entry, or at least to a single page of results - async loadSavedMap(name, options = { isOnUnsavedMap: false }) { + async loadSavedMap(name) { log.debug(`Load Saved Map ${name}`); await retry.try(async () => { - await this.searchForMapWithName(name, options); + await this.searchForMapWithName(name); await this.selectMap(name); await PageObjects.header.waitUntilLoadingHasFinished(); @@ -129,10 +128,10 @@ export function GisPageProvider({ getService, getPageObjects }) { await PageObjects.header.waitUntilLoadingHasFinished(); } - async openNewMap(options = { isOnUnsavedMap: false }) { + async openNewMap() { log.debug(`Open new Map`); - await this.gotoMapListingPage(options); + await this.gotoMapListingPage(); await testSubjects.click('newMapLink'); } @@ -164,10 +163,10 @@ export function GisPageProvider({ getService, getPageObjects }) { return exists; } - async searchForMapWithName(name, options = { isOnUnsavedMap: false }) { + async searchForMapWithName(name) { log.debug(`searchForMapWithName: ${name}`); - await this.gotoMapListingPage(options); + await this.gotoMapListingPage(); await retry.try(async () => { const searchFilter = await testSubjects.find('searchFilter'); @@ -193,26 +192,20 @@ export function GisPageProvider({ getService, getPageObjects }) { return hits; } - async gotoMapListingPage(options = { isOnUnsavedMap: false }) { + async gotoMapListingPage() { log.debug('gotoMapListingPage'); const onPage = await this.onMapListingPage(); if (!onPage) { await retry.try(async () => { - if (options.isOnUnsavedMap === true) { - await testSubjects.click('~breadcrumb & ~first'); - const alert = await browser.getAlert(); - await alert.accept(); - } else { - await PageObjects.common.navigateToUrl('maps', '/', { basePath: this.basePath }); - } + await PageObjects.common.navigateToUrl('maps', '/', { basePath: this.basePath }); const onMapListingPage = await this.onMapListingPage(); if (!onMapListingPage) throw new Error('Not on map listing page.'); }); } } - async getMapCountWithName(name, options = { isOnUnsavedMap: false }) { - await this.gotoMapListingPage(options); + async getMapCountWithName(name) { + await this.gotoMapListingPage(); log.debug(`getMapCountWithName: ${name}`); await this.searchForMapWithName(name); From f4cedb959a2263deb557da4f9feff6255629da7c Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Sun, 5 Apr 2020 12:39:07 +0300 Subject: [PATCH 07/10] undo after removal --- x-pack/test/functional/apps/maps/joins.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x-pack/test/functional/apps/maps/joins.js b/x-pack/test/functional/apps/maps/joins.js index e40acb1d8b891..89a6c6ea82e53 100644 --- a/x-pack/test/functional/apps/maps/joins.js +++ b/x-pack/test/functional/apps/maps/joins.js @@ -31,6 +31,10 @@ export default function({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('join example'); }); + after(async () => { + await inspector.close(); + }); + it('should re-fetch join with refresh timer', async () => { async function getRequestTimestamp() { await PageObjects.maps.openInspectorRequest('meta_for_geo_shapes*.shape_name'); From 0d79c58df2946c58f115aae2abb6a28a9fc1294a Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Tue, 7 Apr 2020 12:41:06 +0300 Subject: [PATCH 08/10] update expect range to pass on Windows, unskip tests for Firefox --- test/functional/apps/discover/_discover.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index 850b2773b5025..8226caac4c76c 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -44,7 +44,6 @@ export default function({ getService, getPageObjects }) { }); describe('query', function() { - this.tags(['skipFirefox']); const queryName1 = 'Query # 1'; it('should show correct time range string by timepicker', async function() { @@ -101,8 +100,8 @@ export default function({ getService, getPageObjects }) { expect(Math.round(newDurationHours)).to.be(25); const rowData = await PageObjects.discover.getDocTableField(1); expect(Date.parse(rowData)).to.be.within( - Date.parse('Sep 20, 2015 @ 22:00:00.000'), - Date.parse('Sep 20, 2015 @ 23:30:00.000') + Date.parse('Sep 20, 2015 @ 21:30:00.000'), + Date.parse('Sep 20, 2015 @ 23:00:00.000') ); }); From cac618d931ca9585bb77809e319b751e5d2a9b1a Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Tue, 7 Apr 2020 12:41:51 +0300 Subject: [PATCH 09/10] print out value for discover brushing test --- test/functional/apps/discover/_discover.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index 8226caac4c76c..889926ca5cd22 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -99,6 +99,7 @@ export default function({ getService, getPageObjects }) { const newDurationHours = await PageObjects.timePicker.getTimeDurationInHours(); expect(Math.round(newDurationHours)).to.be(25); const rowData = await PageObjects.discover.getDocTableField(1); + console.log(rowData); expect(Date.parse(rowData)).to.be.within( Date.parse('Sep 20, 2015 @ 21:30:00.000'), Date.parse('Sep 20, 2015 @ 23:00:00.000') From b18bf6b7fd3d69132942e6409ce1828675d42db1 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Tue, 7 Apr 2020 14:26:27 +0300 Subject: [PATCH 10/10] log first timestamp --- test/functional/apps/discover/_discover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index 889926ca5cd22..4f357e2993b30 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -99,7 +99,7 @@ export default function({ getService, getPageObjects }) { const newDurationHours = await PageObjects.timePicker.getTimeDurationInHours(); expect(Math.round(newDurationHours)).to.be(25); const rowData = await PageObjects.discover.getDocTableField(1); - console.log(rowData); + log.debug(`The first timestamp value in doc table: ${rowData}`); expect(Date.parse(rowData)).to.be.within( Date.parse('Sep 20, 2015 @ 21:30:00.000'), Date.parse('Sep 20, 2015 @ 23:00:00.000')