1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/cypress/global.d.ts
Gastón Fournier 9f3648dc81
chore: test migration backward compatibility (#5492)
## About the changes
This PR will validate that our current migrations are backward
compatible with the latest stable release of Unleash.
It will do so by starting a database, applying the latest migrations,
and then starting a docker container with the last stable unleash
release and running UI tests against it.

There's a risk that the current version of UI tests will not work with
the previous version of our UI. Because of that we copied the previous
version of cypress tests
(https://github.com/Unleash/unleash/tree/5.6/frontend/cypress) into oss
folder and removed the ones that are enterprise only. We can discuss a
better way of doing this to avoid having to maintain this folder always
in sync with the previous version of Unleash

This action will only run when there are changes in migrations or to
cypress tests.
2023-11-30 18:20:13 +01:00

98 lines
2.8 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;
}
}