From 58ce61a4dbed809a8d493dd3a0c3dc090daec2aa Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 10:15:38 +0530 Subject: [PATCH 1/9] test(misc): re-alignment & optimizations Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .github/workflows/ci-cd.yml | 1072 ++++++++--------- .../common/6d_language_validation.js | 24 +- .../integration/common/6f_attachments.js | 10 +- .../integration/common/6g_base_share.js | 14 +- .../cypress/integration/common/8a_webhook.js | 3 +- .../cypress/integration/test/pg-restMisc.js | 25 +- scripts/cypress/integration/test/restMisc.js | 22 +- .../cypress/integration/test/xcdb-restMisc.js | 26 +- 8 files changed, 622 insertions(+), 574 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 914a0406b5..cf0f1232d8 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -19,141 +19,141 @@ on: - "packages/nocodb/**" - ".github/workflows/ci-cd.yml" jobs: - cypress-restTableOps-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - docker-compose -f ./scripts/docker-compose-cypress.yml up -d - spec: "./scripts/cypress/integration/test/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/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-restTableOps-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 - cypress-restViews-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - docker-compose -f ./scripts/docker-compose-cypress.yml up -d - spec: "./scripts/cypress/integration/test/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/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-restViews-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 - cypress-restRoles-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - docker-compose -f ./scripts/docker-compose-cypress.yml up -d - spec: "./scripts/cypress/integration/test/restRoles.js" - wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" - wait-on-timeout: 1200 - config-file: scripts/cypress/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-restRoles-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 +# cypress-restTableOps-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# docker-compose -f ./scripts/docker-compose-cypress.yml up -d +# spec: "./scripts/cypress/integration/test/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/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-restTableOps-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 +# cypress-restViews-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# docker-compose -f ./scripts/docker-compose-cypress.yml up -d +# spec: "./scripts/cypress/integration/test/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/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-restViews-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 +# cypress-restRoles-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# docker-compose -f ./scripts/docker-compose-cypress.yml up -d +# spec: "./scripts/cypress/integration/test/restRoles.js" +# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" +# wait-on-timeout: 1200 +# config-file: scripts/cypress/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-restRoles-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 cypress-restMisc-run-cache: runs-on: ubuntu-20.04 if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} @@ -199,141 +199,141 @@ jobs: name: cypress-restMisc-run-cache-snapshots path: scripts/cypress/screenshots retention-days: 2 - cypress-xcdb-restTableOps-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - npm run start:web - docker-compose -f ./scripts/docker-compose-cypress.yml up -d - spec: "./scripts/cypress/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/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-xcdb-restTableOps-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 - cypress-xcdb-restViews-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - npm run start:web - docker-compose -f ./scripts/docker-compose-cypress.yml up -d - spec: "./scripts/cypress/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/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-xcdb-restViews-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 - cypress-xcdb-restRoles-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - npm run start:web - docker-compose -f ./scripts/docker-compose-cypress.yml up -d - spec: "./scripts/cypress/integration/test/xcdb-restRoles.js" - wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" - wait-on-timeout: 1200 - config-file: scripts/cypress/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-xcdb-restRoles-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 +# cypress-xcdb-restTableOps-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# npm run start:web +# docker-compose -f ./scripts/docker-compose-cypress.yml up -d +# spec: "./scripts/cypress/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/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-xcdb-restTableOps-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 +# cypress-xcdb-restViews-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# npm run start:web +# docker-compose -f ./scripts/docker-compose-cypress.yml up -d +# spec: "./scripts/cypress/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/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-xcdb-restViews-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 +# cypress-xcdb-restRoles-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# npm run start:web +# docker-compose -f ./scripts/docker-compose-cypress.yml up -d +# spec: "./scripts/cypress/integration/test/xcdb-restRoles.js" +# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" +# wait-on-timeout: 1200 +# config-file: scripts/cypress/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-xcdb-restRoles-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 cypress-xcdb-restMisc-run-cache: runs-on: ubuntu-20.04 if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} @@ -379,141 +379,141 @@ jobs: name: cypress-xcdb-restMisc-run-cache-snapshots path: scripts/cypress/screenshots retention-days: 2 - cypress-pg-restTableOps-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d - spec: "./scripts/cypress/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/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-pg-restTableOps-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 - cypress-pg-restViews-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d - spec: "./scripts/cypress/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/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-pg-restViews-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 - cypress-pg-restRoles-run-cache: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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 - docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d - spec: "./scripts/cypress/integration/test/pg-restRoles.js" - wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" - wait-on-timeout: 1200 - config-file: scripts/cypress/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cypress-pg-restRoles-run-cache-snapshots - path: scripts/cypress/screenshots - retention-days: 2 +# cypress-pg-restTableOps-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d +# spec: "./scripts/cypress/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/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-pg-restTableOps-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 +# cypress-pg-restViews-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d +# spec: "./scripts/cypress/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/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-pg-restViews-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 +# cypress-pg-restRoles-run-cache: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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 +# docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d +# spec: "./scripts/cypress/integration/test/pg-restRoles.js" +# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" +# wait-on-timeout: 1200 +# config-file: scripts/cypress/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cypress-pg-restRoles-run-cache-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 cypress-pg-restMisc-run-cache: runs-on: ubuntu-20.04 if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} @@ -559,134 +559,134 @@ jobs: name: cypress-pg-restMisc-run-cache-snapshots path: scripts/cypress/screenshots retention-days: 2 - cy-quick-sqlite: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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: | - cp ./scripts/cypress/fixtures/quickTest/noco_0_91_7.db ./packages/nocodb/noco.db - npm run start:api:cache - npm run start:web - docker-compose -f ./scripts/docker-compose-cypress.yml up -d - spec: "./scripts/cypress/integration/test/quickTest.js" - wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" - wait-on-timeout: 1200 - config-file: scripts/cypress/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cy-quick-sqlite-snapshots - path: scripts/cypress/screenshots - retention-days: 2 - cy-quick-pg: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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: | - docker-compose -f ./scripts/cypress/docker-compose-pg-cy-quick.yml up -d - npm run start:api:cache:pg:cyquick - npm run start:web - spec: "./scripts/cypress/integration/test/quickTest.js" - wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" - wait-on-timeout: 1200 - config-file: scripts/cypress/cypress.json - - name: Upload screenshots - if: always() - uses: actions/upload-artifact@v2 - with: - name: cy-quick-pg-snapshots - path: scripts/cypress/screenshots - retention-days: 2 - unit-tests: - runs-on: ubuntu-20.04 - if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} - 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: install dependencies nocodb-sdk - working-directory: ./packages/nocodb-sdk - run: npm install - - name: build nocodb-sdk - working-directory: ./packages/nocodb-sdk - run: npm run build:main - - name: Install dependencies - working-directory: ./packages/nocodb - run: npm install - - name: setup mysql - working-directory: ./ - run: docker-compose -f ./scripts/docker-compose-cypress.yml up -d - - name: run unit tests - working-directory: ./packages/nocodb - run: npm run test:unit \ No newline at end of file +# cy-quick-sqlite: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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: | +# cp ./scripts/cypress/fixtures/quickTest/noco_0_91_7.db ./packages/nocodb/noco.db +# npm run start:api:cache +# npm run start:web +# docker-compose -f ./scripts/docker-compose-cypress.yml up -d +# spec: "./scripts/cypress/integration/test/quickTest.js" +# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" +# wait-on-timeout: 1200 +# config-file: scripts/cypress/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cy-quick-sqlite-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 +# cy-quick-pg: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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: | +# docker-compose -f ./scripts/cypress/docker-compose-pg-cy-quick.yml up -d +# npm run start:api:cache:pg:cyquick +# npm run start:web +# spec: "./scripts/cypress/integration/test/quickTest.js" +# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" +# wait-on-timeout: 1200 +# config-file: scripts/cypress/cypress.json +# - name: Upload screenshots +# if: always() +# uses: actions/upload-artifact@v2 +# with: +# name: cy-quick-pg-snapshots +# path: scripts/cypress/screenshots +# retention-days: 2 +# unit-tests: +# runs-on: ubuntu-20.04 +# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} +# 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: install dependencies nocodb-sdk +# working-directory: ./packages/nocodb-sdk +# run: npm install +# - name: build nocodb-sdk +# working-directory: ./packages/nocodb-sdk +# run: npm run build:main +# - name: Install dependencies +# working-directory: ./packages/nocodb +# run: npm install +# - name: setup mysql +# working-directory: ./ +# run: docker-compose -f ./scripts/docker-compose-cypress.yml up -d +# - name: run unit tests +# working-directory: ./packages/nocodb +# run: npm run test:unit \ No newline at end of file diff --git a/scripts/cypress/integration/common/6d_language_validation.js b/scripts/cypress/integration/common/6d_language_validation.js index d3704f13fd..bb0e0200f6 100644 --- a/scripts/cypress/integration/common/6d_language_validation.js +++ b/scripts/cypress/integration/common/6d_language_validation.js @@ -1,3 +1,5 @@ +import { projectsPage } from "../../support/page_objects/navigation"; + const { mainPage } = require("../../support/page_objects/mainPage"); const { loginPage } = require("../../support/page_objects/navigation"); const { roles } = require("../../support/page_objects/projectConstants"); @@ -22,15 +24,21 @@ export const genTest = (apiType, dbType) => { }); after(() => { - cy.restoreLocalStorage(); - cy.get(".nc-menu-accounts").should("exist").click(); - cy.getActiveMenu(".nc-dropdown-user-accounts-menu") - .find(".ant-dropdown-menu-item") - .eq(1) - .click(); + // // sign out + // // + // cy.restoreLocalStorage(); + // cy.get(".nc-menu-accounts").should("exist").click(); + // cy.getActiveMenu(".nc-dropdown-user-accounts-menu") + // .find(".ant-dropdown-menu-item") + // .eq(1) + // .click(); + // + // cy.wait(5000); + // cy.get('button:contains("SIGN")').should("exist"); + // cy.saveLocalStorage(); - cy.wait(5000); - cy.get('button:contains("SIGN")').should("exist"); + cy.restoreLocalStorage(); + projectsPage.openConfiguredProject(apiType, dbType); cy.saveLocalStorage(); }); diff --git a/scripts/cypress/integration/common/6f_attachments.js b/scripts/cypress/integration/common/6f_attachments.js index 92111e446c..4531575d31 100644 --- a/scripts/cypress/integration/common/6f_attachments.js +++ b/scripts/cypress/integration/common/6f_attachments.js @@ -6,11 +6,9 @@ export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${apiType.toUpperCase()} Columns of type attachment`, () => { - before(() => { - loginPage.loginAndOpenProject(apiType, dbType); - cy.openTableTab("Country", 25); - cy.saveLocalStorage(); - }); + // before(() => { + // // loginPage.loginAndOpenProject(apiType, dbType); + // }); beforeEach(() => { cy.restoreLocalStorage(); @@ -49,6 +47,8 @@ export const genTest = (apiType, dbType) => { }); it(`Add column of type attachments`, () => { + cy.openTableTab("Country", 25); + mainPage.addColumnWithType("testAttach", "Attachment", "Country"); for (let i = 4; i <= 6; i++) { diff --git a/scripts/cypress/integration/common/6g_base_share.js b/scripts/cypress/integration/common/6g_base_share.js index 12d9f1835c..070fd0f1a9 100644 --- a/scripts/cypress/integration/common/6g_base_share.js +++ b/scripts/cypress/integration/common/6g_base_share.js @@ -56,12 +56,12 @@ export const genTest = (apiType, dbType) => { }; describe(`${apiType.toUpperCase()} Base VIEW share`, () => { - before(() => { - // loginPage.loginAndOpenProject(apiType, dbType); - cy.restoreLocalStorage(); - cy.openTableTab("Country", 25); - cy.saveLocalStorage(); - }); + // before(() => { + // // loginPage.loginAndOpenProject(apiType, dbType); + // cy.restoreLocalStorage(); + // cy.openTableTab("Country", 25); + // cy.saveLocalStorage(); + // }); beforeEach(() => { cy.restoreLocalStorage(); @@ -72,6 +72,8 @@ export const genTest = (apiType, dbType) => { }); it(`Generate base share URL`, () => { + cy.openTableTab("Country", 25); + // click SHARE cy.get(".nc-share-base:visible").should("exist").click(); diff --git a/scripts/cypress/integration/common/8a_webhook.js b/scripts/cypress/integration/common/8a_webhook.js index 6716b42c4b..132237a9c6 100644 --- a/scripts/cypress/integration/common/8a_webhook.js +++ b/scripts/cypress/integration/common/8a_webhook.js @@ -246,7 +246,8 @@ export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`Webhook`, () => { before(() => { - loginPage.loginAndOpenProject(apiType, dbType); + // loginPage.loginAndOpenProject(apiType, dbType); + cy.restoreLocalStorage(); cy.createTable("Temp"); cy.saveLocalStorage(); }); diff --git a/scripts/cypress/integration/test/pg-restMisc.js b/scripts/cypress/integration/test/pg-restMisc.js index f4b92d498e..74cfd319c0 100644 --- a/scripts/cypress/integration/test/pg-restMisc.js +++ b/scripts/cypress/integration/test/pg-restMisc.js @@ -14,22 +14,35 @@ const t8a = require("../common/8a_webhook"); const nocoTestSuite = (apiType, dbType) => { setCurrentMode(apiType, dbType); + + // Sakila Ext DB project creation t01.genTest(apiType, dbType); + // Download CSV t6b.genTest(apiType, dbType); - t6d.genTest(apiType, dbType); + + // i18n: language validation suffice to be done in REST MySQL suite + // t6d.genTest(apiType, dbType); + + // Swagger API // exclude@ncv2 t6c.genTest(apiType, dbType); + + // Attachment cell t6f.genTest(apiType, dbType); - t6g.genTest(apiType, dbType); - // webhook tests + // ERD: + // t9b.genTest(apiType, dbType); + + // Webhook tests t8a.genTest(apiType, dbType); - // **deletes created project, hence place it @ end + // Base share (viewer, editor), iFrame tests + t6g.genTest(apiType, dbType); + + // Project operations: Delete t6e.genTest(apiType, dbType); - // intended to keep this after earlier project deletion - // creates project using excel & deletes it + // Create project from Excel t7a.genTest(apiType, dbType); }; diff --git a/scripts/cypress/integration/test/restMisc.js b/scripts/cypress/integration/test/restMisc.js index 704b494943..fae8f97aad 100644 --- a/scripts/cypress/integration/test/restMisc.js +++ b/scripts/cypress/integration/test/restMisc.js @@ -15,25 +15,35 @@ const { const nocoTestSuite = (apiType, dbType) => { setCurrentMode(apiType, dbType); + + // Sakila Ext DB project creation t01.genTest(apiType, dbType); + // Download CSV t6b.genTest(apiType, dbType); + + // i18n t6d.genTest(apiType, dbType); + + // Swagger API // exclude@ncv2 t6c.genTest(apiType, dbType); + + // Attachment cell t6f.genTest(apiType, dbType); + // ERD t9b.genTest(apiType, dbType); - t6g.genTest(apiType, dbType); - - // webhook tests + // Webhook tests t8a.genTest(apiType, dbType); - // **deletes created project, hence place it @ end + // Base share (viewer, editor), iFrame tests + t6g.genTest(apiType, dbType); + + // Project operations: Delete t6e.genTest(apiType, dbType); - // intended to keep this after earlier project deletion - // creates project using excel & deletes it + // Create project from Excel t7a.genTest(apiType, dbType); }; diff --git a/scripts/cypress/integration/test/xcdb-restMisc.js b/scripts/cypress/integration/test/xcdb-restMisc.js index 31b8091486..84096b84ee 100644 --- a/scripts/cypress/integration/test/xcdb-restMisc.js +++ b/scripts/cypress/integration/test/xcdb-restMisc.js @@ -12,25 +12,39 @@ let t8a = require("../common/8a_webhook"); const { setCurrentMode, } = require("../../support/page_objects/projectConstants"); +const t9b = require("../common/9b_ERD"); const nocoTestSuite = (apiType, dbType) => { setCurrentMode(apiType, dbType); + + // Sakila Ext DB project creation t01.genTest(apiType, dbType); + // Download CSV t6b.genTest(apiType, dbType); - t6d.genTest(apiType, dbType); + + // i18n: language validation suffice to be done in REST MySQL suite + // t6d.genTest(apiType, dbType); + + // Swagger API // exclude@ncv2 t6c.genTest(apiType, dbType); + + // Attachment cell t6f.genTest(apiType, dbType); - t6g.genTest(apiType, dbType); - // webhook tests + // ERD: + // t9b.genTest(apiType, dbType); + + // Webhook tests t8a.genTest(apiType, dbType); - // **deletes created project, hence place it @ end + // Base share (viewer, editor), iFrame tests + t6g.genTest(apiType, dbType); + + // Project operations: Delete t6e.genTest(apiType, dbType); - // intended to keep this after earlier project deletion - // creates project using excel & deletes it + // Create project from Excel t7a.genTest(apiType, dbType); }; From a71e22b56cc48cca6cb42dcf6808a138072f7a7f Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 11:02:17 +0530 Subject: [PATCH 2/9] test: add new suite for db-independent tests Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .github/workflows/ci-cd.yml | 47 ++++++++++++++++++- scripts/cypress/cypress.json | 3 +- .../common/6d_language_validation.js | 25 +--------- .../integration/test/db-independent.js | 18 +++++++ scripts/cypress/integration/test/restMisc.js | 5 +- 5 files changed, 70 insertions(+), 28 deletions(-) create mode 100644 scripts/cypress/integration/test/db-independent.js diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index cf0f1232d8..bbee1d08fb 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -689,4 +689,49 @@ jobs: # run: docker-compose -f ./scripts/docker-compose-cypress.yml up -d # - name: run unit tests # working-directory: ./packages/nocodb -# run: npm run test:unit \ No newline at end of file +# run: npm run test:unit + cypress-db-independent: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/integration/test/db-independent.js" + wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" + wait-on-timeout: 1200 + config-file: scripts/cypress/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-restMisc-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 \ No newline at end of file diff --git a/scripts/cypress/cypress.json b/scripts/cypress/cypress.json index 2d162a3676..c916289496 100644 --- a/scripts/cypress/cypress.json +++ b/scripts/cypress/cypress.json @@ -13,7 +13,8 @@ "test/pg-restViews.js", "test/pg-restRoles.js", "test/pg-restMisc.js", - "test/quickTest.js" + "test/quickTest.js", + "test/db-independent.js" ], "defaultCommandTimeout": 13000, "pageLoadTimeout": 600000, diff --git a/scripts/cypress/integration/common/6d_language_validation.js b/scripts/cypress/integration/common/6d_language_validation.js index bb0e0200f6..3268b8d08f 100644 --- a/scripts/cypress/integration/common/6d_language_validation.js +++ b/scripts/cypress/integration/common/6d_language_validation.js @@ -1,8 +1,3 @@ -import { projectsPage } from "../../support/page_objects/navigation"; - -const { mainPage } = require("../../support/page_objects/mainPage"); -const { loginPage } = require("../../support/page_objects/navigation"); -const { roles } = require("../../support/page_objects/projectConstants"); import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; export const genTest = (apiType, dbType) => { @@ -23,24 +18,8 @@ export const genTest = (apiType, dbType) => { cy.saveLocalStorage(); }); - after(() => { - // // sign out - // // - // cy.restoreLocalStorage(); - // cy.get(".nc-menu-accounts").should("exist").click(); - // cy.getActiveMenu(".nc-dropdown-user-accounts-menu") - // .find(".ant-dropdown-menu-item") - // .eq(1) - // .click(); - // - // cy.wait(5000); - // cy.get('button:contains("SIGN")').should("exist"); - // cy.saveLocalStorage(); - - cy.restoreLocalStorage(); - projectsPage.openConfiguredProject(apiType, dbType); - cy.saveLocalStorage(); - }); + // after(() => { + // }); const langVerification = (idx, lang) => { // pick json from the file specified diff --git a/scripts/cypress/integration/test/db-independent.js b/scripts/cypress/integration/test/db-independent.js new file mode 100644 index 0000000000..529d456894 --- /dev/null +++ b/scripts/cypress/integration/test/db-independent.js @@ -0,0 +1,18 @@ +let t6d = require("../common/6d_language_validation"); + +const { + setCurrentMode, +} = require("../../support/page_objects/projectConstants"); +const t01 = require("../common/00_pre_configurations"); + +const nocoTestSuite = (apiType, dbType) => { + setCurrentMode(apiType, dbType); + + // Sakila Ext DB project creation + t01.genTest(apiType, dbType); + + // i18n + t6d.genTest(apiType, dbType); +}; + +nocoTestSuite("rest", "mysql"); diff --git a/scripts/cypress/integration/test/restMisc.js b/scripts/cypress/integration/test/restMisc.js index fae8f97aad..82e02246d5 100644 --- a/scripts/cypress/integration/test/restMisc.js +++ b/scripts/cypress/integration/test/restMisc.js @@ -2,7 +2,6 @@ let t0 = require("./explicitLogin"); let t01 = require("../common/00_pre_configurations"); let t6b = require("../common/6b_downloadCsv"); let t6c = require("../common/6c_swagger_api"); -let t6d = require("../common/6d_language_validation"); let t6e = require("../common/6e_project_operations"); let t6f = require("../common/6f_attachments"); let t6g = require("../common/6g_base_share"); @@ -22,8 +21,8 @@ const nocoTestSuite = (apiType, dbType) => { // Download CSV t6b.genTest(apiType, dbType); - // i18n - t6d.genTest(apiType, dbType); + // // i18n + // t6d.genTest(apiType, dbType); // Swagger API // exclude@ncv2 t6c.genTest(apiType, dbType); From 3b2892b2781613d5b0321f8b4fd19a0ee61c05f4 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 11:22:18 +0530 Subject: [PATCH 3/9] test: login before project operations test Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- scripts/cypress/integration/common/6e_project_operations.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/cypress/integration/common/6e_project_operations.js b/scripts/cypress/integration/common/6e_project_operations.js index 53d1cd6fc6..05182b5497 100644 --- a/scripts/cypress/integration/common/6e_project_operations.js +++ b/scripts/cypress/integration/common/6e_project_operations.js @@ -7,9 +7,8 @@ export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; before(() => { - cy.restoreLocalStorage(); - cy.visit("/"); - cy.wait(4000); + loginPage.loginAndOpenProject(apiType, dbType); + cy.saveLocalStorage(); }); beforeEach(() => { From 8d10790f8d64f532bcd6f152ae313c4755526614 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:27:01 +0530 Subject: [PATCH 4/9] test: fix project operations login Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- scripts/cypress/integration/common/6e_project_operations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cypress/integration/common/6e_project_operations.js b/scripts/cypress/integration/common/6e_project_operations.js index 05182b5497..62c4aacb2f 100644 --- a/scripts/cypress/integration/common/6e_project_operations.js +++ b/scripts/cypress/integration/common/6e_project_operations.js @@ -7,7 +7,7 @@ export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; before(() => { - loginPage.loginAndOpenProject(apiType, dbType); + loginPage.signIn(roles.owner.credentials); cy.saveLocalStorage(); }); From 7c504a316cb498a029cced7123fc4c94ca13d939 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 15:13:13 +0530 Subject: [PATCH 5/9] test(misc): webhook header search, remove wait in openTableTab Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../cypress/integration/common/8a_webhook.js | 25 ++++++------------- scripts/cypress/support/commands.js | 2 +- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/scripts/cypress/integration/common/8a_webhook.js b/scripts/cypress/integration/common/8a_webhook.js index 132237a9c6..fe967ed7ef 100644 --- a/scripts/cypress/integration/common/8a_webhook.js +++ b/scripts/cypress/integration/common/8a_webhook.js @@ -26,24 +26,13 @@ function createWebhook(hook, test) { cy.get(".nc-input-hook-header-key") .should("exist") .click() - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}") - .type("{downarrow}"); - - cy.getActiveSelection(".nc-dropdown-webhook-header") - .find(".ant-select-item-option-content") - .contains("Content-Type") - .should("exist") - .click(); + .type("Content-Type{enter}"); + + // cy.getActiveSelection(".nc-dropdown-webhook-header") + // .find(".ant-select-item-option-content") + // .contains("Content-Type") + // .should("exist") + // .click(); cy.get("input.nc-input-hook-header-value") .should("exist") diff --git a/scripts/cypress/support/commands.js b/scripts/cypress/support/commands.js index a7feb162e2..dcaa541990 100644 --- a/scripts/cypress/support/commands.js +++ b/scripts/cypress/support/commands.js @@ -149,7 +149,7 @@ Cypress.Commands.add("openTableTab", (tn, rc) => { // .contains(tn) // .should('exist') // .click(); - cy.wait(3000); + // cy.wait(3000); cy.get(".xc-row-table.nc-grid").should("exist"); From 0a91770732f6ae73527a2cca9b430b96aa6d2c20 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 16:29:51 +0530 Subject: [PATCH 6/9] test(misc): replace wait with appropriate page load elements Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../integration/common/00_pre_configurations.js | 2 +- .../cypress/integration/common/4e_form_view_share.js | 9 +++++++-- scripts/cypress/integration/common/6f_attachments.js | 12 +++++++++--- scripts/cypress/support/commands.js | 4 ++-- scripts/cypress/support/page_objects/navigation.js | 7 ++++++- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/scripts/cypress/integration/common/00_pre_configurations.js b/scripts/cypress/integration/common/00_pre_configurations.js index 31ce588fd1..fe518936b3 100644 --- a/scripts/cypress/integration/common/00_pre_configurations.js +++ b/scripts/cypress/integration/common/00_pre_configurations.js @@ -187,7 +187,7 @@ export const genTest = (apiType, dbType) => { } } else { projectsPage.createProject(proj.basic, proj.config); - cy.wait(5000); + // cy.wait(5000); if (dbType === "xcdb") { // store base URL- to re-visit and delete form view later let projId; diff --git a/scripts/cypress/integration/common/4e_form_view_share.js b/scripts/cypress/integration/common/4e_form_view_share.js index 07dd7a463b..90a9b304a9 100644 --- a/scripts/cypress/integration/common/4e_form_view_share.js +++ b/scripts/cypress/integration/common/4e_form_view_share.js @@ -92,7 +92,6 @@ export const genTest = (apiType, dbType) => { cy.wait(2000); mainPage.shareView().click(); - // copy link text, visit URL cy.getActiveModal(".nc-modal-share-view") .should("exist") @@ -100,6 +99,11 @@ export const genTest = (apiType, dbType) => { .contains("/nc/form/", { timeout: 10000 }) .should("exist") .then(($obj) => { + // http://localhost:8080/api/v1/db/public/shared-view/761f0200-e72c-487a-85bf-615d0d277054/rows?offset=0&filterArrJson=[]&sortArrJson=[] + cy.intercept("/api/v1/db/public/shared-view/*").as( + "waitForPageLoad" + ); + let linkText = $obj.text().trim(); cy.log(linkText); @@ -108,7 +112,8 @@ export const genTest = (apiType, dbType) => { cy.visit(linkText, { baseUrl: null, }); - cy.wait(5000); + // cy.wait(5000); + cy.wait(["@waitForPageLoad"], { times: 2 }); // wait for share view page to load! diff --git a/scripts/cypress/integration/common/6f_attachments.js b/scripts/cypress/integration/common/6f_attachments.js index 4531575d31..2a76aaf303 100644 --- a/scripts/cypress/integration/common/6f_attachments.js +++ b/scripts/cypress/integration/common/6f_attachments.js @@ -77,7 +77,7 @@ export const genTest = (apiType, dbType) => { mainPage.shareView().click(); - cy.wait(5000); + // cy.wait(5000); // copy link text, visit URL cy.getActiveModal(".nc-modal-share-view") @@ -85,6 +85,10 @@ export const genTest = (apiType, dbType) => { .contains("/nc/form/", { timeout: 10000 }) .should("exist") .then(($obj) => { + cy.intercept("/api/v1/db/public/shared-view/**").as( + "waitForSharedViewLoad" + ); + let linkText = $obj.text().trim(); cy.log(linkText); @@ -93,10 +97,12 @@ export const genTest = (apiType, dbType) => { cy.visit(linkText, { baseUrl: null, }); - cy.wait(5000); + // cy.wait(5000); + cy.wait(["@waitForSharedViewLoad"]); // wait for share view page to load! cy.get(".nc-form").should("exist"); + cy.get("button:contains(Submit)").should("exist"); // fill form // 0: Country @@ -128,7 +134,7 @@ export const genTest = (apiType, dbType) => { // projectsPage.openConfiguredProject(apiType, dbType); cy.openTableTab("Country", 25); - cy.wait(1000); + // cy.wait(1000); mainPage.filterField("testAttach", "is not null", null); mainPage.hideField("LastUpdate"); diff --git a/scripts/cypress/support/commands.js b/scripts/cypress/support/commands.js index dcaa541990..a444fc7e3f 100644 --- a/scripts/cypress/support/commands.js +++ b/scripts/cypress/support/commands.js @@ -480,8 +480,8 @@ Cypress.Commands.add("signOut", () => { .eq(1) .click(); - cy.wait(5000); - cy.get('button:contains("SIGN")').should("exist"); + // cy.wait(5000); + cy.get('button:contains("SIGN IN")').should("exist"); }); // Drag n Drop diff --git a/scripts/cypress/support/page_objects/navigation.js b/scripts/cypress/support/page_objects/navigation.js index 2712f19348..dbc33d53f1 100644 --- a/scripts/cypress/support/page_objects/navigation.js +++ b/scripts/cypress/support/page_objects/navigation.js @@ -97,6 +97,9 @@ export class _projectsPage { // for external database, {databaseType, hostAddress, portNumber, username, password, databaseName} openConfiguredProject(apiType, dbType) { + // http://localhost:8080/api/v1/db/meta/projects/p_kfxgmcd5jpyrje/users?limit=10&offset=0&query= + cy.intercept("/**/users?limit=*&offset=*&query=*").as("waitForPageLoad"); + if (dbType === "mysql") { projectsPage.openProject(staticProjects.externalREST.basic.name); } else if (dbType === "xcdb") { @@ -106,7 +109,9 @@ export class _projectsPage { } // kludge: wait for page load to finish - cy.wait(4000); + // cy.wait(4000); + cy.wait("@waitForPageLoad"); + // close team & auth tab cy.get("button.ant-tabs-tab-remove").should("exist").click(); cy.wait(1000); From 21ea871d364cf38372d8e182d9214a39c38a7247 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 17:01:52 +0530 Subject: [PATCH 7/9] test(ci-cd): enable all tests Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .github/workflows/ci-cd.yml | 1072 +++++++++++++++++------------------ 1 file changed, 536 insertions(+), 536 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index bbee1d08fb..8e3fcaea11 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -19,141 +19,141 @@ on: - "packages/nocodb/**" - ".github/workflows/ci-cd.yml" jobs: -# cypress-restTableOps-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# docker-compose -f ./scripts/docker-compose-cypress.yml up -d -# spec: "./scripts/cypress/integration/test/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/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-restTableOps-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 -# cypress-restViews-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# docker-compose -f ./scripts/docker-compose-cypress.yml up -d -# spec: "./scripts/cypress/integration/test/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/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-restViews-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 -# cypress-restRoles-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# docker-compose -f ./scripts/docker-compose-cypress.yml up -d -# spec: "./scripts/cypress/integration/test/restRoles.js" -# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" -# wait-on-timeout: 1200 -# config-file: scripts/cypress/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-restRoles-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 + cypress-restTableOps-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/integration/test/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/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-restTableOps-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + cypress-restViews-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/integration/test/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/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-restViews-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + cypress-restRoles-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/integration/test/restRoles.js" + wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" + wait-on-timeout: 1200 + config-file: scripts/cypress/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-restRoles-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 cypress-restMisc-run-cache: runs-on: ubuntu-20.04 if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} @@ -199,141 +199,141 @@ jobs: name: cypress-restMisc-run-cache-snapshots path: scripts/cypress/screenshots retention-days: 2 -# cypress-xcdb-restTableOps-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# npm run start:web -# docker-compose -f ./scripts/docker-compose-cypress.yml up -d -# spec: "./scripts/cypress/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/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-xcdb-restTableOps-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 -# cypress-xcdb-restViews-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# npm run start:web -# docker-compose -f ./scripts/docker-compose-cypress.yml up -d -# spec: "./scripts/cypress/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/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-xcdb-restViews-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 -# cypress-xcdb-restRoles-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# npm run start:web -# docker-compose -f ./scripts/docker-compose-cypress.yml up -d -# spec: "./scripts/cypress/integration/test/xcdb-restRoles.js" -# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" -# wait-on-timeout: 1200 -# config-file: scripts/cypress/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-xcdb-restRoles-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 + cypress-xcdb-restTableOps-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + npm run start:web + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/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/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-xcdb-restTableOps-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + cypress-xcdb-restViews-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + npm run start:web + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/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/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-xcdb-restViews-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + cypress-xcdb-restRoles-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + npm run start:web + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/integration/test/xcdb-restRoles.js" + wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" + wait-on-timeout: 1200 + config-file: scripts/cypress/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-xcdb-restRoles-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 cypress-xcdb-restMisc-run-cache: runs-on: ubuntu-20.04 if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} @@ -379,141 +379,141 @@ jobs: name: cypress-xcdb-restMisc-run-cache-snapshots path: scripts/cypress/screenshots retention-days: 2 -# cypress-pg-restTableOps-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d -# spec: "./scripts/cypress/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/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-pg-restTableOps-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 -# cypress-pg-restViews-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d -# spec: "./scripts/cypress/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/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-pg-restViews-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 -# cypress-pg-restRoles-run-cache: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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 -# docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d -# spec: "./scripts/cypress/integration/test/pg-restRoles.js" -# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" -# wait-on-timeout: 1200 -# config-file: scripts/cypress/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cypress-pg-restRoles-run-cache-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 + cypress-pg-restTableOps-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d + spec: "./scripts/cypress/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/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-pg-restTableOps-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + cypress-pg-restViews-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d + spec: "./scripts/cypress/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/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-pg-restViews-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + cypress-pg-restRoles-run-cache: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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 + docker-compose -f ./scripts/cypress/docker-compose-pg.yml up -d + spec: "./scripts/cypress/integration/test/pg-restRoles.js" + wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" + wait-on-timeout: 1200 + config-file: scripts/cypress/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cypress-pg-restRoles-run-cache-snapshots + path: scripts/cypress/screenshots + retention-days: 2 cypress-pg-restMisc-run-cache: runs-on: ubuntu-20.04 if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} @@ -559,137 +559,137 @@ jobs: name: cypress-pg-restMisc-run-cache-snapshots path: scripts/cypress/screenshots retention-days: 2 -# cy-quick-sqlite: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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: | -# cp ./scripts/cypress/fixtures/quickTest/noco_0_91_7.db ./packages/nocodb/noco.db -# npm run start:api:cache -# npm run start:web -# docker-compose -f ./scripts/docker-compose-cypress.yml up -d -# spec: "./scripts/cypress/integration/test/quickTest.js" -# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" -# wait-on-timeout: 1200 -# config-file: scripts/cypress/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cy-quick-sqlite-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 -# cy-quick-pg: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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: | -# docker-compose -f ./scripts/cypress/docker-compose-pg-cy-quick.yml up -d -# npm run start:api:cache:pg:cyquick -# npm run start:web -# spec: "./scripts/cypress/integration/test/quickTest.js" -# wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" -# wait-on-timeout: 1200 -# config-file: scripts/cypress/cypress.json -# - name: Upload screenshots -# if: always() -# uses: actions/upload-artifact@v2 -# with: -# name: cy-quick-pg-snapshots -# path: scripts/cypress/screenshots -# retention-days: 2 -# unit-tests: -# runs-on: ubuntu-20.04 -# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} -# 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: install dependencies nocodb-sdk -# working-directory: ./packages/nocodb-sdk -# run: npm install -# - name: build nocodb-sdk -# working-directory: ./packages/nocodb-sdk -# run: npm run build:main -# - name: Install dependencies -# working-directory: ./packages/nocodb -# run: npm install -# - name: setup mysql -# working-directory: ./ -# run: docker-compose -f ./scripts/docker-compose-cypress.yml up -d -# - name: run unit tests -# working-directory: ./packages/nocodb -# run: npm run test:unit + cy-quick-sqlite: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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: | + cp ./scripts/cypress/fixtures/quickTest/noco_0_91_7.db ./packages/nocodb/noco.db + npm run start:api:cache + npm run start:web + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/integration/test/quickTest.js" + wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" + wait-on-timeout: 1200 + config-file: scripts/cypress/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cy-quick-sqlite-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + cy-quick-pg: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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: | + docker-compose -f ./scripts/cypress/docker-compose-pg-cy-quick.yml up -d + npm run start:api:cache:pg:cyquick + npm run start:web + spec: "./scripts/cypress/integration/test/quickTest.js" + wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png" + wait-on-timeout: 1200 + config-file: scripts/cypress/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cy-quick-pg-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + unit-tests: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + 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: install dependencies nocodb-sdk + working-directory: ./packages/nocodb-sdk + run: npm install + - name: build nocodb-sdk + working-directory: ./packages/nocodb-sdk + run: npm run build:main + - name: Install dependencies + working-directory: ./packages/nocodb + run: npm install + - name: setup mysql + working-directory: ./ + run: docker-compose -f ./scripts/docker-compose-cypress.yml up -d + - name: run unit tests + working-directory: ./packages/nocodb + run: npm run test:unit cypress-db-independent: runs-on: ubuntu-20.04 if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} From 14c25f0dd934838caa9b6035a24c213fa616f454 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 17:39:14 +0530 Subject: [PATCH 8/9] test: correct intercept path Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- scripts/cypress/integration/common/4e_form_view_share.js | 2 +- scripts/cypress/integration/common/4f_grid_view_share.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/cypress/integration/common/4e_form_view_share.js b/scripts/cypress/integration/common/4e_form_view_share.js index 90a9b304a9..ba8bbf6219 100644 --- a/scripts/cypress/integration/common/4e_form_view_share.js +++ b/scripts/cypress/integration/common/4e_form_view_share.js @@ -100,7 +100,7 @@ export const genTest = (apiType, dbType) => { .should("exist") .then(($obj) => { // http://localhost:8080/api/v1/db/public/shared-view/761f0200-e72c-487a-85bf-615d0d277054/rows?offset=0&filterArrJson=[]&sortArrJson=[] - cy.intercept("/api/v1/db/public/shared-view/*").as( + cy.intercept("/api/v1/db/public/shared-view/**").as( "waitForPageLoad" ); diff --git a/scripts/cypress/integration/common/4f_grid_view_share.js b/scripts/cypress/integration/common/4f_grid_view_share.js index b34e276931..b815200d68 100644 --- a/scripts/cypress/integration/common/4f_grid_view_share.js +++ b/scripts/cypress/integration/common/4f_grid_view_share.js @@ -82,7 +82,9 @@ export const genTest = (apiType, dbType) => { }); it(`Share ${viewType.toUpperCase()} hide, sort, filter & verify`, () => { - cy.intercept("/api/v1/db/meta/audits/comments/*").as("waitForPageLoad"); + cy.intercept("/api/v1/db/meta/audits/comments/**").as( + "waitForPageLoad" + ); cy.get(`.nc-view-item.nc-${viewType}-view-item`) .contains("Grid-1") From bdffe0624abfab47065ffbfcea9869119a78f6ce Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 23 Sep 2022 19:03:55 +0530 Subject: [PATCH 9/9] test(misc): add wait for table load Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- scripts/cypress/support/commands.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cypress/support/commands.js b/scripts/cypress/support/commands.js index a444fc7e3f..64251d9554 100644 --- a/scripts/cypress/support/commands.js +++ b/scripts/cypress/support/commands.js @@ -149,7 +149,9 @@ Cypress.Commands.add("openTableTab", (tn, rc) => { // .contains(tn) // .should('exist') // .click(); - // cy.wait(3000); + + // for some tables, linked records are not available immediately + cy.wait(1000); cy.get(".xc-row-table.nc-grid").should("exist");