Browse Source

feat(testing): Added prod build of front end

pull/3848/head
Muhammed Mustafa 2 years ago
parent
commit
30d8d9f1c5
  1. 3
      packages/nc-gui/lib/constants.ts
  2. 3
      packages/nc-gui/package.json
  3. 7
      scripts/playwright/pages/Dashboard/Grid/Column/index.ts
  4. 7
      scripts/playwright/pages/ProjectsPage/index.ts

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

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

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",
"build:ci": "npm install; npm run build; NC_BACKEND_URL=http://localhost:8080 npm run start"
},
"dependencies": {
"@ckpack/vue-color": "^1.2.0",

7
scripts/playwright/pages/Dashboard/Grid/Column/index.ts

@ -203,7 +203,12 @@ export class ColumnPageObject extends BasePage {
}
async save({ isUpdated }: { isUpdated?: boolean } = {}) {
await this.get().locator('button:has-text("Save")').click();
await this.waitForResponse({
uiAction: this.get().locator('button:has-text("Save")').click(),
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
responseJsonMatcher: (json) => json['pageInfo'],
});
await this.toastWait({
message: isUpdated ? "Column updated" : "Column created",

7
scripts/playwright/pages/ProjectsPage/index.ts

@ -157,6 +157,11 @@ export class ProjectsPage extends BasePage {
await projRow.locator(".nc-action-btn").nth(0).click();
await project.locator("input.nc-metadb-project-name").fill(newTitle);
// press enter to save
await project.locator("input.nc-metadb-project-name").press("Enter");
const submitAction = project.locator("input.nc-metadb-project-name").press("Enter");
await this.waitForResponse({
uiAction: submitAction,
requestUrlPathToMatch: 'api/v1/db/meta/projects/',
httpMethodsToMatch: ['PATCH'],
});
}
}

Loading…
Cancel
Save