-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Fix Failing test: Service map embeddable #267540
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
Changes from all commits
740bb16
61ee15d
ca01ad0
6f38986
53060d3
b1bb6d0
b24801f
310dea3
528ef47
f568d63
29efc6c
62c9efa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,10 @@ type CommonlyUsedTimeRange = | |
| | 'Last_90 days' | ||
| | 'Last_1 year'; | ||
|
|
||
| interface TimeoutOptions { | ||
| timeout?: number; | ||
| } | ||
|
|
||
| export class DashboardApp { | ||
| private readonly renderable: RenderablePage; | ||
| private readonly toasts: Toasts; | ||
|
|
@@ -133,9 +137,9 @@ export class DashboardApp { | |
| } | ||
|
|
||
| /** Navigates to the new dashboard creation page and waits for the editor toolbar to load. */ | ||
| async openNewDashboard() { | ||
| async openNewDashboard(options?: TimeoutOptions) { | ||
| await this.page.gotoApp('dashboards', { hash: '/create' }); | ||
| await expect(this.addTopNavButton).toBeVisible({ timeout: 20_000 }); | ||
| await expect(this.addTopNavButton).toBeVisible({ timeout: options?.timeout ?? 20_000 }); | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is not the main issue with the test:
Could be that in Cloud typing I believe running flaky-test-runner against Kibana local servers doesn't really help to verify the fix. Please run the test against ECH deployment to confirm the issue is fixed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, this would break things. A quick overview of the changes is:
Not directly related to the test, more code related, but added the option for other parts of the same files to have a custom timeout or to use Note: Added photo of ECH test passing (did a commit afterwards because the date input is not the same locally vs ECH, everything else is the same and should pass) |
||
|
|
||
| private getSettingsFlyout() { | ||
|
|
@@ -264,12 +268,12 @@ export class DashboardApp { | |
| * Opens the "Add from library" flyout. | ||
| * Low-level building block used by addEmbeddable(). | ||
| */ | ||
| private async openLibraryFlyout() { | ||
| private async openLibraryFlyout(options?: TimeoutOptions) { | ||
| await this.addTopNavButton.click(); | ||
| await this.page.testSubj.click('addToDashboardTab-library'); | ||
| await expect(this.savedObjectsFinderTable).toBeVisible(); | ||
| await expect(this.savedObjectFinderLoadingIndicator).toBeHidden({ | ||
| timeout: 30_000, | ||
| timeout: options?.timeout ?? 30_000, | ||
| }); | ||
| } | ||
|
|
||
|
|
@@ -287,8 +291,13 @@ export class DashboardApp { | |
| * | ||
| * @param embeddableName - Name with dashes (e.g., 'Rendering-Test:-saved-search') | ||
| * @param embeddableType - Optional type filter (e.g., 'search', 'Visualization') | ||
| * @param options - Optional timeout overrides | ||
| */ | ||
| private async filterEmbeddableNames(embeddableName: string, embeddableType?: string) { | ||
| private async filterEmbeddableNames( | ||
| embeddableName: string, | ||
| embeddableType?: string, | ||
| options?: TimeoutOptions | ||
| ) { | ||
| // Build search query using type filter and quoted name. | ||
| // type:(search) "Rendering Test:-saved-search" (only first dash replaced with space) | ||
| const typePrefix = embeddableType ? `type:(${embeddableType}) ` : ''; | ||
|
|
@@ -301,7 +310,7 @@ export class DashboardApp { | |
|
|
||
| // Wait for search results to load | ||
| await expect(this.savedObjectFinderLoadingIndicator).toBeHidden({ | ||
| timeout: 30_000, | ||
| timeout: options?.timeout ?? 30_000, | ||
| }); | ||
| } | ||
|
|
||
|
|
@@ -310,10 +319,11 @@ export class DashboardApp { | |
| * | ||
| * @param embeddableName - Name with dashes (e.g., 'Rendering-Test:-saved-search') | ||
| * @param embeddableType - Optional type filter (e.g., 'search', 'Visualization') | ||
| * @param options - Optional timeout overrides | ||
| */ | ||
| async addEmbeddable(embeddableName: string, embeddableType?: string) { | ||
| await this.openLibraryFlyout(); | ||
| await this.filterEmbeddableNames(embeddableName, embeddableType); | ||
| async addEmbeddable(embeddableName: string, embeddableType?: string, options?: TimeoutOptions) { | ||
| await this.openLibraryFlyout(options); | ||
| await this.filterEmbeddableNames(embeddableName, embeddableType, options); | ||
|
|
||
| // Click on the saved object title | ||
| const titleSelector = `savedObjectTitle${embeddableName.split(' ').join('-')}`; | ||
|
|
@@ -335,19 +345,21 @@ export class DashboardApp { | |
| * Wrapper around addEmbeddable() with type='search'. | ||
| * | ||
| * @param searchName - Name with dashes (e.g., 'Rendering-Test:-saved-search') | ||
| * @param options - Optional timeout overrides | ||
| */ | ||
| async addSavedSearch(searchName: string) { | ||
| return this.addEmbeddable(searchName, 'search'); | ||
| async addSavedSearch(searchName: string, options?: TimeoutOptions) { | ||
| return this.addEmbeddable(searchName, 'search', options); | ||
| } | ||
|
|
||
| /** | ||
| * Adds a Lens visualization to the dashboard from the library. | ||
| * Wrapper around addEmbeddable() with type='lens'. | ||
| * | ||
| * @param lensName - Name of the Lens saved object | ||
| * @param options - Optional timeout overrides | ||
| */ | ||
| async addLens(lensName: string) { | ||
| return this.addEmbeddable(lensName, 'lens'); | ||
| async addLens(lensName: string, options?: TimeoutOptions) { | ||
| return this.addEmbeddable(lensName, 'lens', options); | ||
| } | ||
|
|
||
| /** | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.