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

[Kibana Overview] Fix failing test #139112

Merged
merged 9 commits into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions test/functional/apps/kibana_overview/_solutions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,30 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
});

it('contains the appropriate solutions', async () => {
it('contains Security and Observability solutions', async () => {
const solutionCards = await find.allByCssSelector('.kbnOverviewMore__item');
expect(solutionCards.length).to.be(2);
expect(solutionCards.length >= 2).to.be(true);

const observabilityImage = await solutionCards[0].findByCssSelector('img');
const observabilityImageUrl = await observabilityImage.getAttribute('src');
expect(observabilityImageUrl.includes('/solutions_observability.svg')).to.be(true);

const securityImage = await solutionCards[1].findByCssSelector('img');
const securityImageUrl = await securityImage.getAttribute('src');
expect(securityImageUrl.includes('/solutions_security_solution.svg')).to.be(true);
const imageSrcs = [];
const re = /.*(\/solutions_(observability|security_solution)\.svg)/;
const myRegexp = new RegExp(re, 'g');
for (let i = 0; i < solutionCards.length; i++) {
const solutionCard = solutionCards[i];
const image = await solutionCard.findByCssSelector('img');
const imageSrc = await image.getAttribute('src');
const match = myRegexp.exec(imageSrc);
myRegexp.lastIndex = 0;
if (match && match.length > 1) {
imageSrcs.push(match[1]);
}
}
expect(imageSrcs.includes('/solutions_observability.svg')).to.be(true);
expect(imageSrcs.includes('/solutions_security_solution.svg')).to.be(true);
});

it('click on Observability card leads to Observability', async () => {
// skipped as on Cloud it's a different setup than locally
// https://github.com/elastic/kibana/issues/139270
xit('click on Observability card leads to Observability', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we keep those skipped tests if we can't run them on CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we know we need to tackle them at one point in time, which may not be right away.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Should we create an issue for it then and add the link in this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thanks. Sorry I meant in the comment of the code base 😊 So we know it is being tracked

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope it's ok now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah perfect thanks. It is just to be consistent with how the operation team flags skipped tests when there are too many failure in CI.

let solutionCards: string | any[] = [];
await retry.waitForWithTimeout('all solutions to be present', 5000, async () => {
solutionCards = await find.allByCssSelector('.kbnOverviewMore__item');
Expand All @@ -56,7 +66,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.common.waitUntilUrlIncludes('app/observability');
});

it('click on Security card leads to Security', async () => {
// skipped as on Cloud it's a different setup than locally
// https://github.com/elastic/kibana/issues/139270
xit('click on Security card leads to Security', async () => {
await PageObjects.common.navigateToUrl('kibana_overview', '', { useActualUrl: true });
await PageObjects.header.waitUntilLoadingHasFinished();

Expand Down