1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/frontend/cypress
Tymoteusz Czech 828ecf8d63
fix: migrations e2e test (#8965)
Onboarding changed e2e test that should run before migration.
2024-12-12 11:19:03 +01:00
..
fixtures
integration test: fix feature e2e test by checking flag name in a td instead of url (#8863) 2024-11-26 16:13:30 +00:00
oss/feature fix: migrations e2e test (#8965) 2024-12-12 11:19:03 +01:00
support fix: migrations e2e test (#8965) 2024-12-12 11:19:03 +01:00
global.d.ts test: skip vercel toolbar in e2e tests (#8273) 2024-09-26 12:53:31 +01:00
README.md
tsconfig.json

Unleash Behavioural tests

Add common commands to Cypress

  • global.d.ts is where we extend Cypress types
  • API.ts contains api requests for common actions (great place for cleanup actions)
  • UI.ts contains common functions for UI operations
  • commands.ts is the place to map the functions to a cypress command

Test Format

Ideally each test should manage its own data.

Avoid using after and afterEach hooks for cleaning up. According to Cypress docs, there is no guarantee that the functions will run

Suggested Format:

  • prepare
  • when
  • then
  • clean

Passing (returned) parameters around

it('can add, update and delete a gradual rollout strategy to the development environment', async () => {
    cy.addFlexibleRolloutStrategyToFeature_UI({
        featureToggleName,
    }).then(value => {
        strategyId = value;
        cy.updateFlexibleRolloutStrategy_UI(featureToggleName, strategyId).then(
            () => cy.deleteFeatureStrategy_UI(featureToggleName, strategyId)
        );
    });
});