Skip to content

Commit

Permalink
test: use regex for url checks
Browse files Browse the repository at this point in the history
Updates tests to use a regex for URL checks instead of expecting the
URLs to equal the mocked value exactly. This will allow these tests to
pass both locally and against a real cluster with the MKI tests.
  • Loading branch information
TattdCodeMonkey committed Oct 22, 2024
1 parent 8d1fda2 commit 03c3f62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export function SvlSearchElasticsearchStartPageProvider({ getService }: FtrProvi
},
async expectO11yTrialLink() {
await testSubjects.existOrFail('startO11yTrialBtn');
expect(await testSubjects.getAttribute('startO11yTrialBtn', 'href')).equal(
'https://fake-cloud.elastic.co/projects/create/observability/start'
expect(await testSubjects.getAttribute('startO11yTrialBtn', 'href')).match(
/^https?\:\/\/.*\/projects\/create\/observability\/start/
);
expect(await testSubjects.getAttribute('startO11yTrialBtn', 'target')).equal('_blank');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function SvlSearchIndexDetailPageProvider({ getService }: FtrProviderCont
},
async expectConnectionDetails() {
await testSubjects.existOrFail('connectionDetailsEndpoint', { timeout: 2000 });
expect(await (await testSubjects.find('connectionDetailsEndpoint')).getVisibleText()).to.be(
'https://fakeprojectid.es.fake-domain.cld.elstc.co:443'
expect(await (await testSubjects.find('connectionDetailsEndpoint')).getVisibleText()).match(
/^https?\:\/\/.*(\:\d+)?/
);
},
async expectQuickStats() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
};

describe('Elasticsearch Start [Onboarding Empty State]', function () {
// fails on MKI, see https://github.com/elastic/kibana/issues/196981
this.tags(['failsOnMKI']);

describe('developer', function () {
before(async () => {
await pageObjects.svlCommonPage.loginWithRole('developer');
Expand Down

0 comments on commit 03c3f62

Please sign in to comment.