2023-04-04 10:46:28 +02:00
|
|
|
///<reference path="../global.d.ts" />
|
2022-05-25 10:14:22 +02:00
|
|
|
|
2023-04-04 10:46:28 +02:00
|
|
|
import {
|
|
|
|
runBefore,
|
|
|
|
login_UI,
|
|
|
|
logout_UI,
|
|
|
|
createProject_UI,
|
|
|
|
createFeature_UI,
|
|
|
|
createSegment_UI,
|
|
|
|
deleteSegment_UI,
|
|
|
|
deleteFeatureStrategy_UI,
|
|
|
|
addFlexibleRolloutStrategyToFeature_UI,
|
|
|
|
addUserIdStrategyToFeature_UI,
|
|
|
|
updateFlexibleRolloutStrategy_UI,
|
|
|
|
//@ts-ignore
|
|
|
|
} from './UI';
|
|
|
|
import {
|
|
|
|
addUserToProject_API,
|
|
|
|
createFeature_API,
|
|
|
|
createProject_API,
|
|
|
|
createUser_API,
|
|
|
|
deleteFeature_API,
|
|
|
|
deleteProject_API,
|
|
|
|
updateUserPassword_API,
|
2023-05-08 10:16:18 +02:00
|
|
|
createEnvironment_API,
|
2023-04-04 10:46:28 +02:00
|
|
|
//@ts-ignore
|
|
|
|
} from './API';
|
2022-05-25 10:14:22 +02:00
|
|
|
|
2024-09-03 12:06:58 +02:00
|
|
|
Cypress.on('window:before:load', (window) => {
|
|
|
|
Object.defineProperty(window.navigator, 'language', { value: 'en' });
|
|
|
|
Object.defineProperty(window.navigator, 'languages', { value: ['en'] });
|
|
|
|
});
|
2023-04-04 10:46:28 +02:00
|
|
|
Cypress.Commands.add('runBefore', runBefore);
|
|
|
|
Cypress.Commands.add('login_UI', login_UI);
|
|
|
|
Cypress.Commands.add('createSegment_UI', createSegment_UI);
|
|
|
|
Cypress.Commands.add('deleteSegment_UI', deleteSegment_UI);
|
|
|
|
Cypress.Commands.add('deleteFeature_API', deleteFeature_API);
|
|
|
|
Cypress.Commands.add('deleteProject_API', deleteProject_API);
|
|
|
|
Cypress.Commands.add('logout_UI', logout_UI);
|
|
|
|
Cypress.Commands.add('createProject_UI', createProject_UI);
|
2023-05-08 10:16:18 +02:00
|
|
|
Cypress.Commands.add('createProject_API', createProject_API);
|
2023-04-04 10:46:28 +02:00
|
|
|
Cypress.Commands.add('createUser_API', createUser_API);
|
|
|
|
Cypress.Commands.add('addUserToProject_API', addUserToProject_API);
|
|
|
|
Cypress.Commands.add('updateUserPassword_API', updateUserPassword_API);
|
|
|
|
Cypress.Commands.add('createFeature_UI', createFeature_UI);
|
|
|
|
Cypress.Commands.add('deleteFeatureStrategy_UI', deleteFeatureStrategy_UI);
|
|
|
|
Cypress.Commands.add('createFeature_API', createFeature_API);
|
|
|
|
Cypress.Commands.add(
|
|
|
|
'addUserIdStrategyToFeature_UI',
|
2023-10-02 14:25:46 +02:00
|
|
|
addUserIdStrategyToFeature_UI,
|
2023-04-04 10:46:28 +02:00
|
|
|
);
|
|
|
|
Cypress.Commands.add(
|
|
|
|
'addFlexibleRolloutStrategyToFeature_UI',
|
2023-10-02 14:25:46 +02:00
|
|
|
addFlexibleRolloutStrategyToFeature_UI,
|
2023-04-04 10:46:28 +02:00
|
|
|
);
|
|
|
|
Cypress.Commands.add(
|
|
|
|
'updateFlexibleRolloutStrategy_UI',
|
2023-10-02 14:25:46 +02:00
|
|
|
updateFlexibleRolloutStrategy_UI,
|
2022-05-25 10:14:22 +02:00
|
|
|
);
|
2023-05-08 10:16:18 +02:00
|
|
|
Cypress.Commands.add('createEnvironment_API', createEnvironment_API);
|
2024-09-26 13:53:31 +02:00
|
|
|
Cypress.Commands.overwrite('visit', (originalFn, url, options = {}) => {
|
|
|
|
if (!options.headers) {
|
|
|
|
options.headers = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add the x-vercel-skip-toolbar header. See: https://vercel.com/docs/workflow-collaboration/vercel-toolbar/managing-toolbar#disable-toolbar-for-automation
|
|
|
|
options.headers['x-vercel-skip-toolbar'] = '1';
|
|
|
|
|
|
|
|
return originalFn(url, options);
|
|
|
|
});
|