Commit 7feaddea by Marcus Andersson Committed by GitHub

Chore: adding platform independent typings for e2e tests. (#27768)

* added typings that are platform independent in the tests.

* fixing nits.
parent 42476811
......@@ -29,7 +29,7 @@ e2e.scenario({
cy.contains(queryText.slice(0, -1)).should('be.visible');
e2e.components.QueryField.container().type('{ctrl}z');
e2e.components.QueryField.container().type(e2e.typings.undo());
cy.contains(queryText).should('be.visible');
},
......
......@@ -8,6 +8,7 @@ import { getScenarioContext, setScenarioContext } from './support/scenarioContex
import { e2eFactory } from './support';
import { selectors } from '@grafana/e2e-selectors';
import * as flows from './flows';
import * as typings from './typings';
const e2eObject = {
env: (args: string) => Cypress.env(args),
......@@ -16,6 +17,7 @@ const e2eObject = {
imgSrcToBlob: (url: string) => Cypress.Blob.imgSrcToBlob(url),
scenario: (args: ScenarioArguments) => e2eScenario(args),
pages: e2eFactory({ selectors: selectors.pages }),
typings,
components: e2eFactory({ selectors: selectors.components }),
flows,
getScenarioContext,
......
export { undo } from './undo';
// https://nodejs.org/api/os.html#os_os_platform
enum Platform {
osx = 'darwin',
windows = 'win32',
linux = 'linux',
aix = 'aix',
freebsd = 'freebsd',
openbsd = 'openbsd',
sunos = 'sunos',
}
export const undo = () => {
switch (Cypress.platform) {
case Platform.osx:
return '{cmd}z';
default:
return '{ctrl}z';
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment