mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
test: add support for timeout to be passed in for addDatasource (#30736)
* add support for timeout to be passed in for addDatasource * fix merge update
This commit is contained in:
parent
b43a17f962
commit
25bcbb7d8e
@ -13,6 +13,7 @@ export interface AddDataSourceConfig {
|
|||||||
name: string;
|
name: string;
|
||||||
skipTlsVerify: boolean;
|
skipTlsVerify: boolean;
|
||||||
type: string;
|
type: string;
|
||||||
|
timeout?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo this actually returns type `Cypress.Chainable<AddDaaSourceConfig>`
|
// @todo this actually returns type `Cypress.Chainable<AddDaaSourceConfig>`
|
||||||
@ -40,6 +41,7 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
|
|||||||
name,
|
name,
|
||||||
skipTlsVerify,
|
skipTlsVerify,
|
||||||
type,
|
type,
|
||||||
|
timeout,
|
||||||
} = fullConfig;
|
} = fullConfig;
|
||||||
|
|
||||||
e2e().logToConsole('Adding data source with name:', name);
|
e2e().logToConsole('Adding data source with name:', name);
|
||||||
@ -75,8 +77,13 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
|
|||||||
form();
|
form();
|
||||||
|
|
||||||
e2e.pages.DataSource.saveAndTest().click();
|
e2e.pages.DataSource.saveAndTest().click();
|
||||||
e2e.pages.DataSource.alert().should('exist').contains(expectedAlertMessage); // assertion
|
|
||||||
|
|
||||||
|
// use the timeout passed in if it exists, otherwise, continue to use the default
|
||||||
|
e2e.pages.DataSource.alert()
|
||||||
|
.should('exist')
|
||||||
|
.contains(expectedAlertMessage, {
|
||||||
|
timeout: timeout ?? e2e.config().defaultCommandTimeout,
|
||||||
|
});
|
||||||
e2e().logToConsole('Added data source with name:', name);
|
e2e().logToConsole('Added data source with name:', name);
|
||||||
|
|
||||||
return e2e()
|
return e2e()
|
||||||
|
Loading…
Reference in New Issue
Block a user