forked from globalfund/data-explorer-client
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from zimmerman-team/feat/DX-1484
feat: DX-1484 Write new test cases to prevent regression [End-to-End]
- Loading branch information
Showing
12 changed files
with
241 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe("Dashboard", () => { | ||
const apiUrl = Cypress.env("api_url"); | ||
beforeEach(() => { | ||
cy.intercept("GET", `${apiUrl}/assets**`).as("fetchAssets"); | ||
cy.intercept("GET", `${apiUrl}/datasets?filter=*`).as("fetchDatasets"); | ||
cy.intercept("GET", `${apiUrl}/charts*`).as("fetchCharts"); | ||
cy.intercept(`${apiUrl}/reports?filter=*`).as("fetchReports"); | ||
|
||
cy.restoreLocalStorageCache(); | ||
cy.visit("/"); | ||
|
||
cy.get('[data-cy="cookie-btn"]').click(); | ||
}); | ||
|
||
it("Can view all asset types on the dashboard", () => { | ||
cy.get('[data-cy="home-all-tab"]').scrollIntoView().click(); | ||
cy.wait("@fetchAssets"); | ||
cy.get('[data-cy="dataset-grid-item"]').should("be.visible"); | ||
cy.get('[data-cy="report-grid-item"]').should("be.visible"); | ||
cy.get('[data-cy="dataset-grid-item"]').should("be.visible"); | ||
}); | ||
|
||
it("Can filter datasets by category", () => { | ||
cy.get('[data-cy="home-data-tab"]').scrollIntoView().click(); | ||
cy.wait("@fetchDatasets"); | ||
|
||
cy.contains('[data-cy="dataset-category-button"]', "Social").click(); | ||
cy.wait("@fetchDatasets"); | ||
|
||
cy.get('[data-cy="dataset-grid-item"]').should( | ||
"have.length.greaterThan", | ||
0 | ||
); | ||
}); | ||
it("Can get to assets from the table view", () => { | ||
cy.get('[data-cy="home-all-tab"]').scrollIntoView().click(); | ||
cy.wait("@fetchAssets"); | ||
|
||
cy.get('[data-cy="home-table-view-button"]').click(); | ||
|
||
cy.get('[data-cy="homepage-table"]').within(() => { | ||
cy.get('[data-cy="table-row-chart"]').first().click(); | ||
}); | ||
|
||
cy.location("pathname").should("include", "/chart/"); | ||
cy.visit("/"); | ||
|
||
cy.get('[data-cy="home-data-tab"]').scrollIntoView().click(); | ||
cy.wait("@fetchDatasets"); | ||
|
||
cy.get('[data-cy="home-table-view-button"]').click(); | ||
|
||
cy.get('[data-cy="homepage-table"]').within(() => { | ||
cy.get('[data-cy="table-row-dataset"]').first().click(); | ||
}); | ||
|
||
cy.location("pathname").should("include", "/dataset/"); | ||
|
||
cy.visit("/"); | ||
|
||
cy.get('[data-cy="home-charts-tab"]').scrollIntoView().click(); | ||
cy.wait("@fetchCharts"); | ||
|
||
cy.get('[data-cy="home-table-view-button"]').click(); | ||
|
||
cy.get('[data-cy="homepage-table"]').within(() => { | ||
cy.get('[data-cy="table-row-chart"]').first().click(); | ||
}); | ||
|
||
cy.location("pathname").should("include", "/chart/"); | ||
|
||
cy.visit("/"); | ||
|
||
cy.get('[data-cy="home-reports-tab"]').scrollIntoView().click(); | ||
cy.wait("@fetchReports"); | ||
|
||
cy.get('[data-cy="home-table-view-button"]').click(); | ||
|
||
cy.get('[data-cy="homepage-table"]').within(() => { | ||
cy.get('[data-cy="table-row-report"]').first().click(); | ||
}); | ||
|
||
cy.location("pathname").should("include", "/report/"); | ||
|
||
cy.visit("/"); | ||
}); | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters