mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 04:24:35 +03:00
b2103cda61
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4482 GitOrigin-RevId: bd628911e607ab41399b31f7dd8fe9c361e0f052
30 lines
890 B
TypeScript
30 lines
890 B
TypeScript
import { getTestMode } from './core/testMode';
|
|
|
|
export const testMode = getTestMode();
|
|
export const baseUrl = Cypress.config('baseUrl');
|
|
export const migrateUrl = Cypress.env('MIGRATE_URL');
|
|
export const migrateModeUrl = `${migrateUrl}/settings`;
|
|
|
|
// sets value of window.prompt and reloads page
|
|
export const setPromptValue = (value: string | null) => {
|
|
cy.log(`Set window.prompt to "${value}"`).then(() => {
|
|
cy.removeAllListeners('window:before:load');
|
|
cy.on('window:before:load', win => {
|
|
cy.stub(win, 'prompt').returns(value);
|
|
});
|
|
});
|
|
|
|
cy.reload();
|
|
|
|
/* eslint-disable-next-line cypress/no-unnecessary-waiting */
|
|
cy.wait(7000);
|
|
};
|
|
|
|
// This is works as setPromptValue with no unnecessary waiting
|
|
export const setPromptWithCb = (value: string | null, cb: () => void) => {
|
|
cy.window().then(win => {
|
|
cy.stub(win, 'prompt').returns(value);
|
|
cb();
|
|
});
|
|
};
|