mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.11`: - [[ftr] fix url check by excluding port (#168112)](https://github.com/elastic/kibana/pull/168112) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2023-10-05T16:28:46Z","message":"[ftr] fix url check by excluding port (#168112)\n\n## Summary\r\n\r\nAddressing MKI `commonPage.navigateToUrl()` failures when `actualUrl`\r\ncontains port value.\r\n\r\n```\r\n✖ fail: Serverless Common UI - Management Data View Management disables scripted fields Scripted fields tab is missing\r\n--\r\n | │ Error: retry.try timeout: Error: expected https://bk-serverless-ftr-185-elasticsearch-e79c7a.kb.eu-west-1.aws.qa.elastic.cloud/app/management/kibana/dataViews.includes(https://bk-serverless-ftr-185-elasticsearch-e79c7a.kb.eu-west-1.aws.qa.elastic.cloud:443/app/management/kibana/dataViews)\r\n```\r\n\r\nWorks both on MKI and local serverless run.","sha":"6301dc83843d2fad546a02edcef68ad9a6715937","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","FTR","v8.9.3","v8.12.0","v8.11.1"],"number":168112,"url":"https://github.com/elastic/kibana/pull/168112","mergeCommit":{"message":"[ftr] fix url check by excluding port (#168112)\n\n## Summary\r\n\r\nAddressing MKI `commonPage.navigateToUrl()` failures when `actualUrl`\r\ncontains port value.\r\n\r\n```\r\n✖ fail: Serverless Common UI - Management Data View Management disables scripted fields Scripted fields tab is missing\r\n--\r\n | │ Error: retry.try timeout: Error: expected https://bk-serverless-ftr-185-elasticsearch-e79c7a.kb.eu-west-1.aws.qa.elastic.cloud/app/management/kibana/dataViews.includes(https://bk-serverless-ftr-185-elasticsearch-e79c7a.kb.eu-west-1.aws.qa.elastic.cloud:443/app/management/kibana/dataViews)\r\n```\r\n\r\nWorks both on MKI and local serverless run.","sha":"6301dc83843d2fad546a02edcef68ad9a6715937"}},"sourceBranch":"main","suggestedTargetBranches":["8.9","8.11"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/168112","number":168112,"mergeCommit":{"message":"[ftr] fix url check by excluding port (#168112)\n\n## Summary\r\n\r\nAddressing MKI `commonPage.navigateToUrl()` failures when `actualUrl`\r\ncontains port value.\r\n\r\n```\r\n✖ fail: Serverless Common UI - Management Data View Management disables scripted fields Scripted fields tab is missing\r\n--\r\n | │ Error: retry.try timeout: Error: expected https://bk-serverless-ftr-185-elasticsearch-e79c7a.kb.eu-west-1.aws.qa.elastic.cloud/app/management/kibana/dataViews.includes(https://bk-serverless-ftr-185-elasticsearch-e79c7a.kb.eu-west-1.aws.qa.elastic.cloud:443/app/management/kibana/dataViews)\r\n```\r\n\r\nWorks both on MKI and local serverless run.","sha":"6301dc83843d2fad546a02edcef68ad9a6715937"}},{"branch":"8.11","label":"v8.11.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
This commit is contained in:
parent
6a19c59fbd
commit
6518d71387
1 changed files with 13 additions and 2 deletions
|
@ -33,6 +33,12 @@ export class CommonPageObject extends FtrService {
|
|||
private readonly defaultTryTimeout = this.config.get('timeouts.try');
|
||||
private readonly defaultFindTimeout = this.config.get('timeouts.find');
|
||||
|
||||
private getUrlWithoutPort(urlStr: string) {
|
||||
const url = new URL(urlStr);
|
||||
url.port = '';
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logins to Kibana as default user and navigates to provided app
|
||||
* @param appUrl Kibana URL
|
||||
|
@ -121,8 +127,13 @@ export class CommonPageObject extends FtrService {
|
|||
throw new Error(msg);
|
||||
}
|
||||
|
||||
if (ensureCurrentUrl && !currentUrl.includes(appUrl)) {
|
||||
throw new Error(`expected ${currentUrl}.includes(${appUrl})`);
|
||||
if (ensureCurrentUrl) {
|
||||
const actualUrl = this.getUrlWithoutPort(currentUrl);
|
||||
const expectedUrl = this.getUrlWithoutPort(appUrl);
|
||||
|
||||
if (!actualUrl.includes(expectedUrl)) {
|
||||
throw new Error(`expected ${actualUrl}.includes(${expectedUrl})`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue