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
path: scripts/cypress-v2/screenshots
retention-days: 2
# cypress-xcdb-restTableOps-run-cache:
# runs-on: ubuntu-20.04
# steps:
# - name: Setup Node
# uses: actions/setup-node@v1
# with:
# node-version: 16.15.0
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
#
# with:
# # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - name: Set env
# run: echo "NODE_ENV=test" >> $GITHUB_ENV
# - name: Cypress run
# uses: cypress-io/github-action@v2
# with:
# start: |
# npm run start:xcdb-api:cache-v2
# npm run start:web-v2
# docker-compose -f ./scripts/docker-compose-cypress.yml up -d
# 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-timeout: 1200
# config-file: scripts/cypress-v2/cypress.json
# - name: Upload screenshots
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: cypress-xcdb-restTableOps-run-cache-snapshots
# path: scripts/cypress-v2/screenshots
# retention-days: 2
# cypress-xcdb-restViews-run-cache:
# runs-on: ubuntu-20.04
# steps:
# - name: Setup Node
# uses: actions/setup-node@v1
# with:
# node-version: 16.15.0
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
#
# with:
# # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - name: Set env
# run: echo "NODE_ENV=test" >> $GITHUB_ENV
# - name: Cypress run
# uses: cypress-io/github-action@v2
# with:
# start: |
# npm run start:xcdb-api:cache-v2
# npm run start:web-v2
# docker-compose -f ./scripts/docker-compose-cypress.yml up -d
# 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-timeout: 1200
# config-file: scripts/cypress-v2/cypress.json
# - name: Upload screenshots
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: cypress-xcdb-restViews-run-cache-snapshots
# path: scripts/cypress-v2/screenshots
# retention-days: 2
cypress-xcdb-restTableOps-run-cache:
runs-on: ubuntu-20.04
steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set env
run: echo "NODE_ENV=test" >> $GITHUB_ENV
- name: Cypress run
uses: cypress-io/github-action@v2
with:
start: |
npm run start:xcdb-api:cache-v2
npm run start:web-v2
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
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-timeout: 1200
config-file: scripts/cypress-v2/cypress.json
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: cypress-xcdb-restTableOps-run-cache-snapshots
path: scripts/cypress-v2/screenshots
retention-days: 2
cypress-xcdb-restViews-run-cache:
runs-on: ubuntu-20.04
steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set env
run: echo "NODE_ENV=test" >> $GITHUB_ENV
- name: Cypress run
uses: cypress-io/github-action@v2
with:
start: |
npm run start:xcdb-api:cache-v2
npm run start:web-v2
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
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-timeout: 1200
config-file: scripts/cypress-v2/cypress.json
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: cypress-xcdb-restViews-run-cache-snapshots
path: scripts/cypress-v2/screenshots
retention-days: 2
cypress-xcdb-restRoles-run-cache:
runs-on: ubuntu-20.04
steps:
@ -370,94 +370,94 @@ jobs:
name: cypress-xcdb-restMisc-run-cache-snapshots
path: scripts/cypress-v2/screenshots
retention-days: 2
# cypress-pg-restTableOps-run-cache:
# runs-on: ubuntu-20.04
# steps:
# - name: Setup Node
# uses: actions/setup-node@v1
# with:
# node-version: 16.15.0
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
#
# with:
# # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - name: Set env
# run: echo "NODE_ENV=test" >> $GITHUB_ENV
# - name: Cypress run
# uses: cypress-io/github-action@v2
# with:
# start: |
# npm run start:api:cache
# npm run start:web-v2
# docker-compose -f ./scripts/cypress-v2/docker-compose-pg.yml up -d
# 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-timeout: 1200
# config-file: scripts/cypress-v2/cypress.json
# - name: Upload screenshots
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: cypress-pg-restTableOps-run-cache-snapshots
# path: scripts/cypress-v2/screenshots
# retention-days: 2
# cypress-pg-restViews-run-cache:
# runs-on: ubuntu-20.04
# steps:
# - name: Setup Node
# uses: actions/setup-node@v1
# with:
# node-version: 16.15.0
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
#
# with:
# # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - name: Set env
# run: echo "NODE_ENV=test" >> $GITHUB_ENV
# - name: Cypress run
# uses: cypress-io/github-action@v2
# with:
# start: |
# npm run start:api:cache
# npm run start:web-v2
# docker-compose -f ./scripts/cypress-v2/docker-compose-pg.yml up -d
# 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-timeout: 1200
# config-file: scripts/cypress-v2/cypress.json
# - name: Upload screenshots
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: cypress-pg-restViews-run-cache-snapshots
# path: scripts/cypress-v2/screenshots
# retention-days: 2
cypress-pg-restTableOps-run-cache:
runs-on: ubuntu-20.04
steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set env
run: echo "NODE_ENV=test" >> $GITHUB_ENV
- name: Cypress run
uses: cypress-io/github-action@v2
with:
start: |
npm run start:api:cache
npm run start:web-v2
docker-compose -f ./scripts/cypress-v2/docker-compose-pg.yml up -d
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-timeout: 1200
config-file: scripts/cypress-v2/cypress.json
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: cypress-pg-restTableOps-run-cache-snapshots
path: scripts/cypress-v2/screenshots
retention-days: 2
cypress-pg-restViews-run-cache:
runs-on: ubuntu-20.04
steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set env
run: echo "NODE_ENV=test" >> $GITHUB_ENV
- name: Cypress run
uses: cypress-io/github-action@v2
with:
start: |
npm run start:api:cache
npm run start:web-v2
docker-compose -f ./scripts/cypress-v2/docker-compose-pg.yml up -d
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-timeout: 1200
config-file: scripts/cypress-v2/cypress.json
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: cypress-pg-restViews-run-cache-snapshots
path: scripts/cypress-v2/screenshots
retention-days: 2
cypress-pg-restRoles-run-cache:
runs-on: ubuntu-20.04
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)
//
before(() => {
cy.fileHook();
if (isXcdb()) {
cy.log(getProjectString());
projPrefix = `${getProjectString()}`;
@ -30,7 +29,6 @@ export const genTest = (apiType, dbType) => {
});
beforeEach(() => {
cy.fileHook();
});
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)
//
before(() => {
cy.fileHook();
mainPage.tabReset();
mainPage.openMetaTab();
});
beforeEach(() => {
});
after(() => {
mainPage.closeMetaTab();
// mainPage.closeMetaTab();
});
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.task("readSheetList", {
file: `./scripts/cypress/fixtures/${filepath}`,
file: `./scripts/cypress-v2/fixtures/${filepath}`,
}).then((rows) => {
cy.log(rows);
sheetList = rows;
});
cy.task("readXlsx", {
file: `./scripts/cypress/fixtures/${filepath}`,
file: `./scripts/cypress-v2/fixtures/${filepath}`,
sheet: "Sheet2",
}).then((rows) => {
cy.log(rows);
@ -90,6 +90,9 @@ export const genTest = (apiType, dbType) => {
// loginPage.signIn(roles.owner.credentials);
projectsPage.createProject({ dbType: "none", apiType: "REST", name: "importSample" }, {})
cy.wait(4000);
cy.saveLocalStorage();
cy.wait(1000);
});
beforeEach(() => {
@ -161,6 +164,8 @@ export const genTest = (apiType, dbType) => {
});
it("File Upload: Verify loaded data", () => {
// wait for page to get loaded (issue observed in CICD)
cy.wait(5000);
cy.openTableTab("Sheet2", 2);
for (const [key, value] of Object.entries(expectedData)) {

Loading…
Cancel
Save