From c8528c345a282e2f65f5b7a62e0f536d06f2dee8 Mon Sep 17 00:00:00 2001 From: Colm O'Shea Date: Wed, 26 Apr 2017 11:54:04 +0100 Subject: [PATCH 1/4] Rebuild modulePath correctly if on Windows --- tasks/build/notice.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/build/notice.js b/tasks/build/notice.js index 8523462bc82dc..b74989ead4f01 100644 --- a/tasks/build/notice.js +++ b/tasks/build/notice.js @@ -16,8 +16,17 @@ export default function licenses(grunt) { cwd: buildPath }); installedPackages.toString().trim().split('\n').forEach(pkg => { + let modulePath; + let dirPath; + let packageName; + let drive; const packageDetails = pkg.split(':'); - const [modulePath, packageName] = packageDetails; + if (/^win/.test(process.platform)) { + [drive, dirPath, packageName] = packageDetails; + modulePath = `${drive}:${dirPath}`; + } else { + [modulePath, packageName] = packageDetails; + } const licenses = glob.sync(path.join(modulePath, '*LICENSE*')); const notices = glob.sync(path.join(modulePath, '*NOTICE*')); packagePaths[packageName] = { From ea976aea0afa3c194188853679a54d94230c6ff8 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Wed, 22 Aug 2018 18:04:49 -0500 Subject: [PATCH 2/4] Change how we find dashboard add panel is loaded --- test/functional/services/dashboard/add_panel.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/functional/services/dashboard/add_panel.js b/test/functional/services/dashboard/add_panel.js index 4d11f805edf2a..298228bab854d 100644 --- a/test/functional/services/dashboard/add_panel.js +++ b/test/functional/services/dashboard/add_panel.js @@ -24,6 +24,7 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { const testSubjects = getService('testSubjects'); const flyout = getService('flyout'); const PageObjects = getPageObjects(['header', 'common']); + const remote = getService('remote'); return new class DashboardAddPanel { async clickOpenAddPanel() { @@ -94,8 +95,19 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { } async waitForEuiTableLoading() { - const addPanel = await testSubjects.find('dashboardAddPanel'); - await addPanel.waitForDeletedByClassName('euiBasicTable-loading'); + // Lee.Dr: existing code - waited 10 second timeout to try to find 'euiBasicTable-loading' + // const addPanel = await testSubjects.find('dashboardAddPanel'); + // await addPanel.waitForDeletedByClassName('euiBasicTable-loading'); + + // Option 1: waitForDeleted with a 1 second timeout + // await remote.setFindTimeout(1000).waitForDeletedByClassName('euiBasicTable-loading'); + + // Option 2: find the table and wait for it to not have the 'euiBasicTable-loading' class + // This should be the fastest. + await retry.waitFor('dashboard add panel loading to complete', async () => { + const table = await remote.findByClassName('euiBasicTable'); + return !((await table.getAttribute('class')).includes('loading')); + }); } async closeAddPanel() { From d5475d97efafa6c7435d145e5d73c9ba8212f7c1 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Thu, 23 Aug 2018 08:42:24 -0500 Subject: [PATCH 3/4] Add and use find.byClassName instead of remote --- test/functional/services/dashboard/add_panel.js | 6 +++--- test/functional/services/find.js | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/functional/services/dashboard/add_panel.js b/test/functional/services/dashboard/add_panel.js index 298228bab854d..0a0a452003144 100644 --- a/test/functional/services/dashboard/add_panel.js +++ b/test/functional/services/dashboard/add_panel.js @@ -24,7 +24,7 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { const testSubjects = getService('testSubjects'); const flyout = getService('flyout'); const PageObjects = getPageObjects(['header', 'common']); - const remote = getService('remote'); + const find = getService('find'); return new class DashboardAddPanel { async clickOpenAddPanel() { @@ -105,7 +105,7 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { // Option 2: find the table and wait for it to not have the 'euiBasicTable-loading' class // This should be the fastest. await retry.waitFor('dashboard add panel loading to complete', async () => { - const table = await remote.findByClassName('euiBasicTable'); + const table = await find.byClassName('euiBasicTable'); return !((await table.getAttribute('class')).includes('loading')); }); } @@ -182,7 +182,7 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { log.debug(`DashboardAddPanel.addVisualization(${vizName})`); await this.ensureAddPanelIsShowing(); // workaround for timing issue with slideout animation - await PageObjects.common.sleep(500); + // await PageObjects.common.sleep(500); await this.filterEmbeddableNames(`"${vizName.replace('-', ' ')}"`); await testSubjects.click(`addPanel${vizName.split(' ').join('-')}`); await this.closeAddPanel(); diff --git a/test/functional/services/find.js b/test/functional/services/find.js index f6d008cc38480..59029fc61b3aa 100644 --- a/test/functional/services/find.js +++ b/test/functional/services/find.js @@ -72,6 +72,13 @@ export function FindProvider({ getService }) { }); } + async byClassName(selector, timeout = defaultFindTimeout) { + log.debug(`findByCssSelector ${selector}`); + return await this._ensureElementWithTimeout(timeout, async remote => { + return await remote.findByClassName(selector); + }); + } + async setValue(selector, text) { return await retry.try(async () => { const element = await this.byCssSelector(selector); From c304a9aafe71abc49312b8def5474aae10b53fcc Mon Sep 17 00:00:00 2001 From: LeeDr Date: Thu, 23 Aug 2018 15:45:09 -0500 Subject: [PATCH 4/4] cleanup a comment --- test/functional/services/dashboard/add_panel.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/functional/services/dashboard/add_panel.js b/test/functional/services/dashboard/add_panel.js index 0a0a452003144..d6d3ad6dd282f 100644 --- a/test/functional/services/dashboard/add_panel.js +++ b/test/functional/services/dashboard/add_panel.js @@ -95,15 +95,6 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { } async waitForEuiTableLoading() { - // Lee.Dr: existing code - waited 10 second timeout to try to find 'euiBasicTable-loading' - // const addPanel = await testSubjects.find('dashboardAddPanel'); - // await addPanel.waitForDeletedByClassName('euiBasicTable-loading'); - - // Option 1: waitForDeleted with a 1 second timeout - // await remote.setFindTimeout(1000).waitForDeletedByClassName('euiBasicTable-loading'); - - // Option 2: find the table and wait for it to not have the 'euiBasicTable-loading' class - // This should be the fastest. await retry.waitFor('dashboard add panel loading to complete', async () => { const table = await find.byClassName('euiBasicTable'); return !((await table.getAttribute('class')).includes('loading')); @@ -181,8 +172,6 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) { async addVisualization(vizName) { log.debug(`DashboardAddPanel.addVisualization(${vizName})`); await this.ensureAddPanelIsShowing(); - // workaround for timing issue with slideout animation - // await PageObjects.common.sleep(500); await this.filterEmbeddableNames(`"${vizName.replace('-', ' ')}"`); await testSubjects.click(`addPanel${vizName.split(' ').join('-')}`); await this.closeAddPanel();