Skip to content

Commit

Permalink
[Uptime] [Synthetics Integration] Synthetics fix tests (#109706) (#10…
Browse files Browse the repository at this point in the history
…9866)

* focus tests

* adjust id

* unfocus test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Dominique Clarke <doclarke71@gmail.com>
  • Loading branch information
kibanamachine and dominiqueclarke authored Aug 24, 2021
1 parent 51165d6 commit 9bda61b
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions x-pack/test/functional/apps/uptime/synthetics_integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const uptimeService = getService('uptime');

const getSyntheticsPolicy = (agentFullPolicy: FullAgentPolicy) =>
agentFullPolicy.inputs.find((input) => input.meta?.package?.name === 'synthetics');

const generatePolicy = ({
agentFullPolicy,
version,
Expand All @@ -32,7 +35,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
data_stream: {
namespace: 'default',
},
id: agentFullPolicy.inputs[0].id,
id: getSyntheticsPolicy(agentFullPolicy)?.id,
meta: {
package: {
name: 'synthetics',
Expand All @@ -47,7 +50,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
dataset: monitorType,
type: 'synthetics',
},
id: `${agentFullPolicy.inputs[0]?.streams?.[0]?.id}`,
id: `${getSyntheticsPolicy(agentFullPolicy)?.streams?.[0]?.id}`,
name,
type: monitorType,
processors: [
Expand Down Expand Up @@ -92,8 +95,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
host,
});

// FLAKY: https://github.com/elastic/kibana/issues/109260
describe.skip('displays custom UI', () => {
describe('displays custom UI', () => {
before(async () => {
const version = await uptimeService.syntheticsPackage.getSyntheticsPackageVersion();
await uptimePage.syntheticsIntegration.navigateToPackagePage(version!);
Expand All @@ -111,12 +113,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/109329
describe.skip('create new policy', () => {
describe('create new policy', () => {
let version: string;
before(async () => {
await uptimeService.syntheticsPackage.deletePolicyByName('system-1');
});

beforeEach(async () => {
version = (await uptimeService.syntheticsPackage.getSyntheticsPackageVersion())!;
Expand All @@ -143,7 +141,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
agentPolicyId
);

expect(agentFullPolicy.inputs).to.eql([
expect(getSyntheticsPolicy(agentFullPolicy)).to.eql(
generatePolicy({
agentFullPolicy,
version,
Expand All @@ -160,8 +158,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
tags: [config.tags],
'check.request.method': 'GET',
},
}),
]);
})
);
});

it('allows enabling tls with defaults', async () => {
Expand All @@ -181,7 +179,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
agentPolicyId
);

expect(agentFullPolicy.inputs).to.eql([
expect(
agentFullPolicy.inputs.find((input) => input.meta?.package?.name === 'synthetics')
).to.eql(
generatePolicy({
agentFullPolicy,
version,
Expand All @@ -200,8 +200,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
'service.name': config.apmServiceName,
tags: [config.tags],
},
}),
]);
})
);
});

it('allows configuring tls', async () => {
Expand All @@ -228,7 +228,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
agentPolicyId
);

expect(agentFullPolicy.inputs).to.eql([
expect(getSyntheticsPolicy(agentFullPolicy)).to.eql(
generatePolicy({
agentFullPolicy,
version,
Expand All @@ -251,8 +251,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
'service.name': config.apmServiceName,
tags: [config.tags],
},
}),
]);
})
);
});

it('allows configuring http advanced options', async () => {
Expand Down Expand Up @@ -295,7 +295,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
agentPolicyId
);

expect(agentFullPolicy.inputs).to.eql([
expect(getSyntheticsPolicy(agentFullPolicy)).to.eql(
generatePolicy({
agentFullPolicy,
version,
Expand Down Expand Up @@ -324,8 +324,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
'service.name': config.apmServiceName,
tags: [config.tags],
},
}),
]);
})
);
});

it('allows saving tcp monitor when user enters a valid integration name and host+port', async () => {
Expand All @@ -344,7 +344,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
agentPolicyId
);

expect(agentFullPolicy.inputs).to.eql([
expect(getSyntheticsPolicy(agentFullPolicy)).to.eql(
generatePolicy({
agentFullPolicy,
version,
Expand All @@ -358,8 +358,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
tags: [config.tags],
'service.name': config.apmServiceName,
},
}),
]);
})
);
});

it('allows configuring tcp advanced options', async () => {
Expand All @@ -385,7 +385,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
agentPolicyId
);

expect(agentFullPolicy.inputs).to.eql([
expect(getSyntheticsPolicy(agentFullPolicy)).to.eql(
generatePolicy({
agentFullPolicy,
version,
Expand All @@ -402,8 +402,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
'service.name': config.apmServiceName,
tags: [config.tags],
},
}),
]);
})
);
});

it('allows saving icmp monitor when user enters a valid integration name and host', async () => {
Expand All @@ -422,7 +422,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
agentPolicyId
);

expect(agentFullPolicy.inputs).to.eql([
expect(getSyntheticsPolicy(agentFullPolicy)).to.eql(
generatePolicy({
agentFullPolicy,
version,
Expand All @@ -436,8 +436,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
'service.name': config.apmServiceName,
tags: [config.tags],
},
}),
]);
})
);
});
});
});
Expand Down

0 comments on commit 9bda61b

Please sign in to comment.