Browse Source

test: enable all suite's, fix flaky excel by introducing delay

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3404/head
Raju Udava 2 years ago
parent
commit
c7d7468342
  1. 352
      .github/workflows/ci-cd-v2.yml
  2. 2
      scripts/cypress-v2/integration/common/1e_meta_sync.js
  3. 6
      scripts/cypress-v2/integration/common/1e_pg_meta_sync.js
  4. 9
      scripts/cypress-v2/integration/common/7a_create_project_from_excel.js

352
.github/workflows/ci-cd-v2.yml

@ -194,94 +194,94 @@ jobs:
name: cypress-restMisc-run-cache-snapshots name: cypress-restMisc-run-cache-snapshots
path: scripts/cypress-v2/screenshots path: scripts/cypress-v2/screenshots
retention-days: 2 retention-days: 2
# cypress-xcdb-restTableOps-run-cache: cypress-xcdb-restTableOps-run-cache:
# runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
# steps: steps:
# - name: Setup Node - name: Setup Node
# uses: actions/setup-node@v1 uses: actions/setup-node@v1
# with: with:
# node-version: 16.15.0 node-version: 16.15.0
# - name: Checkout - name: Checkout
# uses: actions/checkout@v2 uses: actions/checkout@v2
# with: with:
# fetch-depth: 0 fetch-depth: 0
# - name: Cache node modules - name: Cache node modules
# uses: actions/cache@v2 uses: actions/cache@v2
# env: env:
# cache-name: cache-node-modules cache-name: cache-node-modules
#
# with: with:
# # npm cache files are stored in `~/.npm` on Linux/macOS # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: | restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build- ${{ runner.os }}-build-
# ${{ runner.os }}- ${{ runner.os }}-
# - name: Set env - name: Set env
# run: echo "NODE_ENV=test" >> $GITHUB_ENV run: echo "NODE_ENV=test" >> $GITHUB_ENV
# - name: Cypress run - name: Cypress run
# uses: cypress-io/github-action@v2 uses: cypress-io/github-action@v2
# with: with:
# start: | start: |
# npm run start:xcdb-api:cache-v2 npm run start:xcdb-api:cache-v2
# npm run start:web-v2 npm run start:web-v2
# docker-compose -f ./scripts/docker-compose-cypress.yml up -d docker-compose -f ./scripts/docker-compose-cypress.yml up -d
# spec: "./scripts/cypress-v2/integration/test/xcdb-restTableOps.js" spec: "./scripts/cypress-v2/integration/test/xcdb-restTableOps.js"
# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
# wait-on-timeout: 1200 wait-on-timeout: 1200
# config-file: scripts/cypress-v2/cypress.json config-file: scripts/cypress-v2/cypress.json
# - name: Upload screenshots - name: Upload screenshots
# if: always() if: always()
# uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
# with: with:
# name: cypress-xcdb-restTableOps-run-cache-snapshots name: cypress-xcdb-restTableOps-run-cache-snapshots
# path: scripts/cypress-v2/screenshots path: scripts/cypress-v2/screenshots
# retention-days: 2 retention-days: 2
# cypress-xcdb-restViews-run-cache: cypress-xcdb-restViews-run-cache:
# runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
# steps: steps:
# - name: Setup Node - name: Setup Node
# uses: actions/setup-node@v1 uses: actions/setup-node@v1
# with: with:
# node-version: 16.15.0 node-version: 16.15.0
# - name: Checkout - name: Checkout
# uses: actions/checkout@v2 uses: actions/checkout@v2
# with: with:
# fetch-depth: 0 fetch-depth: 0
# - name: Cache node modules - name: Cache node modules
# uses: actions/cache@v2 uses: actions/cache@v2
# env: env:
# cache-name: cache-node-modules cache-name: cache-node-modules
#
# with: with:
# # npm cache files are stored in `~/.npm` on Linux/macOS # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: | restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build- ${{ runner.os }}-build-
# ${{ runner.os }}- ${{ runner.os }}-
# - name: Set env - name: Set env
# run: echo "NODE_ENV=test" >> $GITHUB_ENV run: echo "NODE_ENV=test" >> $GITHUB_ENV
# - name: Cypress run - name: Cypress run
# uses: cypress-io/github-action@v2 uses: cypress-io/github-action@v2
# with: with:
# start: | start: |
# npm run start:xcdb-api:cache-v2 npm run start:xcdb-api:cache-v2
# npm run start:web-v2 npm run start:web-v2
# docker-compose -f ./scripts/docker-compose-cypress.yml up -d docker-compose -f ./scripts/docker-compose-cypress.yml up -d
# spec: "./scripts/cypress-v2/integration/test/xcdb-restViews.js" spec: "./scripts/cypress-v2/integration/test/xcdb-restViews.js"
# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
# wait-on-timeout: 1200 wait-on-timeout: 1200
# config-file: scripts/cypress-v2/cypress.json config-file: scripts/cypress-v2/cypress.json
# - name: Upload screenshots - name: Upload screenshots
# if: always() if: always()
# uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
# with: with:
# name: cypress-xcdb-restViews-run-cache-snapshots name: cypress-xcdb-restViews-run-cache-snapshots
# path: scripts/cypress-v2/screenshots path: scripts/cypress-v2/screenshots
# retention-days: 2 retention-days: 2
cypress-xcdb-restRoles-run-cache: cypress-xcdb-restRoles-run-cache:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
@ -370,94 +370,94 @@ jobs:
name: cypress-xcdb-restMisc-run-cache-snapshots name: cypress-xcdb-restMisc-run-cache-snapshots
path: scripts/cypress-v2/screenshots path: scripts/cypress-v2/screenshots
retention-days: 2 retention-days: 2
# cypress-pg-restTableOps-run-cache: cypress-pg-restTableOps-run-cache:
# runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
# steps: steps:
# - name: Setup Node - name: Setup Node
# uses: actions/setup-node@v1 uses: actions/setup-node@v1
# with: with:
# node-version: 16.15.0 node-version: 16.15.0
# - name: Checkout - name: Checkout
# uses: actions/checkout@v2 uses: actions/checkout@v2
# with: with:
# fetch-depth: 0 fetch-depth: 0
# - name: Cache node modules - name: Cache node modules
# uses: actions/cache@v2 uses: actions/cache@v2
# env: env:
# cache-name: cache-node-modules cache-name: cache-node-modules
#
# with: with:
# # npm cache files are stored in `~/.npm` on Linux/macOS # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: | restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build- ${{ runner.os }}-build-
# ${{ runner.os }}- ${{ runner.os }}-
# - name: Set env - name: Set env
# run: echo "NODE_ENV=test" >> $GITHUB_ENV run: echo "NODE_ENV=test" >> $GITHUB_ENV
# - name: Cypress run - name: Cypress run
# uses: cypress-io/github-action@v2 uses: cypress-io/github-action@v2
# with: with:
# start: | start: |
# npm run start:api:cache npm run start:api:cache
# npm run start:web-v2 npm run start:web-v2
# docker-compose -f ./scripts/cypress-v2/docker-compose-pg.yml up -d docker-compose -f ./scripts/cypress-v2/docker-compose-pg.yml up -d
# spec: "./scripts/cypress-v2/integration/test/pg-restTableOps.js" spec: "./scripts/cypress-v2/integration/test/pg-restTableOps.js"
# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
# wait-on-timeout: 1200 wait-on-timeout: 1200
# config-file: scripts/cypress-v2/cypress.json config-file: scripts/cypress-v2/cypress.json
# - name: Upload screenshots - name: Upload screenshots
# if: always() if: always()
# uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
# with: with:
# name: cypress-pg-restTableOps-run-cache-snapshots name: cypress-pg-restTableOps-run-cache-snapshots
# path: scripts/cypress-v2/screenshots path: scripts/cypress-v2/screenshots
# retention-days: 2 retention-days: 2
# cypress-pg-restViews-run-cache: cypress-pg-restViews-run-cache:
# runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
# steps: steps:
# - name: Setup Node - name: Setup Node
# uses: actions/setup-node@v1 uses: actions/setup-node@v1
# with: with:
# node-version: 16.15.0 node-version: 16.15.0
# - name: Checkout - name: Checkout
# uses: actions/checkout@v2 uses: actions/checkout@v2
# with: with:
# fetch-depth: 0 fetch-depth: 0
# - name: Cache node modules - name: Cache node modules
# uses: actions/cache@v2 uses: actions/cache@v2
# env: env:
# cache-name: cache-node-modules cache-name: cache-node-modules
#
# with: with:
# # npm cache files are stored in `~/.npm` on Linux/macOS # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: | restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build- ${{ runner.os }}-build-
# ${{ runner.os }}- ${{ runner.os }}-
# - name: Set env - name: Set env
# run: echo "NODE_ENV=test" >> $GITHUB_ENV run: echo "NODE_ENV=test" >> $GITHUB_ENV
# - name: Cypress run - name: Cypress run
# uses: cypress-io/github-action@v2 uses: cypress-io/github-action@v2
# with: with:
# start: | start: |
# npm run start:api:cache npm run start:api:cache
# npm run start:web-v2 npm run start:web-v2
# docker-compose -f ./scripts/cypress-v2/docker-compose-pg.yml up -d docker-compose -f ./scripts/cypress-v2/docker-compose-pg.yml up -d
# spec: "./scripts/cypress-v2/integration/test/pg-restViews.js" spec: "./scripts/cypress-v2/integration/test/pg-restViews.js"
# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
# wait-on-timeout: 1200 wait-on-timeout: 1200
# config-file: scripts/cypress-v2/cypress.json config-file: scripts/cypress-v2/cypress.json
# - name: Upload screenshots - name: Upload screenshots
# if: always() if: always()
# uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
# with: with:
# name: cypress-pg-restViews-run-cache-snapshots name: cypress-pg-restViews-run-cache-snapshots
# path: scripts/cypress-v2/screenshots path: scripts/cypress-v2/screenshots
# retention-days: 2 retention-days: 2
cypress-pg-restRoles-run-cache: cypress-pg-restRoles-run-cache:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:

2
scripts/cypress-v2/integration/common/1e_meta_sync.js

@ -18,7 +18,6 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)
// //
before(() => { before(() => {
cy.fileHook();
if (isXcdb()) { if (isXcdb()) {
cy.log(getProjectString()); cy.log(getProjectString());
projPrefix = `${getProjectString()}`; projPrefix = `${getProjectString()}`;
@ -30,7 +29,6 @@ export const genTest = (apiType, dbType) => {
}); });
beforeEach(() => { beforeEach(() => {
cy.fileHook();
}); });
after(() => { after(() => {

6
scripts/cypress-v2/integration/common/1e_pg_meta_sync.js

@ -18,13 +18,15 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)
// //
before(() => { before(() => {
cy.fileHook();
mainPage.tabReset(); mainPage.tabReset();
mainPage.openMetaTab(); mainPage.openMetaTab();
}); });
beforeEach(() => {
});
after(() => { after(() => {
mainPage.closeMetaTab(); // mainPage.closeMetaTab();
}); });
it(`Create table`, () => { it(`Create table`, () => {

9
scripts/cypress-v2/integration/common/7a_create_project_from_excel.js

@ -73,14 +73,14 @@ export const genTest = (apiType, dbType) => {
cy.wait(1000); cy.wait(1000);
cy.task("readSheetList", { cy.task("readSheetList", {
file: `./scripts/cypress/fixtures/${filepath}`, file: `./scripts/cypress-v2/fixtures/${filepath}`,
}).then((rows) => { }).then((rows) => {
cy.log(rows); cy.log(rows);
sheetList = rows; sheetList = rows;
}); });
cy.task("readXlsx", { cy.task("readXlsx", {
file: `./scripts/cypress/fixtures/${filepath}`, file: `./scripts/cypress-v2/fixtures/${filepath}`,
sheet: "Sheet2", sheet: "Sheet2",
}).then((rows) => { }).then((rows) => {
cy.log(rows); cy.log(rows);
@ -90,6 +90,9 @@ export const genTest = (apiType, dbType) => {
// loginPage.signIn(roles.owner.credentials); // loginPage.signIn(roles.owner.credentials);
projectsPage.createProject({ dbType: "none", apiType: "REST", name: "importSample" }, {}) projectsPage.createProject({ dbType: "none", apiType: "REST", name: "importSample" }, {})
cy.wait(4000); cy.wait(4000);
cy.saveLocalStorage();
cy.wait(1000);
}); });
beforeEach(() => { beforeEach(() => {
@ -161,6 +164,8 @@ export const genTest = (apiType, dbType) => {
}); });
it("File Upload: Verify loaded data", () => { it("File Upload: Verify loaded data", () => {
// wait for page to get loaded (issue observed in CICD)
cy.wait(5000);
cy.openTableTab("Sheet2", 2); cy.openTableTab("Sheet2", 2);
for (const [key, value] of Object.entries(expectedData)) { for (const [key, value] of Object.entries(expectedData)) {

Loading…
Cancel
Save