Files
MSE-SoftwEng/web-app/cypress/e2e/fetch_process.cy.ts
fastium e436eb354b test(webapp): provide tests in CI
- add url and page as env variables to choice where to test and update the others
- To pass a variable to a job's service, they have to be declared in the "variables" global -> doesn't work (see: [#37])
- use of the deployed image to do E2E test instead of services of gitlab
2025-06-24 17:33:41 +02:00

34 lines
1.2 KiB
TypeScript

/// <reference types="cypress" />
describe("Test fetch measurments button in the main page", () => {
beforeEach(() => {
cy.visit("https://app.mse.kb28.ch");
});
it("Fetch timeseries with valid user-room-device", () => {
cy.get('[data-cy="fetch-measurements-button"]').should("be.visible");
// keep default mulitselector value for the test
cy.get('[data-cy="fetch-measurements-button"]').click();
cy.get('[data-cy="main-chart"]').should("be.visible");
cy.get('[data-cy="no-data-display"]').should("not.exist");
});
it("Fetch timeseries with invalid user-room-device", () => {
//change the defualt user to "Sylvan"
cy.get('[data-cy="user-mulitselect"]').should("be.visible").click();
cy.get(
'[data-cy="user-mulitselect"] .multiselect__content-wrapper .multiselect__element'
)
.contains("Sylvan")
.click();
cy.get('[data-cy="fetch-measurements-button"]').should("be.visible");
// keep default mulitselector value for the test
cy.get('[data-cy="fetch-measurements-button"]').click();
cy.get('[data-cy="main-chart"]').should("not.exist");
cy.get('[data-cy="no-data-display"]').should("be.visible");
});
});