Chore: Remove more stuff from the e2e object (#75513)

* cut down the e2e object more :)

* undo changes in grafana-e2e

* couple more things to undo in grafana-e2e
This commit is contained in:
Ashley Harrison
2023-09-27 11:33:00 +01:00
committed by GitHub
parent 2a9ef4cce5
commit d8e99e2bb5
54 changed files with 75 additions and 77 deletions
+2 -2
View File
@@ -82,14 +82,14 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
e2e.pages.DataSource.saveAndTest().click();
if (awaitHealth) {
cy.wait('@health', { timeout: timeout ?? e2e.config().defaultCommandTimeout });
cy.wait('@health', { timeout: timeout ?? Cypress.config().defaultCommandTimeout });
}
// 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,
timeout: timeout ?? Cypress.config().defaultCommandTimeout,
});
cy.logToConsole('Added data source with name:', name);
+1 -1
View File
@@ -155,7 +155,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
e2e.components.RefreshPicker.runButtonV2().first().click({ force: true });
// Wait for RxJS
cy.wait(timeout ?? e2e.config().defaultCommandTimeout);
cy.wait(timeout ?? Cypress.config().defaultCommandTimeout);
if (matchScreenshot) {
let visualization;
-4
View File
@@ -7,10 +7,6 @@ import { getScenarioContext, setScenarioContext } from './support/scenarioContex
import * as typings from './typings';
export const e2e = {
env: (args: string) => Cypress.env(args),
config: () => Cypress.config(),
blobToBase64String: (blob: Blob) => Cypress.Blob.blobToBase64String(blob),
imgSrcToBlob: (url: string) => Cypress.Blob.imgSrcToBlob(url),
benchmark,
pages: e2eFactory({ selectors: selectors.pages }),
typings,
+1 -1
View File
@@ -31,7 +31,7 @@ export const benchmark = ({
} else {
describe(name, () => {
beforeEach(() => {
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
e2e.flows.importDashboards(dashboard.folder, 1000, dashboard.skipPanelValidation);
});
+1 -1
View File
@@ -1,6 +1,6 @@
import { e2e } from '../index';
const getBaseUrl = () => e2e.env('BASE_URL') || e2e.config().baseUrl || 'http://localhost:3000';
const getBaseUrl = () => Cypress.env('BASE_URL') || Cypress.config().baseUrl || 'http://localhost:3000';
export const fromBaseUrl = (url = '') => new URL(url, getBaseUrl()).href;