1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/frontend/cypress/global.d.ts
Gastón Fournier acecffd93f
fix: force languages in cypress browser for tests (#8049)
To fix this we had to create a free trial account on cypress and enable
the recording of the test. That way we found out the issue was with a
locale:
![image
(38)](https://github.com/user-attachments/assets/db2fad23-6fec-47c0-8c6f-a93f3e4e4c4c)

Probably, this works well locally because our local machines do have a
default locale, but probably we don't have one when running in CI, and
millify library is causing the tests to fail specifically at this line:
363911c4a1/frontend/src/component/common/AvatarGroup/AvatarGroup.tsx (L89)
(validated
[here](https://github.com/Unleash/unleash/pull/8040/files#diff-afc857890da2221bd34feed0ff45dd7745ff32fb0b27055214cbe69896d5311dL89)).

Unfortunately, upgrading millify didn't help, but downgrading to v5
(which doesn't support locales), solve the issue at the cost of not
having the up-to-date library:
https://github.com/Unleash/unleash/pull/8048

I believe the issue is related to this locale `c` reported here:
https://github.com/cypress-io/cypress/issues/7890#issuecomment-2105991364
because only after overriding the languages this worked
2024-09-03 10:06:58 +00: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;
}
}