Update e2e package
- Ensure health request is monitored for addDatasource flow - Add custom timeout to configurePanel flow
This commit is contained in:
@@ -42,6 +42,10 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
|
||||
timeout,
|
||||
} = fullConfig;
|
||||
|
||||
e2e()
|
||||
.intercept(/health/)
|
||||
.as('health');
|
||||
|
||||
e2e().logToConsole('Adding data source with name:', name);
|
||||
e2e.pages.AddDataSource.visit();
|
||||
e2e.pages.AddDataSource.dataSourcePluginsV2(type)
|
||||
@@ -76,6 +80,8 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
|
||||
|
||||
e2e.pages.DataSource.saveAndTest().click();
|
||||
|
||||
e2e().wait('@health', { timeout: timeout ?? e2e.config().defaultCommandTimeout });
|
||||
|
||||
// use the timeout passed in if it exists, otherwise, continue to use the default
|
||||
e2e.pages.DataSource.alert()
|
||||
.should('exist')
|
||||
|
||||
@@ -34,6 +34,7 @@ interface ConfigurePanelOptional {
|
||||
panelTitle?: string;
|
||||
timeRange?: TimeRangeConfig;
|
||||
visualizationName?: string;
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
interface ConfigurePanelRequired {
|
||||
@@ -80,6 +81,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
|
||||
timeRange,
|
||||
visitDashboardAtStart,
|
||||
visualizationName,
|
||||
timeout,
|
||||
} = fullConfig;
|
||||
|
||||
if (visitDashboardAtStart) {
|
||||
@@ -158,7 +160,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
|
||||
e2e.components.RefreshPicker.runButtonV2().first().click({ force: true });
|
||||
|
||||
// Wait for RxJS
|
||||
e2e().wait(500);
|
||||
e2e().wait(timeout ?? e2e.config().defaultCommandTimeout);
|
||||
|
||||
if (matchScreenshot) {
|
||||
let visualization;
|
||||
|
||||
Reference in New Issue
Block a user