From 0e619f67aa4963d557c2e2f5a94c1449e667f601 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Fri, 17 Jul 2020 16:57:29 +0200 Subject: [PATCH 1/5] unskip graph tests --- x-pack/test/functional/apps/graph/graph.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/x-pack/test/functional/apps/graph/graph.ts b/x-pack/test/functional/apps/graph/graph.ts index 803e5e8f80d707..653104e784e1a8 100644 --- a/x-pack/test/functional/apps/graph/graph.ts +++ b/x-pack/test/functional/apps/graph/graph.ts @@ -13,8 +13,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const browser = getService('browser'); - // FLAKY: https://github.com/elastic/kibana/issues/53749 - describe.skip('graph', function () { + // eslint-disable-next-line ban/ban + describe.only('graph', function () { before(async () => { await browser.setWindowSize(1600, 1000); log.debug('load graph/secrepo data'); @@ -132,14 +132,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await buildGraph(); const { edges } = await PageObjects.graph.getGraphObjects(); - const blogAdminBlogEdge = edges.find( + const testTestWpAdminBlogEdge = edges.find( ({ sourceNode, targetNode }) => - sourceNode.label === '/blog/wp-admin/' && targetNode.label === 'blog' + targetNode.label === '/test/wp-admin/' && sourceNode.label === 'test' )!; - await PageObjects.graph.isolateEdge(blogAdminBlogEdge); + await PageObjects.graph.isolateEdge(testTestWpAdminBlogEdge); - await PageObjects.graph.clickEdge(blogAdminBlogEdge); + await PageObjects.graph.clickEdge(testTestWpAdminBlogEdge); const vennTerm1 = await PageObjects.graph.getVennTerm1(); log.debug('vennTerm1 = ' + vennTerm1); @@ -156,11 +156,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const smallVennTerm2 = await PageObjects.graph.getSmallVennTerm2(); log.debug('smallVennTerm2 = ' + smallVennTerm2); - expect(vennTerm1).to.be('/blog/wp-admin/'); - expect(vennTerm2).to.be('blog'); - expect(smallVennTerm1).to.be('5'); - expect(smallVennTerm12).to.be(' (5) '); - expect(smallVennTerm2).to.be('8'); + expect(vennTerm1).to.be('/test/wp-admin/'); + expect(vennTerm2).to.be('test'); + expect(smallVennTerm1).to.be('4'); + expect(smallVennTerm12).to.be(' (4) '); + expect(smallVennTerm2).to.be('4'); }); it('should delete graph', async function () { From 6dd6e4224208f435ed8b0980bb287720d33b1a19 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Mon, 20 Jul 2020 14:02:43 +0200 Subject: [PATCH 2/5] stabilize graph test more --- x-pack/test/functional/apps/graph/graph.ts | 4 ++-- x-pack/test/functional/page_objects/graph_page.ts | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/x-pack/test/functional/apps/graph/graph.ts b/x-pack/test/functional/apps/graph/graph.ts index 653104e784e1a8..820656aa94c288 100644 --- a/x-pack/test/functional/apps/graph/graph.ts +++ b/x-pack/test/functional/apps/graph/graph.ts @@ -132,13 +132,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await buildGraph(); const { edges } = await PageObjects.graph.getGraphObjects(); + await PageObjects.graph.isolateEdge('test', '/test/wp-admin/'); + const testTestWpAdminBlogEdge = edges.find( ({ sourceNode, targetNode }) => targetNode.label === '/test/wp-admin/' && sourceNode.label === 'test' )!; - await PageObjects.graph.isolateEdge(testTestWpAdminBlogEdge); - await PageObjects.graph.clickEdge(testTestWpAdminBlogEdge); const vennTerm1 = await PageObjects.graph.getVennTerm1(); diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index 0d3e2c10579f54..7e7ed0e511a4df 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -83,10 +83,7 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon return [this.getPositionAsString(x1, y1), this.getPositionAsString(x2, y2)]; } - async isolateEdge(edge: Edge) { - const from = edge.sourceNode.label; - const to = edge.targetNode.label; - + async isolateEdge(from: string, to: string) { // select all nodes await testSubjects.click('graphSelectAll'); From 0e77e3598cfe6b6f9c416a9ff1eff46b62430b6f Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Mon, 20 Jul 2020 17:58:43 +0200 Subject: [PATCH 3/5] fix flakiness --- x-pack/test/functional/apps/graph/graph.ts | 7 +++++-- x-pack/test/functional/page_objects/graph_page.ts | 7 ------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/x-pack/test/functional/apps/graph/graph.ts b/x-pack/test/functional/apps/graph/graph.ts index 820656aa94c288..f6702b20e592f9 100644 --- a/x-pack/test/functional/apps/graph/graph.ts +++ b/x-pack/test/functional/apps/graph/graph.ts @@ -134,12 +134,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.graph.isolateEdge('test', '/test/wp-admin/'); + await this.stopLayout(); + await PageObjects.common.sleep(1000); const testTestWpAdminBlogEdge = edges.find( ({ sourceNode, targetNode }) => targetNode.label === '/test/wp-admin/' && sourceNode.label === 'test' )!; - - await PageObjects.graph.clickEdge(testTestWpAdminBlogEdge); + await testTestWpAdminBlogEdge.element.click(); + await PageObjects.common.sleep(1000); + await this.startLayout(); const vennTerm1 = await PageObjects.graph.getVennTerm1(); log.debug('vennTerm1 = ' + vennTerm1); diff --git a/x-pack/test/functional/page_objects/graph_page.ts b/x-pack/test/functional/page_objects/graph_page.ts index 7e7ed0e511a4df..fe049327fe38b0 100644 --- a/x-pack/test/functional/page_objects/graph_page.ts +++ b/x-pack/test/functional/page_objects/graph_page.ts @@ -106,13 +106,6 @@ export function GraphPageProvider({ getService, getPageObjects }: FtrProviderCon await testSubjects.click('graphRemoveSelection'); } - async clickEdge(edge: Edge) { - await this.stopLayout(); - await PageObjects.common.sleep(1000); - await edge.element.click(); - await this.startLayout(); - } - async stopLayout() { if (await testSubjects.exists('graphPauseLayout')) { await testSubjects.click('graphPauseLayout'); From 1e036f2da392b9851936e3c2eadcaa2e77a0a2e6 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Tue, 21 Jul 2020 10:37:14 +0200 Subject: [PATCH 4/5] fix test --- x-pack/test/functional/apps/graph/graph.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test/functional/apps/graph/graph.ts b/x-pack/test/functional/apps/graph/graph.ts index f6702b20e592f9..9f537d19711d1d 100644 --- a/x-pack/test/functional/apps/graph/graph.ts +++ b/x-pack/test/functional/apps/graph/graph.ts @@ -134,7 +134,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.graph.isolateEdge('test', '/test/wp-admin/'); - await this.stopLayout(); + await PageObjects.graph.stopLayout(); await PageObjects.common.sleep(1000); const testTestWpAdminBlogEdge = edges.find( ({ sourceNode, targetNode }) => @@ -142,7 +142,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { )!; await testTestWpAdminBlogEdge.element.click(); await PageObjects.common.sleep(1000); - await this.startLayout(); + await PageObjects.graph.startLayout(); const vennTerm1 = await PageObjects.graph.getVennTerm1(); log.debug('vennTerm1 = ' + vennTerm1); From 1f07010a85e659c6561729b7e8a476374271bacd Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Tue, 21 Jul 2020 14:11:21 +0200 Subject: [PATCH 5/5] remove test exclusion --- x-pack/test/functional/apps/graph/graph.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/test/functional/apps/graph/graph.ts b/x-pack/test/functional/apps/graph/graph.ts index 9f537d19711d1d..c2500dca784447 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'); - // eslint-disable-next-line ban/ban - describe.only('graph', function () { + describe('graph', function () { before(async () => { await browser.setWindowSize(1600, 1000); log.debug('load graph/secrepo data');