1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-28 19:06:12 +01:00
unleash.unleash/frontend/cypress/global.d.ts
Nuno Góis eb01b44e69
test: skip vercel toolbar in e2e tests (#8273)
Some e2e Cypress tests were failing due to the Vercel live feedback
toolbar covering interactive elements, preventing test actions from
completing:
https://github.com/Unleash/unleash/actions/runs/11048512034/job/30692949711#step:4:136

This PR addresses the issue by disabling the Vercel toolbar specifically
during Cypress tests. This is done by setting the
`x-vercel-skip-toolbar` header, which Vercel provides to prevent the
toolbar from interfering with automated tests. You can find more
information about this feature in the Vercel documentation: [Disable
Toolbar for
Automation](https://vercel.com/docs/workflow-collaboration/vercel-toolbar/managing-toolbar#disable-toolbar-for-automation).

Specific type declarations were needed due to
https://github.com/cypress-io/cypress/issues/19564
2024-09-26 12:53:31 +01:00

107 lines
3.1 KiB
TypeScript

/// <reference types="cypress" />
declare namespace Cypress {
interface AddFlexibleRolloutStrategyOptions {
featureToggleName: string;
project?: string;
environment?: string;
stickiness?: string;
}
interface UserCredentials {
email: string;
password: string;
}
interface IEnvironment {
name: string;
type: 'development' | 'preproduction' | 'test' | 'production';
}
interface Chainable {
runBefore(): Chainable;
login_UI(user = AUTH_USER, password = AUTH_PASSWORD): Chainable;
logout_UI(): Chainable;
createProject_UI(
projectName: string,
defaultStickiness: string,
): Chainable;
createFeature_UI(
name: string,
shouldWait?: boolean,
project?: string,
closeSplash?: boolean, // @deprecated to support old tests
): Chainable;
// VARIANTS
addVariantsToFeature_UI(
featureToggleName: string,
variants: Array<string>,
projectName?: string,
);
deleteVariant_UI(
featureToggleName: string,
variant: string,
projectName?: string,
): Chainable<any>;
// SEGMENTS
createSegment_UI(segmentName: string): Chainable;
deleteSegment_UI(segmentName: string, id: string): Chainable;
// STRATEGY
addUserIdStrategyToFeature_UI(
featureName: string,
projectName: string,
): Chainable;
addFlexibleRolloutStrategyToFeature_UI(
options: AddFlexibleRolloutStrategyOptions,
): Chainable;
updateFlexibleRolloutStrategy_UI(
featureToggleName: string,
projectName?: string,
);
deleteFeatureStrategy_UI(
featureName: string,
shouldWait?: boolean,
projectName?: string,
): Chainable;
// API
createUser_API(userName: string, role: number): Chainable;
updateUserPassword_API(id: number, pass?: string): Chainable;
addUserToProject_API(
id: number,
role: number,
projectName?: string,
): Chainable;
createProject_API(
name: string,
options?: Partial<Cypress.RequestOptions>,
): Chainable;
deleteProject_API(name: string): Chainable;
createFeature_API(
name: string,
projectName?: string,
options?: Partial<Cypress.RequestOptions>,
): Chainable;
deleteFeature_API(name: string, projectName?: string): Chainable;
createEnvironment_API(
environment: IEnvironment,
options?: Partial<Cypress.RequestOptions>,
): Chainable;
visit(
options: Partial<Cypress.VisitOptions & PopulatePreloadsOptions> & {
url: string;
},
): Cypress.Chainable<Cypress.AUTWindow>;
visit(
url: string,
options?: Partial<Cypress.VisitOptions & PopulatePreloadsOptions>,
): Cypress.Chainable<Cypress.AUTWindow>;
}
}