Browse Source

Merge pull request #4278 from nocodb/cypress-removed

feat(testing): Removed cypress from CI
refactor/ui-updates
Raju Udava 2 years ago committed by GitHub
parent
commit
56f77c0869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 822
      .github/workflows/ci-cd.yml
  2. 127
      .github/workflows/playwright-test-workflow.yml
  3. 2
      package.json
  4. 10
      packages/nc-gui/composables/useApi/index.ts
  5. 14
      packages/nc-gui/composables/useGlobal/state.ts
  6. 2
      packages/nc-gui/lib/constants.ts
  7. 26
      packages/nc-gui/nuxt.config.ts
  8. 3
      packages/nc-gui/package.json
  9. 0
      packages/nc-gui/tests/playwright/.env.example
  10. 0
      packages/nc-gui/tests/playwright/.eslintrc.json
  11. 0
      packages/nc-gui/tests/playwright/.gitignore
  12. 0
      packages/nc-gui/tests/playwright/.lintstagedrc.json
  13. 0
      packages/nc-gui/tests/playwright/.prettierignore
  14. 0
      packages/nc-gui/tests/playwright/.prettierrc.js
  15. 79
      packages/nc-gui/tests/playwright/README.md
  16. 0
      packages/nc-gui/tests/playwright/constants/index.ts
  17. 110
      packages/nc-gui/tests/playwright/fixtures/expectedBaseDownloadData.txt
  18. 110
      packages/nc-gui/tests/playwright/fixtures/expectedBaseDownloadDataPg.txt
  19. 0
      packages/nc-gui/tests/playwright/fixtures/expectedData.txt
  20. 19
      packages/nc-gui/tests/playwright/fixtures/expectedDataSqlite.txt
  21. 0
      packages/nc-gui/tests/playwright/fixtures/sampleFiles/1.json
  22. 0
      packages/nc-gui/tests/playwright/fixtures/sampleFiles/2.json
  23. 0
      packages/nc-gui/tests/playwright/fixtures/sampleFiles/3.json
  24. 0
      packages/nc-gui/tests/playwright/fixtures/sampleFiles/4.json
  25. 0
      packages/nc-gui/tests/playwright/fixtures/sampleFiles/5.json
  26. 0
      packages/nc-gui/tests/playwright/fixtures/sampleFiles/6.json
  27. 0
      packages/nc-gui/tests/playwright/fixtures/sampleFiles/simple.xlsx
  28. 0
      packages/nc-gui/tests/playwright/fixtures/template.spec.ts
  29. 267
      packages/nc-gui/tests/playwright/package-lock.json
  30. 13
      packages/nc-gui/tests/playwright/package.json
  31. 0
      packages/nc-gui/tests/playwright/pages/Base.ts
  32. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/ExpandedForm/index.ts
  33. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Form/index.ts
  34. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Gallery/index.ts
  35. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts
  36. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Grid/Column/LTAR/LinkRecord.ts
  37. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Grid/Column/SelectOptionColumn.ts
  38. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Grid/Column/index.ts
  39. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Grid/index.ts
  40. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Import/Airtable.ts
  41. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Import/ImportTemplate.ts
  42. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Kanban/index.ts
  43. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Acl.ts
  44. 15
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/AppStore.ts
  45. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Audit.ts
  46. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Erd.ts
  47. 25
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Metadata.ts
  48. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts
  49. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Teams.ts
  50. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/index.ts
  51. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/SurveyForm/index.ts
  52. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/TreeView.ts
  53. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/ViewSidebar/index.ts
  54. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/WebhookForm/index.ts
  55. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts
  56. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/CheckboxCell.ts
  57. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts
  58. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts
  59. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/index.ts
  60. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/ProjectMenu/index.ts
  61. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Actions/Erd.ts
  62. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Actions/index.ts
  63. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/AddEditKanbanStack.ts
  64. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Fields.ts
  65. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts
  66. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/ShareView.ts
  67. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Sort.ts
  68. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/StackBy.ts
  69. 5
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts
  70. 4
      packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/index.ts
  71. 0
      packages/nc-gui/tests/playwright/pages/Dashboard/commonBase/Erd.ts
  72. 3
      packages/nc-gui/tests/playwright/pages/Dashboard/index.ts
  73. 0
      packages/nc-gui/tests/playwright/pages/LoginPage/index.ts
  74. 20
      packages/nc-gui/tests/playwright/pages/ProjectsPage/index.ts
  75. 0
      packages/nc-gui/tests/playwright/pages/SharedForm/index.ts
  76. 0
      packages/nc-gui/tests/playwright/pages/SignupPage/index.ts
  77. 0
      packages/nc-gui/tests/playwright/playwright.config.ts
  78. 4
      packages/nc-gui/tests/playwright/quickTests/commonTest.ts
  79. 0
      packages/nc-gui/tests/playwright/quickTests/quickTests.spec.ts
  80. 2
      packages/nc-gui/tests/playwright/scripts/docker-compose-mysql-playwright.yml
  81. 2
      packages/nc-gui/tests/playwright/scripts/docker-compose-pg-pw-quick.yml
  82. 2
      packages/nc-gui/tests/playwright/scripts/docker-compose-pg.yml
  83. 15
      packages/nc-gui/tests/playwright/scripts/docker-compose-playwright-pg.yml
  84. 38
      packages/nc-gui/tests/playwright/setup/db.ts
  85. 25
      packages/nc-gui/tests/playwright/setup/index.ts
  86. 0
      packages/nc-gui/tests/playwright/setup/server.ts
  87. 0
      packages/nc-gui/tests/playwright/setup/sqliteExec.ts
  88. 0
      packages/nc-gui/tests/playwright/startPlayWrightServer.sh
  89. 0
      packages/nc-gui/tests/playwright/storageState.json
  90. 0
      packages/nc-gui/tests/playwright/tests/01-webhook.spec.ts
  91. 0
      packages/nc-gui/tests/playwright/tests/authChangePassword.spec.ts
  92. 5
      packages/nc-gui/tests/playwright/tests/baseShare.spec.ts
  93. 0
      packages/nc-gui/tests/playwright/tests/columnAttachments.spec.ts
  94. 0
      packages/nc-gui/tests/playwright/tests/columnDuration.spec.ts
  95. 14
      packages/nc-gui/tests/playwright/tests/columnFormula.spec.ts
  96. 0
      packages/nc-gui/tests/playwright/tests/columnLinkToAnotherRecord.spec.ts
  97. 0
      packages/nc-gui/tests/playwright/tests/columnLookupRollup.spec.ts
  98. 0
      packages/nc-gui/tests/playwright/tests/columnMultiSelect.spec.ts
  99. 1
      packages/nc-gui/tests/playwright/tests/columnRelationalExtendedTests.spec.ts
  100. 0
      packages/nc-gui/tests/playwright/tests/columnSingleSelect.spec.ts
  101. Some files were not shown because too many files have changed in this diff Show More

822
.github/workflows/ci-cd.yml

@ -25,651 +25,6 @@ concurrency:
cancel-in-progress: true
jobs:
cypress-restTableOps-run-cache:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/cypress/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@v3
with:
name: cypress-restTableOps-run-cache-snapshots
path: scripts/cypress/screenshots
retention-days: 2
cypress-restViews-run-cache:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/cypress/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@v3
with:
name: cypress-restViews-run-cache-snapshots
path: scripts/cypress/screenshots
retention-days: 2
cypress-restRoles-run-cache:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/cypress/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@v3
with:
name: cypress-restRoles-run-cache-snapshots
path: scripts/cypress/screenshots
retention-days: 2
cypress-restMisc-run-cache:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/restMisc.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@v3
with:
name: cypress-restMisc-run-cache-snapshots
path: scripts/cypress/screenshots
retention-days: 2
cypress-xcdb-restTableOps-run-cache:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:xcdb-api:cache
npm run start:web
docker-compose -f ./scripts/cypress/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@v3
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
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:xcdb-api:cache
npm run start:web
docker-compose -f ./scripts/cypress/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@v3
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
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:xcdb-api:cache
npm run start:web
docker-compose -f ./scripts/cypress/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@v3
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
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:xcdb-api:cache
npm run start:web
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/xcdb-restMisc.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@v3
with:
name: cypress-xcdb-restMisc-run-cache-snapshots
path: scripts/cypress/screenshots
retention-days: 2
cypress-pg-restTableOps-run-cache:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
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@v3
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
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
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@v3
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
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
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@v3
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
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
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-restMisc.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@v3
with:
name: cypress-pg-restMisc-run-cache-snapshots
path: scripts/cypress/screenshots
retention-days: 2
cy-quick-sqlite:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
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/cypress/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@v3
with:
name: cy-quick-sqlite-snapshots
path: scripts/cypress/screenshots
retention-days: 2
cy-quick-pg:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
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@v3
with:
name: cy-quick-pg-snapshots
path: scripts/cypress/screenshots
retention-days: 2
unit-tests:
runs-on: ubuntu-20.04
timeout-minutes: 30
@ -711,144 +66,39 @@ jobs:
- name: run unit tests
working-directory: ./packages/nocodb
run: npm run test:unit
cypress-db-independent:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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@v4
with:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/cypress/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@v3
with:
name: cypress-restMisc-run-cache-snapshots
path: scripts/cypress/screenshots
retention-days: 2
playwright:
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
# Reference: https://github.com/pierotofy/set-swap-space/blob/master/action.yml
- name: Set 5gb swap
shell: bash
# Delete the swap file, allocate a new one, and activate it
run: |
export SWAP_FILE=$(swapon --show=NAME | tail -n 1)
sudo swapoff $SWAP_FILE
sudo rm $SWAP_FILE
sudo fallocate -l 5G $SWAP_FILE
sudo chmod 600 $SWAP_FILE
sudo mkswap $SWAP_FILE
sudo swapon $SWAP_FILE
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
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
- name: Install dependencies
working-directory: ./packages/nocodb
run: npm install
- name: setup mysql
working-directory: ./
run: docker-compose -f ./scripts/playwright/scripts/docker-compose-playwright.yml up -d &
- name: run frontend
run: npm run start:web &
- name: Run backend
working-directory: ./packages/nocodb
run: npm run watch:run:playwright > mysql_test_backend.log &
- name: Cache playwright npm modules
uses: actions/cache@v3
id: playwright-cache
with:
path: |
**/playwright/node_modules
key: cache-playwright-${{ hashFiles('**/playwright/package-lock.json') }}
- name: Install dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ./scripts/playwright
run: npm install
- name: Install Playwright Browsers
working-directory: ./scripts/playwright
run: npx playwright install chromium --with-deps
- name: Wait for frontend
run: |
while ! curl --output /dev/null --silent --head --fail http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png; do
printf '.'
sleep 2
done
- name: Wait for backend
run: |
while ! curl --output /dev/null --silent --head --fail http://localhost:8080; do
printf '.'
sleep 2
done
- name: Run Playwright tests
working-directory: ./scripts/playwright
run: npm run ci:test:mysql
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ./scripts/playwright/playwright-report/
retention-days: 2
- uses: actions/upload-artifact@v3
if: always()
with:
name: backend logs
path: ./packages/nocodb/mysql_test_backend.log
retention-days: 2
playwright-mysql-1:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: mysql
shard: 1
playwright-mysql-2:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: mysql
shard: 2
playwright-sqlite-1:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
shard: 1
playwright-sqlite-2:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
shard: 2
playwright-pg-shard-1:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: pg
shard: 1
playwright-pg-shard-2:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: pg
shard: 2

127
.github/workflows/playwright-test-workflow.yml

@ -0,0 +1,127 @@
name: Playwright test reusable workflow
on:
workflow_call:
inputs:
shard:
description: 'Shard number'
required: true
type: string
db:
required: true
type: string
jobs:
playwright:
runs-on: ubuntu-20.04
steps:
# Reference: https://github.com/pierotofy/set-swap-space/blob/master/action.yml
- name: Set 5gb swap
shell: bash
# Delete the swap file, allocate a new one, and activate it
run: |
export SWAP_FILE=$(swapon --show=NAME | tail -n 1)
sudo swapoff $SWAP_FILE
sudo rm $SWAP_FILE
sudo fallocate -l 5G $SWAP_FILE
sudo chmod 600 $SWAP_FILE
sudo mkswap $SWAP_FILE
sudo swapon $SWAP_FILE
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
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
- name: setup mysql
if: ${{ inputs.db == 'mysql' }}
working-directory: ./
run: docker-compose -f ./packages/nc-gui/tests/playwright/scripts/docker-compose-mysql-playwright.yml up -d &
- name: setup pg
if: ${{ inputs.db == 'pg' }}
working-directory: ./
run: docker-compose -f ./packages/nc-gui/tests/playwright/scripts/docker-compose-playwright-pg.yml up -d &
- name: setup pg for quick tests
if: ${{ inputs.db == 'sqlite' && inputs.shard == '1' }}
working-directory: ./
run: docker-compose -f ./packages/nc-gui/tests/playwright/scripts/docker-compose-pg-pw-quick.yml up -d &
- name: run frontend
working-directory: ./packages/nc-gui
run: npm run ci:run
- name: Run backend
working-directory: ./packages/nocodb
run: npm run ci:run &
- name: Cache playwright npm modules
uses: actions/cache@v3
id: playwright-cache
with:
path: |
**/playwright/node_modules
key: cache-nc-playwright-${{ hashFiles('**/playwright/package-lock.json') }}
- name: Install dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ./packages/nc-gui/tests/playwright
run: npm install
- name: Install Playwright Browsers
working-directory: ./packages/nc-gui/tests/playwright
run: npx playwright install chromium --with-deps
- name: Wait for backend
run: |
while ! curl --output /dev/null --silent --head --fail http://localhost:8080; do
printf '.'
sleep 2
done
- name: Run Playwright tests
working-directory: ./packages/nc-gui/tests/playwright
run: E2E_DB_TYPE=${{ inputs.db }} npm run ci:test:shard:${{ inputs.shard }}
# Quick tests (pg on sqlite shard 0 and sqlite on sqlite shard 1)
- name: Run quick server and tests (pg)
if: ${{ inputs.db == 'sqlite' && inputs.shard == '1' }}
working-directory: ./packages/nocodb
run: |
kill -9 $(lsof -t -i:8080)
npm run watch:run:playwright:pg:cyquick &
cd ../nc-gui/tests/playwright
npm run test:quick
- name: Run quick server and tests (sqlite)
if: ${{ inputs.db == 'sqlite' && inputs.shard == '2' }}
working-directory: ./packages/nocodb
run: |
kill -9 $(lsof -t -i:8080)
npm run watch:run:playwright:quick &
cd ../nc-gui/tests/playwright
npm run test:quick
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report-${{ inputs.db }}-${{ inputs.shard }}
path: ./packages/nc-gui/tests/playwright/playwright-report/
retention-days: 2
- uses: actions/upload-artifact@v3
if: always()
with:
name: backend-logs-${{ inputs.db }}-${{ inputs.shard }}
path: ./packages/nocodb/mysql_test_backend.log
retention-days: 2

2
package.json

@ -36,7 +36,7 @@
]
},
"scripts": {
"lint:staged:playwright": "cd scripts/playwright; npx lint-staged; cd ..",
"lint:staged:playwright": "cd packages/nc-gui/tests/playwright; npx lint-staged; cd -",
"build:common": "cd ./packages/nocodb-sdk; npm install; npm run build",
"install:common": "cd ./packages/nocodb; npm install ../nocodb-sdk; cd ../nc-gui; npm install ../nocodb-sdk",
"start:api": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk; npm install; NC_DISABLE_CACHE=true NC_DISABLE_TELE=true npm run watch:run:cypress",

10
packages/nc-gui/composables/useApi/index.ts

@ -3,14 +3,16 @@ import { Api } from 'nocodb-sdk'
import type { Ref } from 'vue'
import type { CreateApiOptions, UseApiProps, UseApiReturn } from './types'
import { addAxiosInterceptors } from './interceptors'
import { BASE_URL, createEventHook, extractSdkResponseErrorMsg, ref, unref, useCounter, useGlobal, useNuxtApp } from '#imports'
import { BASE_FALLBACK_URL, createEventHook, extractSdkResponseErrorMsg, ref, unref, useCounter, useNuxtApp } from '#imports'
export function createApiInstance<SecurityDataType = any>({ baseURL = BASE_URL }: CreateApiOptions = {}): Api<SecurityDataType> {
const { appInfo } = $(useGlobal())
export function createApiInstance<SecurityDataType = any>({
baseURL = BASE_FALLBACK_URL,
}: CreateApiOptions = {}): Api<SecurityDataType> {
const config = useRuntimeConfig()
return addAxiosInterceptors(
new Api<SecurityDataType>({
baseURL: baseURL ?? appInfo.ncSiteUrl,
baseURL: config.public.ncBackendUrl || baseURL,
}),
)
}

14
packages/nc-gui/composables/useGlobal/state.ts

@ -1,7 +1,17 @@
import { useStorage } from '@vueuse/core'
import type { JwtPayload } from 'jwt-decode'
import type { AppInfo, State, StoredState } from './types'
import { BASE_URL, computed, ref, toRefs, useCounter, useJwt, useNuxtApp, usePreferredLanguages, useTimestamp } from '#imports'
import {
BASE_FALLBACK_URL,
computed,
ref,
toRefs,
useCounter,
useJwt,
useNuxtApp,
usePreferredLanguages,
useTimestamp,
} from '#imports'
import type { Language, User } from '~/lib'
export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
@ -75,7 +85,7 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
})
const appInfo = ref<AppInfo>({
ncSiteUrl: BASE_URL,
ncSiteUrl: BASE_FALLBACK_URL,
authType: 'jwt',
connectToExternalDB: false,
defaultLimit: 0,

2
packages/nc-gui/lib/constants.ts

@ -4,7 +4,7 @@ export const NOCO = 'noco'
export const SYSTEM_COLUMNS = ['id', 'title', 'created_at', 'updated_at']
export const BASE_URL = import.meta.env.NC_BACKEND_URL || (process.env.NODE_ENV === 'production' ? '..' : 'http://localhost:8080')
export const BASE_FALLBACK_URL = process.env.NODE_ENV === 'production' ? '..' : 'http://localhost:8080'
/**
* Each permission value means the following
* `*` - which is wildcard, means all permissions are allowed

26
packages/nc-gui/nuxt.config.ts

@ -14,14 +14,18 @@ export default defineNuxtConfig({
ssr: false,
app: {
pageTransition: {
name: 'page',
mode: 'out-in',
},
layoutTransition: {
name: 'layout',
mode: 'out-in',
},
pageTransition: process.env.NUXT_PAGE_TRANSITION_DISABLE
? false
: {
name: 'page',
mode: 'out-in',
},
layoutTransition: process.env.NUXT_PAGE_TRANSITION_DISABLE
? false
: {
name: 'layout',
mode: 'out-in',
},
/** In production build we need to load assets using relative path, to achieve the result we are using cdnURL */
cdnURL: process.env.NODE_ENV === 'production' ? '.' : undefined,
@ -35,6 +39,12 @@ export default defineNuxtConfig({
'~/assets/style.scss',
],
runtimeConfig: {
public: {
ncBackendUrl: '',
},
},
meta: {
title: 'NocoDB',
link: [

3
packages/nc-gui/package.json

@ -27,7 +27,8 @@
"coverage": "vitest -c test/vite.config.ts run --coverage",
"build:copy": "npm run generate; rm -rf ../nc-lib-gui/lib/dist/; rsync -rvzh ./dist/ ../nc-lib-gui/lib/dist/",
"build:copy:publish": "npm run generate; rm -rf ../nc-lib-gui/lib/dist/; rsync -rvzh ./dist/ ../nc-lib-gui/lib/dist/; npm publish ../nc-lib-gui",
"postinstall": "node scripts/updateNuxtRouting.js"
"postinstall": "node scripts/updateNuxtRouting.js",
"ci:run": "export NODE_OPTIONS=\"--max_old_space_size=16384\"; npm install; NUXT_PAGE_TRANSITION_DISABLE=true npm run build; NUXT_PUBLIC_NC_BACKEND_URL=http://localhost:8080 npm run start &"
},
"dependencies": {
"@ckpack/vue-color": "^1.2.0",

0
scripts/playwright/.env.example → packages/nc-gui/tests/playwright/.env.example

0
scripts/playwright/.eslintrc.json → packages/nc-gui/tests/playwright/.eslintrc.json

0
scripts/playwright/.gitignore → packages/nc-gui/tests/playwright/.gitignore vendored

0
scripts/playwright/.lintstagedrc.json → packages/nc-gui/tests/playwright/.lintstagedrc.json

0
scripts/playwright/.prettierignore → packages/nc-gui/tests/playwright/.prettierignore

0
scripts/playwright/.prettierrc.js → packages/nc-gui/tests/playwright/.prettierrc.js

79
packages/nc-gui/tests/playwright/README.md

@ -0,0 +1,79 @@
# Playwright E2E tests
## Setup
Make sure to install the dependencies(in the playwright folder):
```bash
npm install
npx playwright install chromium --with-deps
```
## Run Test Server
Start the backend test server (in `packages/nocodb` folder):
```bash
npm run watch:run:playwright:quick
```
Start the frontend test server (in `packages/nc-gui` folder):
```bash
NUXT_PAGE_TRANSITION_DISABLE=true npm run dev
```
## Running Tests
### Running all tests
For selecting db type, rename `.env.example` to `.env` and set `E2E_DEV_DB_TYPE` to `sqlite`(default), `mysql` or `pg`.
```bash
npm run test
```
### Running individual tests
Add `.only` to the test you want to run:
```js
test.only('should login', async ({ page }) => {
// ...
})
```
```bash
npm run test
```
## Developing tests
### WebStorm
In Webstorm, you can use the `test-debug` run action to run the tests.
Add `.only` to the test you want to run. This will open the test in a chromium session and you can also add break points.
i.e `test.only('should login', async ({ page }) => {`
### VSCode
In VSCode, use this [https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chromium](extension).
It will have run button beside each test in the file.
### Page Objects
Page object is a class which has methods to interact with a page/component. Methods should be thin and should not do a whole lot. They should also be reusable.
All the action methods i.e click of a page object is also responsible for waiting till the action is completed. This can be done by waiting on an API call or some ui change.
Do not add any logic to the tests. Instead, create a page object for the page you are testing.
All the selection, UI actions and assertions should be in the page object.
Page objects should be in `packages/nc-gui/tests/playwright/pages` folder.
### Verify if tests are not flaky
Add `.only` to the added test and run `npm run test:repeat`. This will run the test multiple times and should show if the test is flaky.

0
scripts/playwright/constants/index.ts → packages/nc-gui/tests/playwright/constants/index.ts

110
packages/nc-gui/tests/playwright/fixtures/expectedBaseDownloadData.txt

@ -0,0 +1,110 @@
Country,City List
Afghanistan,Kabul
Algeria,"Batna, Bchar, Skikda"
American Samoa,Tafuna
Angola,"Benguela, Namibe"
Anguilla,South Hill
Argentina,"Almirante Brown, Avellaneda, Baha Blanca, Crdoba, Escobar, Ezeiza, La Plata, Merlo, Quilmes, San Miguel de Tucumn, Santa F, Tandil, Vicente Lpez"
Armenia,Yerevan
Australia,Woodridge
Austria,"Graz, Linz, Salzburg"
Azerbaijan,"Baku, Sumqayit"
Bahrain,al-Manama
Bangladesh,"Dhaka, Jamalpur, Tangail"
Belarus,"Mogiljov, Molodetno"
Bolivia,"El Alto, Sucre"
Brazil,"Alvorada, Angra dos Reis, Anpolis, Aparecida de Goinia, Araatuba, Bag, Belm, Blumenau, Boa Vista, Braslia, Goinia, Guaruj, guas Lindas de Gois, Ibirit, Juazeiro do Norte, Juiz de Fora, Luzinia, Maring, Po, Poos de Caldas, Rio Claro, Santa Brbara dOeste, Santo Andr, So Bernardo do Campo, So Leopoldo"
Brunei,Bandar Seri Begawan
Bulgaria,"Ruse, Stara Zagora"
Cambodia,"Battambang, Phnom Penh"
Cameroon,"Bamenda, Yaound"
Canada,"Gatineau, Halifax, Lethbridge, London, Oshawa, Richmond Hill, Vancouver"
Chad,NDjamna
Chile,"Antofagasta, Coquimbo, Rancagua"
China,"Baicheng, Baiyin, Binzhou, Changzhou, Datong, Daxian, Dongying, Emeishan, Enshi, Ezhou, Fuyu, Fuzhou, Haining, Hami, Hohhot, Huaian, Jinchang, Jining, Jinzhou, Junan, Korla, Laiwu, Laohekou, Lengshuijiang, Leshan"
Colombia,"Buenaventura, Dos Quebradas, Florencia, Pereira, Sincelejo, Sogamoso"
"Congo, The Democratic Republic of the","Lubumbashi, Mwene-Ditu"
Czech Republic,Olomouc
Dominican Republic,"La Romana, San Felipe de Puerto Plata, Santiago de los Caballeros"
Ecuador,"Loja, Portoviejo, Robamba"
Egypt,"Bilbays, Idfu, Mit Ghamr, Qalyub, Sawhaj, Shubra al-Khayma"
Estonia,Tartu
Ethiopia,Addis Abeba
Faroe Islands,Trshavn
Finland,Oulu
France,"Brest, Le Mans, Toulon, Toulouse"
French Guiana,Cayenne
French Polynesia,"Faaa, Papeete"
Gambia,Banjul
Germany,"Duisburg, Erlangen, Halle/Saale, Mannheim, Saarbrcken, Siegen, Witten"
Greece,"Athenai, Patras"
Greenland,Nuuk
Holy See (Vatican City State),Citt del Vaticano
Hong Kong,Kowloon and New Kowloon
Hungary,Szkesfehrvr
India,"Adoni, Ahmadnagar, Allappuzha (Alleppey), Ambattur, Amroha, Balurghat, Berhampore (Baharampur), Bhavnagar, Bhilwara, Bhimavaram, Bhopal, Bhusawal, Bijapur, Chandrapur, Chapra, Dhule (Dhulia), Etawah, Firozabad, Gandhinagar, Gulbarga, Haldia, Halisahar, Hoshiarpur, Hubli-Dharwad, Jaipur"
Indonesia,"Cianjur, Ciomas, Ciparay, Gorontalo, Jakarta, Lhokseumawe, Madiun, Pangkal Pinang, Pemalang, Pontianak, Probolinggo, Purwakarta, Surakarta, Tegal"
Iran,"Arak, Esfahan, Kermanshah, Najafabad, Qomsheh, Shahr-e Kord, Sirjan, Tabriz"
Iraq,Mosul
Israel,"Ashdod, Ashqelon, Bat Yam, Tel Aviv-Jaffa"
Italy,"Alessandria, Bergamo, Brescia, Brindisi, Livorno, Syrakusa, Udine"
Japan,"Akishima, Fukuyama, Higashiosaka, Hino, Hiroshima, Isesaki, Iwaki, Iwakuni, Iwatsuki, Izumisano, Kakamigahara, Kamakura, Kanazawa, Koriyama, Kurashiki, Kuwana, Matsue, Miyakonojo, Nagareyama, Okayama, Okinawa, Omiya, Onomichi, Otsu, Sagamihara"
Kazakstan,"Pavlodar, Zhezqazghan"
Kenya,"Kisumu, Nyeri"
Kuwait,Jalib al-Shuyukh
Latvia,"Daugavpils, Liepaja"
Liechtenstein,Vaduz
Lithuania,Vilnius
Madagascar,Mahajanga
Malawi,Lilongwe
Malaysia,"Ipoh, Kuching, Sungai Petani"
Mexico,"Acua, Allende, Atlixco, Carmen, Celaya, Coacalco de Berriozbal, Coatzacoalcos, Cuauhtmoc, Cuautla, Cuernavaca, El Fuerte, Guadalajara, Hidalgo, Huejutla de Reyes, Huixquilucan, Jos Azueta, Jurez, La Paz, Matamoros, Mexicali, Monclova, Nezahualcyotl, Pachuca de Soto, Salamanca, San Felipe del Progreso"
Moldova,Chisinau
Morocco,"Beni-Mellal, Nador, Sal"
Mozambique,"Beira, Naala-Porto, Tete"
Myanmar,"Monywa, Myingyan"
Nauru,Yangor
Nepal,Birgunj
Netherlands,"Amersfoort, Apeldoorn, Ede, Emmen, s-Hertogenbosch"
New Zealand,Hamilton
Nigeria,"Benin City, Deba Habe, Effon-Alaiye, Ife, Ikerre, Ilorin, Kaduna, Ogbomosho, Ondo, Owo, Oyo, Sokoto, Zaria"
North Korea,Pyongyang
Oman,"Masqat, Salala"
Pakistan,"Dadu, Mandi Bahauddin, Mardan, Okara, Shikarpur"
Paraguay,"Asuncin, Ciudad del Este, San Lorenzo"
Peru,"Callao, Hunuco, Lima, Sullana"
Philippines,"Baybay, Bayugan, Bislig, Cabuyao, Cavite, Davao, Gingoog, Hagonoy, Iligan, Imus, Lapu-Lapu, Mandaluyong, Ozamis, Santa Rosa, Taguig, Talavera, Tanauan, Tanza, Tarlac, Tuguegarao"
Poland,"Bydgoszcz, Czestochowa, Jastrzebie-Zdrj, Kalisz, Lublin, Plock, Tychy, Wroclaw"
Puerto Rico,"Arecibo, Ponce"
Romania,"Botosani, Bucuresti"
Runion,Saint-Denis
Russian Federation,"Atinsk, Balaiha, Dzerzinsk, Elista, Ivanovo, Jaroslavl, Jelets, Kaliningrad, Kamyin, Kirovo-Tepetsk, Kolpino, Korolev, Kurgan, Kursk, Lipetsk, Ljubertsy, Maikop, Moscow, Nabereznyje Telny, Niznekamsk, Novoterkassk, Pjatigorsk, Serpuhov, Smolensk, Syktyvkar"
Saint Vincent and the Grenadines,Kingstown
Saudi Arabia,"Abha, al-Hawiya, al-Qatif, Jedda, Tabuk"
Senegal,Ziguinchor
Slovakia,Bratislava
South Africa,"Boksburg, Botshabelo, Chatsworth, Johannesburg, Kimberley, Klerksdorp, Newcastle, Paarl, Rustenburg, Soshanguve, Springs"
South Korea,"Cheju, Kimchon, Naju, Tonghae, Uijongbu"
Spain,"A Corua (La Corua), Donostia-San Sebastin, Gijn, Ourense (Orense), Santiago de Compostela"
Sri Lanka,Jaffna
Sudan,"al-Qadarif, Omdurman"
Sweden,Malm
Switzerland,"Basel, Bern, Lausanne"
Taiwan,"Changhwa, Chiayi, Chungho, Fengshan, Hsichuh, Lungtan, Nantou, Tanshui, Touliu, Tsaotun"
Tanzania,"Mwanza, Tabora, Zanzibar"
Thailand,"Nakhon Sawan, Pak Kret, Songkhla"
Tonga,Nukualofa
Tunisia,Sousse
Turkey,"Adana, Balikesir, Batman, Denizli, Eskisehir, Gaziantep, Inegl, Kilis, Ktahya, Osmaniye, Sivas, Sultanbeyli, Tarsus, Tokat, Usak"
Turkmenistan,Ashgabat
Tuvalu,Funafuti
Ukraine,"Kamjanets-Podilskyi, Konotop, Mukateve, ostka, Simferopol, Sumy"
United Arab Emirates,"Abu Dhabi, al-Ayn, Sharja"
United Kingdom,"Bradford, Dundee, London, Southampton, Southend-on-Sea, Southport, Stockport, York"
United States,"Akron, Arlington, Augusta-Richmond County, Aurora, Bellevue, Brockton, Cape Coral, Citrus Heights, Clarksville, Compton, Dallas, Dayton, El Monte, Fontana, Garden Grove, Garland, Grand Prairie, Greensboro, Joliet, Kansas City, Lancaster, Laredo, Lincoln, Manchester, Memphis"
Venezuela,"Barcelona, Caracas, Cuman, Maracabo, Ocumare del Tuy, Valencia, Valle de la Pascua"
Vietnam,"Cam Ranh, Haiphong, Hanoi, Nam Dinh, Nha Trang, Vinh"
"Virgin Islands, U.S.",Charlotte Amalie
Yemen,"Aden, Hodeida, Sanaa, Taizz"
Yugoslavia,"Kragujevac, Novi Sad"
Zambia,Kitwe

110
packages/nc-gui/tests/playwright/fixtures/expectedBaseDownloadDataPg.txt

@ -0,0 +1,110 @@
Country,City List
Afghanistan,Kabul
Algeria,"Batna, Bchar, Skikda"
American Samoa,Tafuna
Angola,"Benguela, Namibe"
Anguilla,South Hill
Argentina,"Almirante Brown, Avellaneda, Baha Blanca, Crdoba, Escobar, Ezeiza, La Plata, Merlo, Quilmes, San Miguel de Tucumn, Santa F, Tandil, Vicente Lpez"
Armenia,Yerevan
Australia,Woodridge
Austria,"Graz, Linz, Salzburg"
Azerbaijan,"Baku, Sumqayit"
Bahrain,al-Manama
Bangladesh,"Dhaka, Jamalpur, Tangail"
Belarus,"Mogiljov, Molodetno"
Bolivia,"El Alto, Sucre"
Brazil,"Alvorada, Angra dos Reis, Anpolis, Aparecida de Goinia, Araatuba, Bag, Belm, Blumenau, Boa Vista, Braslia, Goinia, Guaruj, guas Lindas de Gois, Ibirit, Juazeiro do Norte, Juiz de Fora, Luzinia, Maring, Po, Poos de Caldas, Rio Claro, Santa Brbara dOeste, Santo Andr, So Bernardo do Campo, So Leopoldo"
Brunei,Bandar Seri Begawan
Bulgaria,"Ruse, Stara Zagora"
Cambodia,"Battambang, Phnom Penh"
Cameroon,"Bamenda, Yaound"
Canada,"Gatineau, Halifax, Lethbridge, London, Oshawa, Richmond Hill, Vancouver"
Chad,NDjamna
Chile,"Antofagasta, Coquimbo, Rancagua"
China,"Baicheng, Baiyin, Binzhou, Changzhou, Datong, Daxian, Dongying, Emeishan, Enshi, Ezhou, Fuyu, Fuzhou, Haining, Hami, Hohhot, Huaian, Jinchang, Jining, Jinzhou, Junan, Korla, Laiwu, Laohekou, Lengshuijiang, Leshan"
Colombia,"Buenaventura, Dos Quebradas, Florencia, Pereira, Sincelejo, Sogamoso"
"Congo, The Democratic Republic of the","Lubumbashi, Mwene-Ditu"
Czech Republic,Olomouc
Dominican Republic,"La Romana, San Felipe de Puerto Plata, Santiago de los Caballeros"
Ecuador,"Loja, Portoviejo, Robamba"
Egypt,"Bilbays, Idfu, Mit Ghamr, Qalyub, Sawhaj, Shubra al-Khayma"
Estonia,Tartu
Ethiopia,Addis Abeba
Faroe Islands,Trshavn
Finland,Oulu
France,"Brest, Le Mans, Toulon, Toulouse"
French Guiana,Cayenne
French Polynesia,"Faaa, Papeete"
Gambia,Banjul
Germany,"Duisburg, Erlangen, Halle/Saale, Mannheim, Saarbrcken, Siegen, Witten"
Greece,"Athenai, Patras"
Greenland,Nuuk
Holy See (Vatican City State),Citt del Vaticano
Hong Kong,Kowloon and New Kowloon
Hungary,Szkesfehrvr
India,"Adoni, Ahmadnagar, Allappuzha (Alleppey), Ambattur, Amroha, Balurghat, Berhampore (Baharampur), Bhavnagar, Bhilwara, Bhimavaram, Bhopal, Bhusawal, Bijapur, Chandrapur, Chapra, Dhule (Dhulia), Etawah, Firozabad, Gandhinagar, Gulbarga, Haldia, Halisahar, Hoshiarpur, Hubli-Dharwad, Jaipur"
Indonesia,"Cianjur, Ciomas, Ciparay, Gorontalo, Jakarta, Lhokseumawe, Madiun, Pangkal Pinang, Pemalang, Pontianak, Probolinggo, Purwakarta, Surakarta, Tegal"
Iran,"Arak, Esfahan, Kermanshah, Najafabad, Qomsheh, Shahr-e Kord, Sirjan, Tabriz"
Iraq,Mosul
Israel,"Ashdod, Ashqelon, Bat Yam, Tel Aviv-Jaffa"
Italy,"Alessandria, Bergamo, Brescia, Brindisi, Livorno, Syrakusa, Udine"
Japan,"Akishima, Fukuyama, Higashiosaka, Hino, Hiroshima, Isesaki, Iwaki, Iwakuni, Iwatsuki, Izumisano, Kakamigahara, Kamakura, Kanazawa, Koriyama, Kurashiki, Kuwana, Matsue, Miyakonojo, Nagareyama, Okayama, Okinawa, Omiya, Onomichi, Otsu, Sagamihara"
Kazakstan,"Pavlodar, Zhezqazghan"
Kenya,"Kisumu, Nyeri"
Kuwait,Jalib al-Shuyukh
Latvia,"Daugavpils, Liepaja"
Liechtenstein,Vaduz
Lithuania,Vilnius
Madagascar,Mahajanga
Malawi,Lilongwe
Malaysia,"Ipoh, Kuching, Sungai Petani"
Mexico,"Acua, Allende, Atlixco, Carmen, Celaya, Coacalco de Berriozbal, Coatzacoalcos, Cuauhtmoc, Cuautla, Cuernavaca, El Fuerte, Guadalajara, Hidalgo, Huejutla de Reyes, Huixquilucan, Jos Azueta, Jurez, La Paz, Matamoros, Mexicali, Monclova, Nezahualcyotl, Pachuca de Soto, Salamanca, San Felipe del Progreso"
Moldova,Chisinau
Morocco,"Beni-Mellal, Nador, Sal"
Mozambique,"Beira, Naala-Porto, Tete"
Myanmar,"Monywa, Myingyan"
Nauru,Yangor
Nepal,Birgunj
Netherlands,"Amersfoort, Apeldoorn, Ede, Emmen, s-Hertogenbosch"
New Zealand,Hamilton
Nigeria,"Benin City, Deba Habe, Effon-Alaiye, Ife, Ikerre, Ilorin, Kaduna, Ogbomosho, Ondo, Owo, Oyo, Sokoto, Zaria"
North Korea,Pyongyang
Oman,"Masqat, Salala"
Pakistan,"Dadu, Mandi Bahauddin, Mardan, Okara, Shikarpur"
Paraguay,"Asuncin, Ciudad del Este, San Lorenzo"
Peru,"Callao, Hunuco, Lima, Sullana"
Philippines,"Baybay, Bayugan, Bislig, Cabuyao, Cavite, Davao, Gingoog, Hagonoy, Iligan, Imus, Lapu-Lapu, Mandaluyong, Ozamis, Santa Rosa, Taguig, Talavera, Tanauan, Tanza, Tarlac, Tuguegarao"
Poland,"Bydgoszcz, Czestochowa, Jastrzebie-Zdrj, Kalisz, Lublin, Plock, Tychy, Wroclaw"
Puerto Rico,"Arecibo, Ponce"
Romania,"Botosani, Bucuresti"
Runion,Saint-Denis
Russian Federation,"Atinsk, Balaiha, Dzerzinsk, Elista, Ivanovo, Jaroslavl, Jelets, Kaliningrad, Kamyin, Kirovo-Tepetsk, Kolpino, Korolev, Kurgan, Kursk, Lipetsk, Ljubertsy, Maikop, Moscow, Nabereznyje Telny, Niznekamsk, Novoterkassk, Pjatigorsk, Serpuhov, Smolensk, Syktyvkar"
Saint Vincent and the Grenadines,Kingstown
Saudi Arabia,"Abha, al-Hawiya, al-Qatif, Jedda, Tabuk"
Senegal,Ziguinchor
Slovakia,Bratislava
South Africa,"Boksburg, Botshabelo, Chatsworth, Johannesburg, Kimberley, Klerksdorp, Newcastle, Paarl, Rustenburg, Soshanguve, Springs"
South Korea,"Cheju, Kimchon, Naju, Tonghae, Uijongbu"
Spain,"A Corua (La Corua), Donostia-San Sebastin, Gijn, Ourense (Orense), Santiago de Compostela"
Sri Lanka,Jaffna
Sudan,"al-Qadarif, Omdurman"
Sweden,Malm
Switzerland,"Basel, Bern, Lausanne"
Taiwan,"Changhwa, Chiayi, Chungho, Fengshan, Hsichuh, Lungtan, Nantou, Tanshui, Touliu, Tsaotun"
Tanzania,"Mwanza, Tabora, Zanzibar"
Thailand,"Nakhon Sawan, Pak Kret, Songkhla"
Tonga,Nukualofa
Tunisia,Sousse
Turkey,"Adana, Balikesir, Batman, Denizli, Eskisehir, Gaziantep, Inegl, Kilis, Ktahya, Osmaniye, Sivas, Sultanbeyli, Tarsus, Tokat, Usak"
Turkmenistan,Ashgabat
Tuvalu,Funafuti
Ukraine,"Kamjanets-Podilskyi, Konotop, Mukateve, ostka, Simferopol, Sumy"
United Arab Emirates,"Abu Dhabi, al-Ayn, Sharja"
United Kingdom,"Bradford, Dundee, London, Southampton, Southend-on-Sea, Southport, Stockport, York"
United States,"Akron, Arlington, Augusta-Richmond County, Aurora, Bellevue, Brockton, Cape Coral, Citrus Heights, Clarksville, Compton, Dallas, Dayton, El Monte, Fontana, Garden Grove, Garland, Grand Prairie, Greensboro, Joliet, Kansas City, Lancaster, Laredo, Lincoln, Manchester, Memphis"
Venezuela,"Barcelona, Caracas, Cuman, Maracabo, Ocumare del Tuy, Valencia, Valle de la Pascua"
Vietnam,"Cam Ranh, Haiphong, Hanoi, Nam Dinh, Nha Trang, Vinh"
"Virgin Islands, U.S.",Charlotte Amalie
Yemen,"Aden, Hodeida, Sanaa, Taizz"
Yugoslavia,"Kragujevac, Novi Sad"
Zambia,Kitwe

0
scripts/playwright/fixtures/expectedData.txt → packages/nc-gui/tests/playwright/fixtures/expectedData.txt

19
packages/nc-gui/tests/playwright/fixtures/expectedDataSqlite.txt

@ -0,0 +1,19 @@
Address,District,PostalCode,Phone,Customer List,Staff List,City,Staff List1
1013 Tabuk Boulevard," ",96203," ",2,,Kanchrapara,
1168 Najafabad Parkway," ",40301," ",1,,Kabul,
1294 Firozabad Drive," ",70618," ",2,,Pingxiang,
1342 Abha Boulevard," ",10714," ",2,,Bucuresti,
1368 Maracabo Boulevard," ",32716," ",2,,South Hill,
1427 Tabuk Place," ",31342," ",2,,Cape Coral,
1519 Santiago de los Caballeros Loop," ",22025," ",2,,Mwene-Ditu,
1661 Abha Drive," ",14400," ",1,,Pudukkottai,
17 Kabul Boulevard," ",38594," ",1,,Nagareyama,
1838 Tabriz Lane," ",1195," ",1,,Dhaka,
1888 Kabul Drive," ",20936," ",1,,Ife,
1892 Nabereznyje Telny Lane," ",28396," ",2,,Tafuna,
1993 Tabuk Lane," ",64221," ",2,,Tambaram,
217 Botshabelo Place," ",49521," ",2,,Davao,
381 Kabul Way," ",87272," ",2,,Hsichuh,
44 Najafabad Way," ",61391," ",2,,Donostia-San Sebastin,
48 Maracabo Place," ",1570," ",1,,Talavera,
669 Firozabad Loop," ",92265," ",1,,al-Ayn,

0
scripts/playwright/fixtures/sampleFiles/1.json → packages/nc-gui/tests/playwright/fixtures/sampleFiles/1.json

0
scripts/playwright/fixtures/sampleFiles/2.json → packages/nc-gui/tests/playwright/fixtures/sampleFiles/2.json

0
scripts/playwright/fixtures/sampleFiles/3.json → packages/nc-gui/tests/playwright/fixtures/sampleFiles/3.json

0
scripts/playwright/fixtures/sampleFiles/4.json → packages/nc-gui/tests/playwright/fixtures/sampleFiles/4.json

0
scripts/playwright/fixtures/sampleFiles/5.json → packages/nc-gui/tests/playwright/fixtures/sampleFiles/5.json

0
scripts/playwright/fixtures/sampleFiles/6.json → packages/nc-gui/tests/playwright/fixtures/sampleFiles/6.json

0
scripts/playwright/fixtures/sampleFiles/simple.xlsx → packages/nc-gui/tests/playwright/fixtures/sampleFiles/simple.xlsx

0
scripts/playwright/fixtures/template.spec.ts → packages/nc-gui/tests/playwright/fixtures/template.spec.ts

267
scripts/playwright/package-lock.json → packages/nc-gui/tests/playwright/package-lock.json generated

@ -29,6 +29,7 @@
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"mysql2": "^2.3.3",
"pg": "^8.8.0",
"prettier": "^2.7.1",
"promised-sqlite3": "^1.2.0"
}
@ -841,6 +842,15 @@
"node": ">=8"
}
},
"node_modules/buffer-writer": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
"integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@ -3628,6 +3638,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/packet-reader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
"integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==",
"dev": true
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@ -3686,6 +3702,87 @@
"node": ">=8"
}
},
"node_modules/pg": {
"version": "8.8.0",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz",
"integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==",
"dev": true,
"dependencies": {
"buffer-writer": "2.0.0",
"packet-reader": "1.0.0",
"pg-connection-string": "^2.5.0",
"pg-pool": "^3.5.2",
"pg-protocol": "^1.5.0",
"pg-types": "^2.1.0",
"pgpass": "1.x"
},
"engines": {
"node": ">= 8.0.0"
},
"peerDependencies": {
"pg-native": ">=3.0.1"
},
"peerDependenciesMeta": {
"pg-native": {
"optional": true
}
}
},
"node_modules/pg-connection-string": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz",
"integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==",
"dev": true
},
"node_modules/pg-int8": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
"dev": true,
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/pg-pool": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz",
"integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==",
"dev": true,
"peerDependencies": {
"pg": ">=8.0"
}
},
"node_modules/pg-protocol": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz",
"integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==",
"dev": true
},
"node_modules/pg-types": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
"dev": true,
"dependencies": {
"pg-int8": "1.0.1",
"postgres-array": "~2.0.0",
"postgres-bytea": "~1.0.0",
"postgres-date": "~1.0.4",
"postgres-interval": "^1.1.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/pgpass": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
"integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
"dev": true,
"dependencies": {
"split2": "^4.1.0"
}
},
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
@ -3722,6 +3819,45 @@
"node": ">=14"
}
},
"node_modules/postgres-array": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/postgres-bytea": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
"integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/postgres-date": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/postgres-interval": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
"dev": true,
"dependencies": {
"xtend": "^4.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@ -4273,6 +4409,15 @@
"url": "https://github.com/chalk/slice-ansi?sponsor=1"
}
},
"node_modules/split2": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz",
"integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==",
"dev": true,
"engines": {
"node": ">= 10.x"
}
},
"node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@ -4797,6 +4942,15 @@
"node": ">=0.8"
}
},
"node_modules/xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"dev": true,
"engines": {
"node": ">=0.4"
}
},
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
@ -5394,6 +5548,12 @@
"fill-range": "^7.0.1"
}
},
"buffer-writer": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
"integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==",
"dev": true
},
"bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@ -7459,6 +7619,12 @@
"aggregate-error": "^3.0.0"
}
},
"packet-reader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
"integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==",
"dev": true
},
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@ -7502,6 +7668,68 @@
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true
},
"pg": {
"version": "8.8.0",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz",
"integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==",
"dev": true,
"requires": {
"buffer-writer": "2.0.0",
"packet-reader": "1.0.0",
"pg-connection-string": "^2.5.0",
"pg-pool": "^3.5.2",
"pg-protocol": "^1.5.0",
"pg-types": "^2.1.0",
"pgpass": "1.x"
}
},
"pg-connection-string": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz",
"integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==",
"dev": true
},
"pg-int8": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
"dev": true
},
"pg-pool": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz",
"integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==",
"dev": true,
"requires": {}
},
"pg-protocol": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz",
"integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==",
"dev": true
},
"pg-types": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
"dev": true,
"requires": {
"pg-int8": "1.0.1",
"postgres-array": "~2.0.0",
"postgres-bytea": "~1.0.0",
"postgres-date": "~1.0.4",
"postgres-interval": "^1.1.0"
}
},
"pgpass": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
"integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
"dev": true,
"requires": {
"split2": "^4.1.0"
}
},
"picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
@ -7520,6 +7748,33 @@
"integrity": "sha512-9EmeXDncC2Pmp/z+teoVYlvmPWUC6ejSSYZUln7YaP89Z6lpAaiaAnqroUt/BoLo8tn7WYShcfaCh+xofZa44Q==",
"dev": true
},
"postgres-array": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
"dev": true
},
"postgres-bytea": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
"integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==",
"dev": true
},
"postgres-date": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
"dev": true
},
"postgres-interval": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
"dev": true,
"requires": {
"xtend": "^4.0.0"
}
},
"prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@ -7917,6 +8172,12 @@
"is-fullwidth-code-point": "^3.0.0"
}
},
"split2": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz",
"integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==",
"dev": true
},
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@ -8320,6 +8581,12 @@
"word": "~0.3.0"
}
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"dev": true
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",

13
scripts/playwright/package.json → packages/nc-gui/tests/playwright/package.json

@ -5,11 +5,17 @@
"main": "index.js",
"scripts": {
"test": "TRACE=true npx playwright test --workers=4",
"test:repeat": "TRACE=true npx playwright test --workers=4 --repeat-each=10",
"test:shard:1": "TRACE=true npx playwright test --workers=4 --shard=1/2",
"test:shard:2": "TRACE=true npx playwright test --workers=4 --shard=2/2",
"test:repeat": "TRACE=true npx playwright test --workers=4 --repeat-each=12",
"test:quick": "TRACE=true PW_QUICK_TEST=1 npx playwright test --workers=4",
"test:debug": "./startPlayWrightServer.sh; PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console npx playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 0 --workers 1 --max-failures=1",
"test:debug:quick:sqlite": "./startPlayWrightServer.sh; PW_QUICK_TEST=1 PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console npx playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 5 --workers 1 --max-failures=1",
"ci:test:mysql": "E2E_DB_TYPE=mysql npx playwright test --workers=2"
"ci:test": "npx playwright test --workers=2",
"ci:test:shard:1": "npx playwright test --workers=2 --shard=1/2",
"ci:test:shard:2": "npx playwright test --workers=2 --shard=2/2",
"ci:test:mysql": "E2E_DB_TYPE=mysql npx playwright test --workers=2",
"ci:test:pg": "E2E_DB_TYPE=pg npx playwright test --workers=2"
},
"keywords": [],
"author": "",
@ -25,11 +31,12 @@
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^3.0.2",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"mysql2": "^2.3.3",
"pg": "^8.8.0",
"prettier": "^2.7.1",
"promised-sqlite3": "^1.2.0"
},

0
scripts/playwright/pages/Base.ts → packages/nc-gui/tests/playwright/pages/Base.ts

0
scripts/playwright/pages/Dashboard/ExpandedForm/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/ExpandedForm/index.ts

0
scripts/playwright/pages/Dashboard/Form/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Form/index.ts

0
scripts/playwright/pages/Dashboard/Gallery/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Gallery/index.ts

0
scripts/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts

0
scripts/playwright/pages/Dashboard/Grid/Column/LTAR/LinkRecord.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Grid/Column/LTAR/LinkRecord.ts

0
scripts/playwright/pages/Dashboard/Grid/Column/SelectOptionColumn.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Grid/Column/SelectOptionColumn.ts

0
scripts/playwright/pages/Dashboard/Grid/Column/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Grid/Column/index.ts

0
scripts/playwright/pages/Dashboard/Grid/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Grid/index.ts

0
scripts/playwright/pages/Dashboard/Import/Airtable.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Import/Airtable.ts

0
scripts/playwright/pages/Dashboard/Import/ImportTemplate.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Import/ImportTemplate.ts

0
scripts/playwright/pages/Dashboard/Kanban/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Kanban/index.ts

0
scripts/playwright/pages/Dashboard/Settings/Acl.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Acl.ts

15
scripts/playwright/pages/Dashboard/Settings/AppStore.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Settings/AppStore.ts

@ -17,6 +17,21 @@ export class AppStoreSettingsPage extends BasePage {
async install({ name }: { name: string }) {
const card = await this.settings.get().locator(`.nc-app-store-card-${name}`);
await card.click();
// todo: Hack to solve the issue when if the test installing a plugin fails, the next test will fail because the plugin is already installed
let appAlreadyInstalled = true;
for (let i = 0; i < 5; i++) {
if (await card.locator('.nc-app-store-card-install').isVisible()) {
appAlreadyInstalled = false;
break;
}
await new Promise(resolve => setTimeout(resolve, 1000));
}
if (appAlreadyInstalled) {
await this.uninstall({ name });
}
await card.locator('.nc-app-store-card-install').click();
}

0
scripts/playwright/pages/Dashboard/Settings/Audit.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Audit.ts

0
scripts/playwright/pages/Dashboard/Settings/Erd.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Erd.ts

25
scripts/playwright/pages/Dashboard/Settings/Metadata.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Metadata.ts

@ -31,18 +31,17 @@ export class MetaDataPage extends BasePage {
}
async verifyRow({ index, model, state }: { index: number; model: string; state: string }) {
await expect
.poll(async () => {
return await this.get()
.locator(`tr.ant-table-row`)
.nth(index)
.locator(`td.ant-table-cell`)
.nth(0)
.textContent();
})
.toContain(model);
await expect(
await this.get().locator(`tr.ant-table-row`).nth(index).locator(`td.ant-table-cell`).nth(1).textContent()
).toContain(state);
await expect(this.get().locator(`tr.ant-table-row`).nth(index).locator(`td.ant-table-cell`).nth(0)).toHaveText(
model,
{
ignoreCase: true,
}
);
await expect(this.get().locator(`tr.ant-table-row`).nth(index).locator(`td.ant-table-cell`).nth(1)).toHaveText(
state,
{
ignoreCase: true,
}
);
}
}

0
scripts/playwright/pages/Dashboard/Settings/Miscellaneous.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts

0
scripts/playwright/pages/Dashboard/Settings/Teams.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Settings/Teams.ts

0
scripts/playwright/pages/Dashboard/Settings/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/Settings/index.ts

0
scripts/playwright/pages/Dashboard/SurveyForm/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/SurveyForm/index.ts

0
scripts/playwright/pages/Dashboard/TreeView.ts → packages/nc-gui/tests/playwright/pages/Dashboard/TreeView.ts

0
scripts/playwright/pages/Dashboard/ViewSidebar/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/ViewSidebar/index.ts

0
scripts/playwright/pages/Dashboard/WebhookForm/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/WebhookForm/index.ts

0
scripts/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts

0
scripts/playwright/pages/Dashboard/common/Cell/CheckboxCell.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/CheckboxCell.ts

0
scripts/playwright/pages/Dashboard/common/Cell/RatingCell.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts

0
scripts/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts

0
scripts/playwright/pages/Dashboard/common/Cell/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Cell/index.ts

0
scripts/playwright/pages/Dashboard/common/ProjectMenu/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/ProjectMenu/index.ts

0
scripts/playwright/pages/Dashboard/common/Toolbar/Actions/Erd.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Actions/Erd.ts

0
scripts/playwright/pages/Dashboard/common/Toolbar/Actions/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Actions/index.ts

0
scripts/playwright/pages/Dashboard/common/Toolbar/AddEditKanbanStack.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/AddEditKanbanStack.ts

0
scripts/playwright/pages/Dashboard/common/Toolbar/Fields.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Fields.ts

0
scripts/playwright/pages/Dashboard/common/Toolbar/Filter.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

0
scripts/playwright/pages/Dashboard/common/Toolbar/ShareView.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/ShareView.ts

0
scripts/playwright/pages/Dashboard/common/Toolbar/Sort.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/Sort.ts

0
scripts/playwright/pages/Dashboard/common/Toolbar/StackBy.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/StackBy.ts

5
scripts/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts

@ -55,7 +55,8 @@ export class ToolbarViewMenuPage extends BasePage {
// Get API Snippet
// ERD View
async click({ menu, subMenu }: { menu: string; subMenu?: string }) {
// todo: Move verification out of the click method
async click({ menu, subMenu, verificationInfo }: { menu: string; subMenu?: string; verificationInfo?: any }) {
await this.viewsMenuBtn.click();
await this.get().locator(`.ant-dropdown-menu-title-content:has-text("${menu}")`).first().click();
if (subMenu) {
@ -65,7 +66,7 @@ export class ToolbarViewMenuPage extends BasePage {
downloadLocator: await this.rootPage
.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`)
.last(),
expectedDataFile: './fixtures/expectedBaseDownloadData.txt',
expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt',
});
} else {
await this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last().click();

4
scripts/playwright/pages/Dashboard/common/Toolbar/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/common/Toolbar/index.ts

@ -94,7 +94,7 @@ export class ToolbarPage extends BasePage {
await this.get().locator(`.nc-toolbar-btn.nc-add-new-row-btn`).click();
}
async clickDownload(type: string, verificationFile: string) {
async clickDownload(type: string, verificationFile = 'expectedData.txt') {
await this.get().locator(`.nc-toolbar-btn.nc-actions-menu-btn`).click();
const [download] = await Promise.all([
@ -111,7 +111,7 @@ export class ToolbarPage extends BasePage {
await download.saveAs('./output/at.txt');
// verify downloaded content against expected content
const expectedData = fs.readFileSync('./fixtures/expectedData.txt', 'utf8');
const expectedData = fs.readFileSync(`./fixtures/${verificationFile}`, 'utf8');
const file = fs.readFileSync('./output/at.txt', 'utf8');
await expect(file).toEqual(expectedData);
}

0
scripts/playwright/pages/Dashboard/commonBase/Erd.ts → packages/nc-gui/tests/playwright/pages/Dashboard/commonBase/Erd.ts

3
scripts/playwright/pages/Dashboard/index.ts → packages/nc-gui/tests/playwright/pages/Dashboard/index.ts

@ -79,6 +79,9 @@ export class DashboardPage extends BasePage {
}
async clickHome() {
// todo: Fast page transition breaks the vue router
await this.rootPage.waitForTimeout(2000);
await this.rootPage.locator('[data-cy="nc-noco-brand-icon"]').click();
const projectsPage = new ProjectsPage(this.rootPage);
await projectsPage.waitToBeRendered();

0
scripts/playwright/pages/LoginPage/index.ts → packages/nc-gui/tests/playwright/pages/LoginPage/index.ts

20
scripts/playwright/pages/ProjectsPage/index.ts → packages/nc-gui/tests/playwright/pages/ProjectsPage/index.ts

@ -9,7 +9,7 @@ export class ProjectsPage extends BasePage {
prefixTitle(title: string) {
const parallelId = process.env.TEST_PARALLEL_INDEX ?? '0';
return `${title}${parallelId}`;
return `nc_test_${parallelId}_${title}`;
}
get() {
@ -31,15 +31,24 @@ export class ProjectsPage extends BasePage {
await this.rootPage.locator('.nc-new-project-menu').click();
const createProjectMenu = await this.rootPage.locator('.nc-dropdown-create-project');
if (type === 'xcdb') {
await createProjectMenu.locator(`.ant-dropdown-menu-title-content`).nth(0).click();
} else {
await createProjectMenu.locator(`.ant-dropdown-menu-title-content`).nth(1).click();
}
// todo: Fast page transition breaks the vue router
await this.rootPage.waitForTimeout(2000);
await this.rootPage.locator(`.nc-metadb-project-name`).waitFor();
await this.rootPage.locator(`input.nc-metadb-project-name`).fill(name);
await this.rootPage.locator(`input.nc-metadb-project-name`).press('Enter');
await this.rootPage.waitForTimeout(2000);
await this.rootPage.locator(`button:has-text("Create")`).click({
delay: 2000,
});
// fix me! wait for page to be rendered completely
await this.rootPage.waitForTimeout(2000);
@ -78,6 +87,9 @@ export class ProjectsPage extends BasePage {
withoutPrefix?: boolean;
waitForAuthTab?: boolean;
}) {
// todo: Fast page transition breaks the vue router
await this.rootPage.waitForTimeout(2000);
if (!withoutPrefix) title = this.prefixTitle(title);
let project: any;
@ -144,6 +156,10 @@ export class ProjectsPage extends BasePage {
has: project.locator(`td.ant-table-cell:has-text("${title}")`),
});
await projRow.locator('.nc-action-btn').nth(0).click();
// todo: Fast page transition breaks the vue router
await this.rootPage.waitForTimeout(2000);
await project.locator('input.nc-metadb-project-name').fill(newTitle);
// press enter to save
const submitAction = project.locator('input.nc-metadb-project-name').press('Enter');

0
scripts/playwright/pages/SharedForm/index.ts → packages/nc-gui/tests/playwright/pages/SharedForm/index.ts

0
scripts/playwright/pages/SignupPage/index.ts → packages/nc-gui/tests/playwright/pages/SignupPage/index.ts

0
scripts/playwright/playwright.config.ts → packages/nc-gui/tests/playwright/playwright.config.ts

4
scripts/playwright/quickTests/commonTest.ts → packages/nc-gui/tests/playwright/quickTests/commonTest.ts

@ -1,7 +1,7 @@
import { DashboardPage } from '../pages/Dashboard';
import { ProjectsPage } from '../pages/ProjectsPage';
import { NcContext } from '../setup';
import { isMysql } from '../setup/db';
import { isMysql, isPg } from '../setup/db';
// normal fields
const recordCells = {
@ -103,7 +103,7 @@ const quickVerify = async ({
await dashboard.grid.cell.verifyVirtualCell({
index: cellIndex,
columnHeader: 'Actor',
value: isMysql(context) ? ['Actor1'] : recordsVirtualCells.Actor,
value: isMysql(context) || isPg(context) ? ['Actor1'] : recordsVirtualCells.Actor,
});
// Status (from Actor)

0
scripts/playwright/quickTests/quickTests.spec.ts → packages/nc-gui/tests/playwright/quickTests/quickTests.spec.ts

2
scripts/playwright/scripts/docker-compose-playwright.yml → packages/nc-gui/tests/playwright/scripts/docker-compose-mysql-playwright.yml

@ -11,4 +11,4 @@ services:
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- ../../../packages/nocodb/tests/mysql-sakila-db:/docker-entrypoint-initdb.d
- ../../../../../packages/nocodb/tests/mysql-sakila-db:/docker-entrypoint-initdb.d

2
scripts/playwright/scripts/docker-compose-pg-pw-quick.yml → packages/nc-gui/tests/playwright/scripts/docker-compose-pg-pw-quick.yml

@ -9,7 +9,7 @@ services:
ports:
- 5432:5432
volumes:
- ../../packages/nocodb/tests/pg-cy-quick:/docker-entrypoint-initdb.d
- ../../../../../packages/nocodb/tests/pg-cy-quick:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s

2
scripts/playwright/scripts/docker-compose-pg.yml → packages/nc-gui/tests/playwright/scripts/docker-compose-pg.yml

@ -9,7 +9,7 @@ services:
ports:
- 5432:5432
volumes:
- ../../packages/nocodb/tests/pg-sakila-db:/docker-entrypoint-initdb.d
- ../../../../../packages/nocodb/tests/pg-sakila-db:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s

15
packages/nc-gui/tests/playwright/scripts/docker-compose-playwright-pg.yml

@ -0,0 +1,15 @@
version: "2.1"
services:
pg96:
image: postgres:15
restart: always
environment:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5

38
scripts/playwright/setup/db.ts → packages/nc-gui/tests/playwright/setup/db.ts

@ -1,6 +1,9 @@
import { NcContext } from '.';
const mysql = require('mysql2');
const { Client } = require('pg');
import axios from 'axios';
import { PromisedDatabase } from 'promised-sqlite3';
const sqliteDb = new PromisedDatabase();
const isMysql = (context: NcContext) => context.dbType === 'mysql';
@ -8,7 +11,22 @@ const isSqlite = (context: NcContext) => context.dbType === 'sqlite';
const isPg = (context: NcContext) => context.dbType === 'pg';
const mysql = require('mysql2');
const pg_credentials = () => ({
user: 'postgres',
host: 'localhost',
database: `sakila_${process.env.TEST_PARALLEL_INDEX}`,
password: 'password',
port: 5432,
});
const pgExec = async (query: string) => {
// open pg client connection
const client = new Client(pg_credentials());
await client.connect();
await client.query(query);
await client.end();
};
const mysqlExec = async query => {
// creates a new mysql connection using credentials from cypress.json env's
@ -34,14 +52,12 @@ const mysqlExec = async query => {
};
async function sqliteExec(query) {
try {
await axios.post('http://localhost:8080/api/v1/meta/test/sqlite_exec', {
sql: query,
});
} catch (e) {
console.error(e);
throw e;
}
const parallelIndex = process.env.TEST_PARALLEL_INDEX;
const rootProjectDir = __dirname.replace('/packages/nc-gui/tests/playwright/setup', '');
await sqliteDb.open(`${rootProjectDir}/packages/nocodb/test_sakila_${parallelIndex}.db`);
await sqliteDb.run(query);
await sqliteDb.close();
}
export { sqliteExec, mysqlExec, isMysql, isSqlite, isPg };
export { sqliteExec, mysqlExec, isMysql, isSqlite, isPg, pgExec };

25
scripts/playwright/setup/index.ts → packages/nc-gui/tests/playwright/setup/index.ts

@ -9,16 +9,23 @@ export interface NcContext {
const setup = async ({ page, isEmptyProject }: { page: Page; isEmptyProject?: boolean }): Promise<NcContext> => {
let dbType = process.env.CI ? process.env.E2E_DB_TYPE : process.env.E2E_DEV_DB_TYPE;
dbType = dbType || 'mysql';
const response = await axios.post(`http://localhost:8080/api/v1/meta/test/reset`, {
parallelId: process.env.TEST_PARALLEL_INDEX,
dbType,
isEmptyProject,
});
dbType = dbType || 'sqlite';
// if (!process.env.CI) console.time(`setup ${process.env.TEST_PARALLEL_INDEX}`);
let response;
try {
response = await axios.post(`http://localhost:8080/api/v1/meta/test/reset`, {
parallelId: process.env.TEST_PARALLEL_INDEX,
dbType,
isEmptyProject,
});
} catch (e) {
console.error(`Error resetting project: ${process.env.TEST_PARALLEL_INDEX}`, e);
}
// if (!process.env.CI) console.timeEnd(`setup ${process.env.TEST_PARALLEL_INDEX}`);
if (response.status !== 200) {
console.error('Failed to reset test data', response.data);
if (response.status !== 200 || !response.data?.token || !response.data?.project) {
console.error('Failed to reset test data', response.data, response.status);
throw new Error('Failed to reset test data');
}
const token = response.data.token;

0
scripts/playwright/setup/server.ts → packages/nc-gui/tests/playwright/setup/server.ts

0
scripts/playwright/setup/sqliteExec.ts → packages/nc-gui/tests/playwright/setup/sqliteExec.ts

0
scripts/playwright/startPlayWrightServer.sh → packages/nc-gui/tests/playwright/startPlayWrightServer.sh

0
scripts/playwright/storageState.json → packages/nc-gui/tests/playwright/storageState.json

0
scripts/playwright/tests/01-webhook.spec.ts → packages/nc-gui/tests/playwright/tests/01-webhook.spec.ts

0
scripts/playwright/tests/authChangePassword.spec.ts → packages/nc-gui/tests/playwright/tests/authChangePassword.spec.ts

5
scripts/playwright/tests/baseShare.spec.ts → packages/nc-gui/tests/playwright/tests/baseShare.spec.ts

@ -54,7 +54,7 @@ test.describe('Shared base', () => {
loginPage = new LoginPage(page);
});
test.skip('#1', async () => {
test('#1', async () => {
// close 'Team & Auth' tab
await dashboard.closeTab({ title: 'Team & Auth' });
@ -77,7 +77,8 @@ test.describe('Shared base', () => {
password: 'Password123.',
withoutPrefix: true,
});
await projectPage.openProject({ title: 'externalREST' });
await projectPage.openProject({ title: context.project.title, withoutPrefix: true });
await dashboard.closeTab({ title: 'Team & Auth' });
await dashboard.treeView.inviteTeamButton.click();

0
scripts/playwright/tests/columnAttachments.spec.ts → packages/nc-gui/tests/playwright/tests/columnAttachments.spec.ts

0
scripts/playwright/tests/columnDuration.spec.ts → packages/nc-gui/tests/playwright/tests/columnDuration.spec.ts

14
scripts/playwright/tests/columnFormula.spec.ts → packages/nc-gui/tests/playwright/tests/columnFormula.spec.ts

@ -1,6 +1,7 @@
import { test } from '@playwright/test';
import { DashboardPage } from '../pages/Dashboard';
import setup from '../setup';
import setup, { NcContext } from '../setup';
import { isPg, isSqlite } from '../setup/db';
// Add formula to be verified here & store expected results for 5 rows
// Column data from City table (Sakila DB)
@ -12,7 +13,7 @@ import setup from '../setup';
* Acua 2006-02-15 04:45:25 1789 Saint-Denis Parkway Mexico
* Adana 2006-02-15 04:45:25 663 Baha Blanca Parkway Turkey
*/
const formulaData = [
const formulaDataByDbType = (context: NcContext) => [
{
formula: '1 + 1',
result: ['2', '2', '2', '2', '2'],
@ -45,7 +46,9 @@ const formulaData = [
},
{
formula: `LOG({CityId}) + EXP({CityId}) + POWER({CityId}, 3) + SQRT({CountryId})`,
result: ['13.04566088154786', '25.137588417628013', '58.23402483297667', '127.73041108667896', '284.8714548168068'],
result: isPg(context)
? ['13.04566088154786', '24.74547123273205', '57.61253379902822', '126.94617671688704', '283.9609869087087']
: ['13.04566088154786', '25.137588417628013', '58.23402483297667', '127.73041108667896', '284.8714548168068'],
},
{
formula: `NOW()`,
@ -74,10 +77,10 @@ test.describe('Virtual Columns', () => {
test('Formula', async () => {
// close 'Team & Auth' tab
const formulaData = formulaDataByDbType(context);
await dashboard.closeTab({ title: 'Team & Auth' });
await dashboard.treeView.openTable({ title: 'City' });
// Create formula column
await dashboard.grid.column.create({
title: 'NC_MATH_0',
@ -87,6 +90,9 @@ test.describe('Virtual Columns', () => {
// verify different formula's
for (let i = 1; i < formulaData.length; i++) {
// Sqlite does not support log function
if (isSqlite(context) && formulaData[i].formula.includes('LOG(')) continue;
await dashboard.grid.column.openEdit({
title: 'NC_MATH_0',
type: 'Formula',

0
scripts/playwright/tests/columnLinkToAnotherRecord.spec.ts → packages/nc-gui/tests/playwright/tests/columnLinkToAnotherRecord.spec.ts

0
scripts/playwright/tests/columnLookupRollup.spec.ts → packages/nc-gui/tests/playwright/tests/columnLookupRollup.spec.ts

0
scripts/playwright/tests/columnMultiSelect.spec.ts → packages/nc-gui/tests/playwright/tests/columnMultiSelect.spec.ts

1
scripts/playwright/tests/columnRelationalExtendedTests.spec.ts → packages/nc-gui/tests/playwright/tests/columnRelationalExtendedTests.spec.ts

@ -1,6 +1,7 @@
import { test } from '@playwright/test';
import { DashboardPage } from '../pages/Dashboard';
import setup from '../setup';
import { isPg } from '../setup/db';
test.describe('Relational Columns', () => {
let dashboard: DashboardPage;

0
scripts/playwright/tests/columnSingleSelect.spec.ts → packages/nc-gui/tests/playwright/tests/columnSingleSelect.spec.ts

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save