Skip to content

Commit

Permalink
Merge pull request #221 from zimmerman-team/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
okorie2 authored Sep 4, 2024
2 parents e23fe63 + 445c57f commit 9ab32fd
Show file tree
Hide file tree
Showing 595 changed files with 14,207 additions and 77,314 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'yarn'

- name: Install packages
run: yarn install && yarn add "https://github.com/zimmerman-team/rawgraphs-charts.git#3da650c"
run: yarn install && yarn add "https://github.com/zimmerman-team/rawgraphs-charts.git#b86c928"

- name: Build rawgraphs package
run: |
Expand All @@ -71,8 +77,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'yarn'

- name: Install packages
run: yarn install && yarn add "https://github.com/zimmerman-team/rawgraphs-charts.git#3da650c"
run: yarn install && yarn add "https://github.com/zimmerman-team/rawgraphs-charts.git#b86c928"

- name: Build rawgraphs package
run: |
Expand All @@ -90,7 +102,7 @@ jobs:
with:
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
start: npm start
start: yarn start
wait-on: "http://127.0.0.1:3000" # Waits for above
wait-on-timeout: 180
# Records to Cypress Cloud
Expand Down
45 changes: 29 additions & 16 deletions cypress/e2e/1-dx/2-datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,22 @@ describe("Testing connecting data on DX", () => {
cy.visit("/");

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();
});

it("Can filter results by source in the federated search", () => {
cy.intercept(`${apiUrl}/external-sources/search?q=*`).as("getDefaultData");
cy.wait("@getDefaultData").then((interception) => {
cy.wait(2000);
cy.contains('[data-cy="source-category-button"]', "Kaggle").click();
cy.wait("@getDefaultData");
cy.get('[data-cy="external-search-card-Kaggle"]').should(
"have.length.greaterThan",
1
);
});
cy.wait(2000);
cy.contains('[data-cy="source-category-button"]', "Kaggle").click();

cy.contains('[data-cy="source-category-button"]', "WHO").click();
cy.wait("@getDefaultData");
Expand All @@ -48,20 +52,22 @@ describe("Testing connecting data on DX", () => {
});

it("Can import data from External Search", () => {
cy.intercept(`${apiUrl}/external-sources/search?q=*`).as("getDefaultData");

cy.wait("@getDefaultData").then((interception) => {
cy.wait(2000);
cy.contains('[data-cy="source-category-button"]', "Kaggle").click();
cy.wait("@getDefaultData");
cy.get('[data-cy="external-search-card-Kaggle"]').should(
"have.length.greaterThan",
1
);
});

cy.get('[data-cy="open-search-button"]').click();
cy.intercept(`${apiUrl}/external-sources/search?q=world%20population*`).as(
"getDefaultData2"
);
cy.get('[data-cy="filter-search-input"]').type("world population");
cy.intercept(
`${apiUrl}/external-sources/search?q=Exclusive%20breastfeeding*`
).as("getDefaultData2");
cy.wait(2000);
cy.get('[data-cy="filter-search-input"]').type("Exclusive breastfeeding");

cy.wait("@getDefaultData2").then((interception) => {
cy.get('[data-cy="external-search-card-Kaggle"]').should(
Expand Down Expand Up @@ -89,7 +95,7 @@ describe("Testing connecting data on DX", () => {
"{selectall}{backspace}Rawgraphs"
);
cy.get('[data-cy="dataset-metadata-link"]').type(
"{selectall}{backspace}Not available"
"{selectall}{backspace}https://notavailableexternal.com"
);
cy.get('[data-cy="dataset-metadata-category"]').click();
cy.get('[data-value="Social"]').click();
Expand Down Expand Up @@ -158,7 +164,9 @@ describe("Testing connecting data on DX", () => {
"Football Players Data"
);
cy.get('[data-cy="dataset-metadata-source"]').type("Rawgraphs");
cy.get('[data-cy="dataset-metadata-link"]').type("Not available");
cy.get('[data-cy="dataset-metadata-link"]').type(
"https://notavailabledata.com"
);
cy.get('[data-cy="dataset-metadata-category"]').click();
cy.get('[data-value="Social"]').click();
cy.get('[data-cy="dataset-metadata-submit"]').scrollIntoView();
Expand All @@ -185,7 +193,9 @@ describe("Testing connecting data on DX", () => {
"Grossing Movies Data"
);
cy.get('[data-cy="dataset-metadata-source"]').type("Rawgraphs");
cy.get('[data-cy="dataset-metadata-link"]').type("Not available");
cy.get('[data-cy="dataset-metadata-link"]').type(
"https://notavailabledataset.com"
);
cy.get('[data-cy="dataset-metadata-category"]').click();
cy.get('[data-value="Social"]').click();
cy.get('[data-cy="dataset-metadata-submit"]').scrollIntoView();
Expand Down Expand Up @@ -234,7 +244,7 @@ describe("Edit, Delete and Duplicate Dataset", () => {
"{selectall}{backspace} Rawgraphs"
);
cy.get('[data-cy="dataset-metadata-link"]').type(
"{selectall}{backspace} Not available"
"{selectall}{backspace}https://notavailableedit.com"
);
cy.get('[data-cy="dataset-metadata-category"]').click();
cy.get('[data-value="Social"]').click();
Expand Down Expand Up @@ -292,7 +302,8 @@ describe("Edit, Delete and Duplicate Dataset", () => {

it("Can delete dataset", () => {
cy.get("[data-cy=home-search-button]").click();
cy.get("[data-cy=home-search-input]").type("Soccer Players");
cy.wait(2000);
cy.get("[data-cy=filter-search-input]").type("Soccer Players");

cy.wait("@fetchDatasets");

Expand All @@ -319,7 +330,7 @@ describe("Edit, Delete and Duplicate Dataset", () => {
// .should("not.exist");

// cy.get("[data-cy=home-search-button]").click();
// cy.get("[data-cy=home-search-input]").type(
// cy.get("[data-cy=filter-search-input]").type(
// "{selectall}{backspace}Wine Tasting"
// );

Expand Down Expand Up @@ -348,7 +359,8 @@ describe("Edit, Delete and Duplicate Dataset", () => {
// .should("not.exist");

cy.get("[data-cy=home-search-button]").click();
cy.get("[data-cy=home-search-input]").type(
cy.wait(2000);
cy.get("[data-cy=filter-search-input]").type(
`{selectall}{backspace}${testname1}`
);

Expand All @@ -373,7 +385,8 @@ describe("Edit, Delete and Duplicate Dataset", () => {
cy.wait("@fetchDatasets");

cy.get("[data-cy=home-search-button]").click();
cy.get("[data-cy=home-search-input]").type(
cy.wait(2000);
cy.get("[data-cy=filter-search-input]").type(
`{selectall}{backspace}${testname1}`
);
cy.wait("@fetchDatasets");
Expand Down
20 changes: 12 additions & 8 deletions cypress/e2e/1-dx/3-charts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("Testing create chart on DX", () => {

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

cy.intercept("GET", `${apiUrl}/datasets?filter=*`).as("getDatasets");
cy.intercept("GET", `${apiUrl}/datasets?**`).as("getDatasets");
cy.get('[data-cy="home-create-chart-button"]').click();
cy.wait("@getDatasets");

Expand All @@ -37,7 +37,7 @@ describe("Testing create chart on DX", () => {

cy.wait("@getDataset");

cy.contains("Please select data from Dx");
cy.contains("Please select a dataset");

cy.get('[data-cy="toolbox-selected-dataset"]')
.contains("Soccer Players")
Expand Down Expand Up @@ -189,7 +189,7 @@ describe("Testing Ai chart creation", () => {
cy.visit("/");

cy.get('[data-cy="cookie-btn"]').click();
cy.intercept("GET", `${apiUrl}/datasets?filter=*`).as("getDatasets");
cy.intercept("GET", `${apiUrl}/datasets?**`).as("getDatasets");
cy.get('[data-cy="home-create-chart-button"]').click();
cy.wait("@getDatasets");

Expand All @@ -201,7 +201,7 @@ describe("Testing Ai chart creation", () => {

cy.wait("@getDataset");

cy.contains("Please select data from Dx");
cy.contains("Please select a dataset");

cy.get('[data-cy="toolbox-selected-dataset"]')
.contains("Grossing Movies")
Expand Down Expand Up @@ -346,7 +346,8 @@ describe("Edit, duplicate and delete chart", () => {
cy.wait("@fetchCharts");

cy.get("[data-cy=home-search-button]").click();
cy.get("[data-cy=home-search-input]").type(
cy.wait(2000);
cy.get("[data-cy=filter-search-input]").type(
`{selectall}{backspace}${testname1}`
);
cy.wait("@fetchCharts");
Expand All @@ -358,7 +359,8 @@ describe("Edit, duplicate and delete chart", () => {

it("Can Delete a chart", () => {
cy.get("[data-cy=home-search-button]").click();
cy.get("[data-cy=home-search-input]").type(
cy.wait(2000);
cy.get("[data-cy=filter-search-input]").type(
`{selectall}{backspace}${testname1}`
);
cy.wait("@fetchCharts");
Expand All @@ -385,7 +387,8 @@ describe("Edit, duplicate and delete chart", () => {
// .should("not.exist");

cy.get("[data-cy=home-search-button]").click();
cy.get("[data-cy=home-search-input]").type(
cy.wait(2000);
cy.get("[data-cy=filter-search-input]").type(
`{selectall}{backspace}${testname2}`
);
cy.wait("@fetchCharts");
Expand Down Expand Up @@ -413,7 +416,8 @@ describe("Edit, duplicate and delete chart", () => {
// .should("not.exist");

cy.get("[data-cy=home-search-button]").click();
cy.get("[data-cy=home-search-input]").type(
cy.wait(2000);
cy.get("[data-cy=filter-search-input]").type(
`{selectall}{backspace}${testname3}`
);
cy.wait("@fetchCharts");
Expand Down
Loading

0 comments on commit 9ab32fd

Please sign in to comment.