Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Graph] Unskip graph tests #72291

Merged
merged 10 commits into from
Jul 27, 2020
28 changes: 15 additions & 13 deletions x-pack/test/functional/apps/graph/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/53749
describe.skip('graph', function () {
describe('graph', function () {
before(async () => {
await browser.setWindowSize(1600, 1000);
log.debug('load graph/secrepo data');
Expand Down Expand Up @@ -132,14 +131,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await buildGraph();
const { edges } = await PageObjects.graph.getGraphObjects();

const blogAdminBlogEdge = edges.find(
await PageObjects.graph.isolateEdge('test', '/test/wp-admin/');

await PageObjects.graph.stopLayout();
await PageObjects.common.sleep(1000);
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.clickEdge(blogAdminBlogEdge);
await testTestWpAdminBlogEdge.element.click();
await PageObjects.common.sleep(1000);
await PageObjects.graph.startLayout();

const vennTerm1 = await PageObjects.graph.getVennTerm1();
log.debug('vennTerm1 = ' + vennTerm1);
Expand All @@ -156,11 +158,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 () {
Expand Down
12 changes: 1 addition & 11 deletions x-pack/test/functional/page_objects/graph_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -109,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');
Expand Down