Skip to content

Commit

Permalink
test: update cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Psami-wondah committed Sep 12, 2024
1 parent d60b6e5 commit 564f781
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cypress/e2e/1-dx/2-datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ describe("Testing connecting data on DX", () => {
cy.restoreLocalStorageCache();
// cy.setGoogleAccessToken();

cy.intercept("GET", `${apiUrl}/users/plan-data`).as("planData");

cy.visit("/");

cy.wait("@planData");

cy.get('[data-cy="cookie-btn"]').click();
cy.intercept(`${apiUrl}/external-sources/search?q=*`).as("getDefaultData");
cy.get('[data-cy="home-connect-dataset-button"]').click();
cy.wait("@planData");
});

it("Can filter results by source in the federated search", () => {
Expand Down Expand Up @@ -212,7 +217,11 @@ describe("Edit, Delete and Duplicate Dataset", () => {

beforeEach(() => {
cy.restoreLocalStorageCache();
cy.intercept("GET", `${apiUrl}/users/plan-data`).as("planData");

cy.visit("/");

cy.wait("@planData");
cy.get('[data-cy="cookie-btn"]').click();

cy.intercept("GET", `${apiUrl}/datasets?filter=*`).as("fetchDatasets");
Expand Down
12 changes: 12 additions & 0 deletions cypress/e2e/1-dx/3-charts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ describe("Testing create chart on DX", () => {

beforeEach(() => {
cy.restoreLocalStorageCache();
cy.intercept("GET", `${apiUrl}/users/plan-data`).as("planData");

cy.visit("/");

cy.wait("@planData");

cy.get('[data-cy="cookie-btn"]').click();

cy.intercept("GET", `${apiUrl}/datasets?**`).as("getDatasets");
Expand Down Expand Up @@ -186,8 +190,12 @@ describe("Testing Ai chart creation", () => {

beforeEach(() => {
cy.restoreLocalStorageCache();
cy.intercept("GET", `${apiUrl}/users/plan-data`).as("planData");

cy.visit("/");

cy.wait("@planData");

cy.get('[data-cy="cookie-btn"]').click();
cy.intercept("GET", `${apiUrl}/datasets?**`).as("getDatasets");
cy.get('[data-cy="home-create-chart-button"]').click();
Expand Down Expand Up @@ -271,8 +279,12 @@ describe("Edit, duplicate and delete chart", () => {
const apiUrl = Cypress.env("api_url");
beforeEach(() => {
cy.restoreLocalStorageCache();
cy.intercept("GET", `${apiUrl}/users/plan-data`).as("planData");

cy.visit("/");

cy.wait("@planData");

cy.get('[data-cy="cookie-btn"]').click();

cy.intercept("GET", `${apiUrl}/charts*`).as("fetchCharts");
Expand Down
8 changes: 8 additions & 0 deletions cypress/e2e/1-dx/4-reports.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ describe("Testing reports on DX", () => {
cy.restoreLocalStorageCache();

// Navigating to dx home page
cy.intercept("GET", `${apiUrl}/users/plan-data`).as("planData");

cy.visit("/");

cy.wait("@planData");

cy.get('[data-cy="cookie-btn"]').click();
});

Expand Down Expand Up @@ -176,8 +180,12 @@ describe("Edit, duplicate and delete report", () => {

beforeEach(() => {
cy.restoreLocalStorageCache();
cy.intercept("GET", `${apiUrl}/users/plan-data`).as("planData");

cy.visit("/");

cy.wait("@planData");

cy.get('[data-cy="cookie-btn"]').click();

cy.intercept(`${apiUrl}/reports?filter=*`).as("fetchReports");
Expand Down

0 comments on commit 564f781

Please sign in to comment.