Skip to content

Commit

Permalink
[8.x] [Infra] Attempt to fix home_page test (#202120) (#202157)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Infra] Attempt to fix home_page test
(#202120)](#202120)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-28T11:49:00Z","message":"[Infra]
Attempt to fix home_page test (#202120)\n\nfixes
https://github.com/elastic/kibana/issues/194945\r\n\r\n##
Summary\r\n\r\nAttempt to fix saved views test case in the home_page
suite","sha":"1d0f80ffdf605ed89419691d7e95cb2126f0223e","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-infra_services","v8.16.0","backport:version","v8.17.0"],"title":"[Infra]
Attempt to fix home_page
test","number":202120,"url":"https://github.com/elastic/kibana/pull/202120","mergeCommit":{"message":"[Infra]
Attempt to fix home_page test (#202120)\n\nfixes
https://github.com/elastic/kibana/issues/194945\r\n\r\n##
Summary\r\n\r\nAttempt to fix saved views test case in the home_page
suite","sha":"1d0f80ffdf605ed89419691d7e95cb2126f0223e"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202120","number":202120,"mergeCommit":{"message":"[Infra]
Attempt to fix home_page test (#202120)\n\nfixes
https://github.com/elastic/kibana/issues/194945\r\n\r\n##
Summary\r\n\r\nAttempt to fix saved views test case in the home_page
suite","sha":"1d0f80ffdf605ed89419691d7e95cb2126f0223e"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <[email protected]>
  • Loading branch information
kibanamachine and crespocarlos authored Nov 28, 2024
1 parent 2adca3e commit 868495a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions x-pack/test/functional/page_objects/infra_saved_views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const browser = getService('browser');
const config = getService('config');

return {
async clickSavedViewsButton() {
Expand All @@ -25,13 +26,15 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {

return button.click();
},
pressEsc() {
async pressEsc() {
return browser.pressKeys([Key.ESCAPE]);
},

async closeSavedViewsPopover() {
await testSubjects.find('savedViews-popover');
return this.pressEsc();
await retry.tryForTime(config.get('timeouts.try'), async () => {
await this.pressEsc();
await testSubjects.missingOrFail('loadViewsFlyout');
});
},

clickManageViewsButton() {
Expand All @@ -55,7 +58,7 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {
await testSubjects.setValue('savedViewName', name);
await testSubjects.click('createSavedViewButton');
await testSubjects.missingOrFail('createSavedViewButton', { timeout: 20000 });
await retry.tryForTime(10 * 1000, async () => {
await retry.tryForTime(config.get('timeouts.try'), async () => {
await testSubjects.missingOrFail('savedViews-upsertModal');
});
},
Expand All @@ -71,7 +74,7 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {
},

async ensureViewIsLoaded(name: string) {
await retry.tryForTime(5000, async () => {
await retry.tryForTime(config.get('timeouts.try'), async () => {
const subject = await testSubjects.find('savedViews-openPopover');
expect(await subject.getVisibleText()).to.be(name);
});
Expand Down

0 comments on commit 868495a

Please sign in to comment.