From df1ea743c10dbb7731ab02fd3f5d58887d750d1c Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Tue, 1 Oct 2019 18:10:40 +0200 Subject: [PATCH 1/9] re-enable graph tests --- .../components/field_manager/field_picker.tsx | 2 + .../graph/public/components/search_bar.tsx | 7 +- x-pack/test/functional/apps/graph/graph.ts | 71 +++++++++---------- .../functional/page_objects/graph_page.ts | 44 ++++++------ 4 files changed, 64 insertions(+), 60 deletions(-) diff --git a/x-pack/legacy/plugins/graph/public/components/field_manager/field_picker.tsx b/x-pack/legacy/plugins/graph/public/components/field_manager/field_picker.tsx index b1ddce4fa1744..d701c6d4c1a71 100644 --- a/x-pack/legacy/plugins/graph/public/components/field_manager/field_picker.tsx +++ b/x-pack/legacy/plugins/graph/public/components/field_manager/field_picker.tsx @@ -54,6 +54,7 @@ export function FieldPicker({ fieldMap, selectField, deselectField }: FieldPicke panelPaddingSize="none" button={ - + {i18n.translate('xpack.graph.bar.exploreLabel', { defaultMessage: 'Explore' })} diff --git a/x-pack/test/functional/apps/graph/graph.ts b/x-pack/test/functional/apps/graph/graph.ts index 97bb7c1b9918b..6d19783bc799e 100644 --- a/x-pack/test/functional/apps/graph/graph.ts +++ b/x-pack/test/functional/apps/graph/graph.ts @@ -13,8 +13,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const browser = getService('browser'); - // FLAKY: https://github.com/elastic/kibana/issues/45317 - describe.skip('graph', function() { + describe('graph', function() { before(async () => { await browser.setWindowSize(1600, 1000); log.debug('load graph/secrepo data'); @@ -47,55 +46,49 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { '/blog/wp-admin/', ]; - const expectedConnectionWidth: Record> = { - '/blog/wp-admin/': { wp: 2, blog: 5.51581 }, + const expectedConnections: Record> = { + '/blog/wp-admin/': { wp: true, blog: true }, wp: { - blog: 2, - '202.136.75.194': 2, - 'login.php': 2, - admin: 2, - '/test/wp-admin/': 2, - '/wp-login.php': 2, - '80.5.27.16': 2, - '/wordpress/wp-admin/': 2, - '190.154.27.54': 2, - '187.131.21.37': 2, - '181.113.155.46': 2, + blog: true, + '202.136.75.194': true, + 'login.php': true, + admin: true, + '/test/wp-admin/': true, + '/wp-login.php': true, + '80.5.27.16': true, + '/wordpress/wp-admin/': true, + '190.154.27.54': true, + '187.131.21.37': true, + '181.113.155.46': true, }, - admin: { test: 2, blog: 2, '/blog/wp-admin/': 2 }, - '/test/wp-admin/': { admin: 2 }, - test: { wp: 2, '/test/wp-admin/': 8.54514 }, - wordpress: { wp: 2, admin: 2.0311 }, - '/wordpress/wp-admin/': { wordpress: 9.70794, admin: 2.30771 }, + admin: { test: true, blog: true, '/blog/wp-admin/': true }, + '/test/wp-admin/': { admin: true }, + test: { wp: true, '/test/wp-admin/': true }, + wordpress: { wp: true, admin: true }, + '/wordpress/wp-admin/': { wordpress: true, admin: true }, }; async function buildGraph() { - log.debug('select index pattern secrepo*'); - await PageObjects.graph.selectIndexPattern('secrepo*'); - // wait for the saved object to be loaded - // TODO this race condition will be removed with eui-ification - // of graph bar - await PageObjects.common.sleep(1000); // select fields url.parts, url, params and src - await PageObjects.graph.addField('url.parts'); - await PageObjects.graph.addField('url'); - await PageObjects.graph.addField('params'); - await PageObjects.graph.addField('src'); + await PageObjects.graph.addFields(['url.parts', 'url', 'params', 'src']); await PageObjects.graph.query('admin'); await PageObjects.common.sleep(8000); } it('should show correct node labels', async function() { + await PageObjects.graph.selectIndexPattern('secrepo*'); + await PageObjects.common.sleep(1000); await buildGraph(); const { nodes } = await PageObjects.graph.getGraphObjects(); const circlesText = nodes.map(({ label }) => label); expect(circlesText.length).to.equal(expectedNodes.length); - expect(circlesText).to.eql(expectedNodes); + circlesText.forEach(circleText => { + expect(expectedNodes.includes(circleText)).to.be(true); + }); }); it('should show correct connections', async function() { - const epsilon = Number.EPSILON; - const expectedConnectionCount = Object.values(expectedConnectionWidth) + const expectedConnectionCount = Object.values(expectedConnections) .map(connections => Object.values(connections).length) .reduce((acc, n) => acc + n, 0); const { edges } = await PageObjects.graph.getGraphObjects(); @@ -103,11 +96,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { edges.forEach(edge => { const from = edge.sourceNode.label!; const to = edge.targetNode.label!; - // fuzzy matching to take floating point rounding issues into account - expect(expectedConnectionWidth[from][to]).to.be.within( - edge.width - epsilon, - edge.width + epsilon - ); + expect(expectedConnections[from][to]).to.be(true); }); }); @@ -122,11 +111,15 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { const { nodes } = await PageObjects.graph.getGraphObjects(); const circlesText = nodes.map(({ label }) => label); expect(circlesText.length).to.equal(expectedNodes.length); - expect(circlesText).to.eql(expectedNodes); + circlesText.forEach(circleText => { + expect(expectedNodes.includes(circleText)).to.be(true); + }); }); it('should create new Graph workspace', async function() { await PageObjects.graph.newGraph(); + await PageObjects.graph.selectIndexPattern('secrepo*'); + await PageObjects.common.sleep(1000); const { nodes, edges } = await PageObjects.graph.getGraphObjects(); expect(nodes).to.be.empty(); expect(edges).to.be.empty(); diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index dd5f28e221eb1..189d90c263676 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -28,35 +28,31 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon class GraphPage { async selectIndexPattern(pattern: string) { - await find.clickDisplayedByCssSelector('.gphIndexSelect'); - await find.clickByCssSelector('.gphIndexSelect > option[label="' + pattern + '"]'); + await testSubjects.click(`savedObjectTitle${pattern.split(' ').join('-')}`); } async clickAddField() { - await retry.try(async () => { - await find.clickByCssSelector('#addVertexFieldButton'); - // make sure the fieldSelectionList is not hidden - await testSubjects.exists('fieldSelectionList'); - }); + await testSubjects.click('graph-add-field-button'); } async selectField(field: string) { - await find.clickDisplayedByCssSelector( - 'select[id="fieldList"] > option[label="' + field + '"]' - ); - await find.clickDisplayedByCssSelector('button[ng-click="addFieldToSelection()"]'); + await testSubjects.setValue('graph-field-search', field); + await find.clickDisplayedByCssSelector(`[title="${field}"]`); } - async addField(field: string) { + async addFields(fields: string[]) { log.debug('click Add Field icon'); await this.clickAddField(); - log.debug('select field ' + field); - await this.selectField(field); + for (const field of fields) { + log.debug('select field ' + field); + await this.selectField(field); + } } async query(str: string) { - await find.setValue('input.kuiLocalSearchInput', str); - await find.clickDisplayedByCssSelector('button.kuiLocalSearchButton'); + await testSubjects.click('queryInput'); + await testSubjects.setValue('queryInput', str); + await testSubjects.click('graph-explore-button'); } private getPositionAsString(x: string, y: string) { @@ -180,13 +176,19 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon async newGraph() { log.debug('Click New Workspace'); - await testSubjects.click('graphNewButton'); + await retry.try(async () => { + await testSubjects.click('graphNewButton'); + await testSubjects.existOrFail('confirmModal', { timeout: 3000 }); + }); await PageObjects.common.sleep(1000); await PageObjects.common.clickConfirmOnModal(); } async saveGraph(name: string) { - await testSubjects.click('graphSaveButton'); + await retry.try(async () => { + await testSubjects.click('graphSaveButton'); + await testSubjects.existOrFail('savedObjectTitle', { timeout: 3000 }); + }); await testSubjects.setValue('savedObjectTitle', name); await testSubjects.click('confirmSaveSavedObjectButton'); @@ -213,7 +215,10 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon } async goToListingPage() { - await testSubjects.click('graphHomeBreadcrumb'); + await retry.try(async () => { + await testSubjects.click('breadcrumb graphHomeBreadcrumb first'); + await testSubjects.existOrFail('workspaceLandingPage', { timeout: 3000 }); + }); } async openGraph(name: string) { @@ -224,7 +229,6 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon } async deleteGraph(name: string) { - await this.goToListingPage(); await this.searchForWorkspaceWithName(name); await testSubjects.click('checkboxSelectAll'); await this.clickDeleteSelectedWorkspaces(); From 391959a37a843be7c6719f7980600fe33833ed01 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Wed, 2 Oct 2019 14:44:11 +0200 Subject: [PATCH 2/9] stabilize new graph navigation --- x-pack/test/functional/page_objects/graph_page.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index 189d90c263676..8cfd25a909e94 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -180,8 +180,9 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon await testSubjects.click('graphNewButton'); await testSubjects.existOrFail('confirmModal', { timeout: 3000 }); }); - await PageObjects.common.sleep(1000); await PageObjects.common.clickConfirmOnModal(); + // wait for route change to complete + await PageObjects.common.sleep(3000); } async saveGraph(name: string) { From 9a9cacdc3a4a38562143606aab40e4b6d3f789ca Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Wed, 2 Oct 2019 16:02:40 +0200 Subject: [PATCH 3/9] fix functional tests for new html structure --- x-pack/test/functional/page_objects/graph_page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index 8cfd25a909e94..46630eb539e29 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -121,7 +121,7 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon async getGraphObjects() { await this.stopLayout(); const graphElements = await find.allByCssSelector( - '#svgRootGroup line, #svgRootGroup circle, text.gphNode__label' + '#graphSvg line, #graphSvg circle, #graphSvg text.gphNode__label' ); const nodes: Node[] = []; const nodePositionMap: Record = {}; From be3646b6732dcc35786847ab706ab7cce6a94dd6 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 3 Oct 2019 10:21:38 +0200 Subject: [PATCH 4/9] fix style parser --- x-pack/test/functional/page_objects/graph_page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index 46630eb539e29..16f6ca0b3e3fa 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -150,7 +150,7 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon const [sourcePosition, targetPosition] = await this.getLinePositions(element); const lineStyle = await element.getAttribute('style'); // grep out the width of the connection from the style attribute - const strokeWidth = Number(/stroke-width: (\d+(\.\d+)?)px/.exec(lineStyle)![1]); + const strokeWidth = Number(/stroke-width: ?(\d+(\.\d+)?)/.exec(lineStyle)![1]); edges.push({ element, width: strokeWidth, From 6a3df146aee69bd13fba84a8e05116e7ff2c1ff6 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Fri, 4 Oct 2019 11:44:36 +0200 Subject: [PATCH 5/9] fix functional tests due to UI changes --- x-pack/test/functional/page_objects/graph_page.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index 16f6ca0b3e3fa..11a3d65686b7e 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -28,6 +28,7 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon class GraphPage { async selectIndexPattern(pattern: string) { + await testSubjects.click('graphDatasourceButton'); await testSubjects.click(`savedObjectTitle${pattern.split(' ').join('-')}`); } From f130165708c58f5d07092f632ba15bea2b3a0f7f Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Fri, 4 Oct 2019 16:39:25 +0200 Subject: [PATCH 6/9] wait for guidance panel instead of sleeping --- x-pack/legacy/plugins/graph/public/app.js | 4 +--- .../graph/public/components/guidance_panel/guidance_panel.tsx | 2 +- x-pack/test/functional/page_objects/graph_page.ts | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/x-pack/legacy/plugins/graph/public/app.js b/x-pack/legacy/plugins/graph/public/app.js index 2cd3e13013d9a..5b01c88fad51c 100644 --- a/x-pack/legacy/plugins/graph/public/app.js +++ b/x-pack/legacy/plugins/graph/public/app.js @@ -510,9 +510,7 @@ app.controller('graphuiPlugin', function ( }), run: function () { canWipeWorkspace(function () { - $scope.$evalAsync(() => { - kbnUrl.change('/workspace/', {}); - }); + kbnUrl.change('/workspace/', {}); }); }, testId: 'graphNewButton', }); diff --git a/x-pack/legacy/plugins/graph/public/components/guidance_panel/guidance_panel.tsx b/x-pack/legacy/plugins/graph/public/components/guidance_panel/guidance_panel.tsx index 840280a754154..f9b16d6a7a50d 100644 --- a/x-pack/legacy/plugins/graph/public/components/guidance_panel/guidance_panel.tsx +++ b/x-pack/legacy/plugins/graph/public/components/guidance_panel/guidance_panel.tsx @@ -79,7 +79,7 @@ function GuidancePanelComponent(props: GuidancePanelProps) { return ( - + diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index 11a3d65686b7e..2dfc1dfec4778 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -182,8 +182,7 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon await testSubjects.existOrFail('confirmModal', { timeout: 3000 }); }); await PageObjects.common.clickConfirmOnModal(); - // wait for route change to complete - await PageObjects.common.sleep(3000); + await testSubjects.existOrFail('graphGuidancePanel'); } async saveGraph(name: string) { From 4bfaa4ffa1169620fc54b9d54d09a799f6852135 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Tue, 8 Oct 2019 09:41:04 +0200 Subject: [PATCH 7/9] run x-pack-ciGroup1 20x times --- .ci/jobs.yml | 71 ++++++++++++++-------- test/scripts/jenkins_build_kibana.sh | 2 +- test/scripts/jenkins_ci_group.sh | 2 +- test/scripts/jenkins_xpack_build_kibana.sh | 22 +++---- test/scripts/jenkins_xpack_ci_group.sh | 22 +++---- 5 files changed, 69 insertions(+), 50 deletions(-) diff --git a/.ci/jobs.yml b/.ci/jobs.yml index fc3e80064fa6f..cbf9196193e25 100644 --- a/.ci/jobs.yml +++ b/.ci/jobs.yml @@ -1,33 +1,52 @@ JOB: - - kibana-intake - - x-pack-intake - - kibana-firefoxSmoke - - kibana-ciGroup1 - - kibana-ciGroup2 - - kibana-ciGroup3 - - kibana-ciGroup4 - - kibana-ciGroup5 - - kibana-ciGroup6 - - kibana-ciGroup7 - - kibana-ciGroup8 - - kibana-ciGroup9 - - kibana-ciGroup10 - - kibana-ciGroup11 - - kibana-ciGroup12 + # - kibana-intake + # - x-pack-intake + # - kibana-firefoxSmoke + # - kibana-ciGroup1 + # - kibana-ciGroup2 + # - kibana-ciGroup3 + # - kibana-ciGroup4 + # - kibana-ciGroup5 + # - kibana-ciGroup6 + # - kibana-ciGroup7 + # - kibana-ciGroup8 + # - kibana-ciGroup9 + # - kibana-ciGroup10 + # - kibana-ciGroup11 + # - kibana-ciGroup12 # - kibana-visualRegression # make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh - - x-pack-firefoxSmoke - - x-pack-ciGroup1 - - x-pack-ciGroup2 - - x-pack-ciGroup3 - - x-pack-ciGroup4 - - x-pack-ciGroup5 - - x-pack-ciGroup6 - - x-pack-ciGroup7 - - x-pack-ciGroup8 - - x-pack-ciGroup9 - - x-pack-ciGroup10 + # - x-pack-firefoxSmoke + - x-pack-ciGroup1-1 + - x-pack-ciGroup1-2 + - x-pack-ciGroup1-3 + - x-pack-ciGroup1-4 + - x-pack-ciGroup1-5 + - x-pack-ciGroup1-6 + - x-pack-ciGroup1-7 + - x-pack-ciGroup1-8 + - x-pack-ciGroup1-9 + - x-pack-ciGroup1-10 + - x-pack-ciGroup1-11 + - x-pack-ciGroup1-12 + - x-pack-ciGroup1-13 + - x-pack-ciGroup1-14 + - x-pack-ciGroup1-15 + - x-pack-ciGroup1-16 + - x-pack-ciGroup1-17 + - x-pack-ciGroup1-18 + - x-pack-ciGroup1-19 + - x-pack-ciGroup1-20 + # - x-pack-ciGroup2 + # - x-pack-ciGroup3 + # - x-pack-ciGroup4 + # - x-pack-ciGroup5 + # - x-pack-ciGroup6 + # - x-pack-ciGroup7 + # - x-pack-ciGroup8 + # - x-pack-ciGroup9 + # - x-pack-ciGroup10 # - x-pack-visualRegression # `~` is yaml for `null` diff --git a/test/scripts/jenkins_build_kibana.sh b/test/scripts/jenkins_build_kibana.sh index f79fe98e07bef..df0c1c9aad68a 100755 --- a/test/scripts/jenkins_build_kibana.sh +++ b/test/scripts/jenkins_build_kibana.sh @@ -6,7 +6,7 @@ echo " -> downloading es snapshot" node scripts/es snapshot --license=oss --download-only; echo " -> Ensuring all functional tests are in a ciGroup" -yarn run grunt functionalTests:ensureAllTestsInCiGroup; +#yarn run grunt functionalTests:ensureAllTestsInCiGroup; echo " -> building and extracting OSS Kibana distributable for use in functional tests" node scripts/build --debug --oss diff --git a/test/scripts/jenkins_ci_group.sh b/test/scripts/jenkins_ci_group.sh index 6807e318138ce..a1fb9eee4b0b2 100755 --- a/test/scripts/jenkins_ci_group.sh +++ b/test/scripts/jenkins_ci_group.sh @@ -11,7 +11,7 @@ fi export TEST_BROWSER_HEADLESS=1 if [[ -z "$IS_PIPELINE_JOB" ]] ; then - yarn run grunt functionalTests:ensureAllTestsInCiGroup; + #yarn run grunt functionalTests:ensureAllTestsInCiGroup; node scripts/build --debug --oss; else installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)" diff --git a/test/scripts/jenkins_xpack_build_kibana.sh b/test/scripts/jenkins_xpack_build_kibana.sh index 9f2bafc863f41..a75d11ed52309 100755 --- a/test/scripts/jenkins_xpack_build_kibana.sh +++ b/test/scripts/jenkins_xpack_build_kibana.sh @@ -8,17 +8,17 @@ node scripts/es snapshot --download-only; echo " -> Ensuring all functional tests are in a ciGroup" cd "$XPACK_DIR" -node scripts/functional_tests --assert-none-excluded \ - --include-tag ciGroup1 \ - --include-tag ciGroup2 \ - --include-tag ciGroup3 \ - --include-tag ciGroup4 \ - --include-tag ciGroup5 \ - --include-tag ciGroup6 \ - --include-tag ciGroup7 \ - --include-tag ciGroup8 \ - --include-tag ciGroup9 \ - --include-tag ciGroup10 +# node scripts/functional_tests --assert-none-excluded \ +# --include-tag ciGroup1 \ +# --include-tag ciGroup2 \ +# --include-tag ciGroup3 \ +# --include-tag ciGroup4 \ +# --include-tag ciGroup5 \ +# --include-tag ciGroup6 \ +# --include-tag ciGroup7 \ +# --include-tag ciGroup8 \ +# --include-tag ciGroup9 \ +# --include-tag ciGroup10 echo " -> building and extracting default Kibana distributable for use in functional tests" cd "$KIBANA_DIR" diff --git a/test/scripts/jenkins_xpack_ci_group.sh b/test/scripts/jenkins_xpack_ci_group.sh index d41f2ed9f1ae6..180e1d225365e 100755 --- a/test/scripts/jenkins_xpack_ci_group.sh +++ b/test/scripts/jenkins_xpack_ci_group.sh @@ -13,17 +13,17 @@ export TEST_BROWSER_HEADLESS=1 if [[ -z "$IS_PIPELINE_JOB" ]] ; then echo " -> Ensuring all functional tests are in a ciGroup" cd "$XPACK_DIR" - node scripts/functional_tests --assert-none-excluded \ - --include-tag ciGroup1 \ - --include-tag ciGroup2 \ - --include-tag ciGroup3 \ - --include-tag ciGroup4 \ - --include-tag ciGroup5 \ - --include-tag ciGroup6 \ - --include-tag ciGroup7 \ - --include-tag ciGroup8 \ - --include-tag ciGroup9 \ - --include-tag ciGroup10 + # node scripts/functional_tests --assert-none-excluded \ + # --include-tag ciGroup1 \ + # --include-tag ciGroup2 \ + # --include-tag ciGroup3 \ + # --include-tag ciGroup4 \ + # --include-tag ciGroup5 \ + # --include-tag ciGroup6 \ + # --include-tag ciGroup7 \ + # --include-tag ciGroup8 \ + # --include-tag ciGroup9 \ + # --include-tag ciGroup10 fi cd "$KIBANA_DIR" From cae13ee255bbbc776c63e459ffb7f18adb399ab1 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Tue, 8 Oct 2019 16:45:33 +0200 Subject: [PATCH 8/9] wait for dom changes instead of sleeping --- x-pack/test/functional/apps/graph/graph.ts | 2 -- x-pack/test/functional/page_objects/graph_page.ts | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/x-pack/test/functional/apps/graph/graph.ts b/x-pack/test/functional/apps/graph/graph.ts index 6d19783bc799e..cb6f0b6028a2d 100644 --- a/x-pack/test/functional/apps/graph/graph.ts +++ b/x-pack/test/functional/apps/graph/graph.ts @@ -77,7 +77,6 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { it('should show correct node labels', async function() { await PageObjects.graph.selectIndexPattern('secrepo*'); - await PageObjects.common.sleep(1000); await buildGraph(); const { nodes } = await PageObjects.graph.getGraphObjects(); const circlesText = nodes.map(({ label }) => label); @@ -119,7 +118,6 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { it('should create new Graph workspace', async function() { await PageObjects.graph.newGraph(); await PageObjects.graph.selectIndexPattern('secrepo*'); - await PageObjects.common.sleep(1000); const { nodes, edges } = await PageObjects.graph.getGraphObjects(); expect(nodes).to.be.empty(); expect(edges).to.be.empty(); diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index 2dfc1dfec4778..063827980e7cc 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -30,10 +30,19 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon async selectIndexPattern(pattern: string) { await testSubjects.click('graphDatasourceButton'); await testSubjects.click(`savedObjectTitle${pattern.split(' ').join('-')}`); + // wait till add fields button becomes available, then the index pattern is loaded completely + await testSubjects.waitForAttributeToChange( + 'graph-add-field-button', + 'aria-disabled', + 'false' + ); } async clickAddField() { - await testSubjects.click('graph-add-field-button'); + await retry.try(async () => { + await testSubjects.click('graph-add-field-button'); + await testSubjects.existOrFail('graph-field-search', { timeout: 3000 }); + }); } async selectField(field: string) { From fbada9cda6b779400e5ff8bd6d4e93573e4a85f1 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Wed, 9 Oct 2019 11:35:48 +0200 Subject: [PATCH 9/9] Revert "run x-pack-ciGroup1 20x times" This reverts commit 4bfaa4ffa1169620fc54b9d54d09a799f6852135. --- .ci/jobs.yml | 71 ++++++++-------------- test/scripts/jenkins_build_kibana.sh | 2 +- test/scripts/jenkins_ci_group.sh | 2 +- test/scripts/jenkins_xpack_build_kibana.sh | 22 +++---- test/scripts/jenkins_xpack_ci_group.sh | 22 +++---- 5 files changed, 50 insertions(+), 69 deletions(-) diff --git a/.ci/jobs.yml b/.ci/jobs.yml index cbf9196193e25..fc3e80064fa6f 100644 --- a/.ci/jobs.yml +++ b/.ci/jobs.yml @@ -1,52 +1,33 @@ JOB: - # - kibana-intake - # - x-pack-intake - # - kibana-firefoxSmoke - # - kibana-ciGroup1 - # - kibana-ciGroup2 - # - kibana-ciGroup3 - # - kibana-ciGroup4 - # - kibana-ciGroup5 - # - kibana-ciGroup6 - # - kibana-ciGroup7 - # - kibana-ciGroup8 - # - kibana-ciGroup9 - # - kibana-ciGroup10 - # - kibana-ciGroup11 - # - kibana-ciGroup12 + - kibana-intake + - x-pack-intake + - kibana-firefoxSmoke + - kibana-ciGroup1 + - kibana-ciGroup2 + - kibana-ciGroup3 + - kibana-ciGroup4 + - kibana-ciGroup5 + - kibana-ciGroup6 + - kibana-ciGroup7 + - kibana-ciGroup8 + - kibana-ciGroup9 + - kibana-ciGroup10 + - kibana-ciGroup11 + - kibana-ciGroup12 # - kibana-visualRegression # make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh - # - x-pack-firefoxSmoke - - x-pack-ciGroup1-1 - - x-pack-ciGroup1-2 - - x-pack-ciGroup1-3 - - x-pack-ciGroup1-4 - - x-pack-ciGroup1-5 - - x-pack-ciGroup1-6 - - x-pack-ciGroup1-7 - - x-pack-ciGroup1-8 - - x-pack-ciGroup1-9 - - x-pack-ciGroup1-10 - - x-pack-ciGroup1-11 - - x-pack-ciGroup1-12 - - x-pack-ciGroup1-13 - - x-pack-ciGroup1-14 - - x-pack-ciGroup1-15 - - x-pack-ciGroup1-16 - - x-pack-ciGroup1-17 - - x-pack-ciGroup1-18 - - x-pack-ciGroup1-19 - - x-pack-ciGroup1-20 - # - x-pack-ciGroup2 - # - x-pack-ciGroup3 - # - x-pack-ciGroup4 - # - x-pack-ciGroup5 - # - x-pack-ciGroup6 - # - x-pack-ciGroup7 - # - x-pack-ciGroup8 - # - x-pack-ciGroup9 - # - x-pack-ciGroup10 + - x-pack-firefoxSmoke + - x-pack-ciGroup1 + - x-pack-ciGroup2 + - x-pack-ciGroup3 + - x-pack-ciGroup4 + - x-pack-ciGroup5 + - x-pack-ciGroup6 + - x-pack-ciGroup7 + - x-pack-ciGroup8 + - x-pack-ciGroup9 + - x-pack-ciGroup10 # - x-pack-visualRegression # `~` is yaml for `null` diff --git a/test/scripts/jenkins_build_kibana.sh b/test/scripts/jenkins_build_kibana.sh index df0c1c9aad68a..f79fe98e07bef 100755 --- a/test/scripts/jenkins_build_kibana.sh +++ b/test/scripts/jenkins_build_kibana.sh @@ -6,7 +6,7 @@ echo " -> downloading es snapshot" node scripts/es snapshot --license=oss --download-only; echo " -> Ensuring all functional tests are in a ciGroup" -#yarn run grunt functionalTests:ensureAllTestsInCiGroup; +yarn run grunt functionalTests:ensureAllTestsInCiGroup; echo " -> building and extracting OSS Kibana distributable for use in functional tests" node scripts/build --debug --oss diff --git a/test/scripts/jenkins_ci_group.sh b/test/scripts/jenkins_ci_group.sh index d588d977e4538..cab4a32e6a6ae 100755 --- a/test/scripts/jenkins_ci_group.sh +++ b/test/scripts/jenkins_ci_group.sh @@ -11,7 +11,7 @@ fi export TEST_BROWSER_HEADLESS=1 if [[ -z "$IS_PIPELINE_JOB" ]] ; then - #yarn run grunt functionalTests:ensureAllTestsInCiGroup; + yarn run grunt functionalTests:ensureAllTestsInCiGroup; node scripts/build --debug --oss; else installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)" diff --git a/test/scripts/jenkins_xpack_build_kibana.sh b/test/scripts/jenkins_xpack_build_kibana.sh index a75d11ed52309..9f2bafc863f41 100755 --- a/test/scripts/jenkins_xpack_build_kibana.sh +++ b/test/scripts/jenkins_xpack_build_kibana.sh @@ -8,17 +8,17 @@ node scripts/es snapshot --download-only; echo " -> Ensuring all functional tests are in a ciGroup" cd "$XPACK_DIR" -# node scripts/functional_tests --assert-none-excluded \ -# --include-tag ciGroup1 \ -# --include-tag ciGroup2 \ -# --include-tag ciGroup3 \ -# --include-tag ciGroup4 \ -# --include-tag ciGroup5 \ -# --include-tag ciGroup6 \ -# --include-tag ciGroup7 \ -# --include-tag ciGroup8 \ -# --include-tag ciGroup9 \ -# --include-tag ciGroup10 +node scripts/functional_tests --assert-none-excluded \ + --include-tag ciGroup1 \ + --include-tag ciGroup2 \ + --include-tag ciGroup3 \ + --include-tag ciGroup4 \ + --include-tag ciGroup5 \ + --include-tag ciGroup6 \ + --include-tag ciGroup7 \ + --include-tag ciGroup8 \ + --include-tag ciGroup9 \ + --include-tag ciGroup10 echo " -> building and extracting default Kibana distributable for use in functional tests" cd "$KIBANA_DIR" diff --git a/test/scripts/jenkins_xpack_ci_group.sh b/test/scripts/jenkins_xpack_ci_group.sh index 69df6644bf1ee..a7d443e0586a9 100755 --- a/test/scripts/jenkins_xpack_ci_group.sh +++ b/test/scripts/jenkins_xpack_ci_group.sh @@ -13,17 +13,17 @@ export TEST_BROWSER_HEADLESS=1 if [[ -z "$IS_PIPELINE_JOB" ]] ; then echo " -> Ensuring all functional tests are in a ciGroup" cd "$XPACK_DIR" - # node scripts/functional_tests --assert-none-excluded \ - # --include-tag ciGroup1 \ - # --include-tag ciGroup2 \ - # --include-tag ciGroup3 \ - # --include-tag ciGroup4 \ - # --include-tag ciGroup5 \ - # --include-tag ciGroup6 \ - # --include-tag ciGroup7 \ - # --include-tag ciGroup8 \ - # --include-tag ciGroup9 \ - # --include-tag ciGroup10 + node scripts/functional_tests --assert-none-excluded \ + --include-tag ciGroup1 \ + --include-tag ciGroup2 \ + --include-tag ciGroup3 \ + --include-tag ciGroup4 \ + --include-tag ciGroup5 \ + --include-tag ciGroup6 \ + --include-tag ciGroup7 \ + --include-tag ciGroup8 \ + --include-tag ciGroup9 \ + --include-tag ciGroup10 fi cd "$KIBANA_DIR"