mirror of https://github.com/nocodb/nocodb
108 changed files with 6666 additions and 4564 deletions
@ -0,0 +1,23 @@ |
|||||||
|
# i18n translation request |
||||||
|
|
||||||
|
**Please enter the following details** |
||||||
|
|
||||||
|
1. Select applicalbe |
||||||
|
- [ ] **New language support request** |
||||||
|
- [ ] **Existing language translation corrections request** |
||||||
|
Verify if language support already exists in NocoDB i18n master spreadsheet [here](https://docs.google.com/spreadsheets/d/1kGp92yLwhs1l7lwwgeor3oN1dFl7JZWuQOa4WSeZ0TE/edit#gid=2076107172) |
||||||
|
|
||||||
|
2. Associated language code (pick from [here](https://developers.google.com/admin-sdk/directory/v1/languages)): |
||||||
|
|
||||||
|
3. Google spreadsheet |
||||||
|
- Procedure to share google spread sheet can be found [here](https://support.google.com/docs/answer/2494822?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cshare-a-file-publicly) |
||||||
|
- When requested, select public sharable link. |
||||||
|
- Alternatively, you can download & attach spreadsheet here along with the issue as well. |
||||||
|
- [ ] **Attached** |
||||||
|
- [ ] **Shared link**: |
||||||
|
|
||||||
|
4. Summary of the changes made |
||||||
|
- You can highlight modified items in Spreadsheet attached/shared, to help us quickly identify change set |
||||||
|
|
||||||
|
5. Any specific message to be conveyed to moderators? |
||||||
|
- Help us simplify process if you find something hard about it |
@ -0,0 +1,32 @@ |
|||||||
|
--- |
||||||
|
name: i18n translation request |
||||||
|
about: translation & localisation support |
||||||
|
title: "[i18n] Language support extension- <language code>" |
||||||
|
labels: i18n translation |
||||||
|
assignees: dstala |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
# i18n translation request |
||||||
|
|
||||||
|
**Please enter the following details** |
||||||
|
|
||||||
|
1. Select applicalbe |
||||||
|
- [ ] **New language support request** |
||||||
|
- [ ] **Existing language translation corrections request** |
||||||
|
Verify if language support already exists in the NocoDB i18n master spreadsheet [here](https://docs.google.com/spreadsheets/d/1kGp92yLwhs1l7lwwgeor3oN1dFl7JZWuQOa4WSeZ0TE/edit#gid=2076107172) |
||||||
|
|
||||||
|
2. Associated language code (pick from [here](https://developers.google.com/admin-sdk/directory/v1/languages)): |
||||||
|
|
||||||
|
3. Google spreadsheet |
||||||
|
- Procedure to share google spreadsheet can be found [here](https://support.google.com/docs/answer/2494822?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cshare-a-file-publicly) |
||||||
|
- When requested, select public sharable link. |
||||||
|
- Alternatively, you can download & attach a spreadsheet here along with the issue as well. |
||||||
|
- [ ] **Attached** |
||||||
|
- [ ] **Shared link**: |
||||||
|
|
||||||
|
4. Summary of the changes made |
||||||
|
- You can highlight modified items in the Spreadsheet attached/shared, to help us quickly identify changeset |
||||||
|
|
||||||
|
5. Any specific message to be conveyed to moderators? |
||||||
|
- Help us simplify the process if you find something hard about it |
@ -0,0 +1,34 @@ |
|||||||
|
name: 'Close Issues with Labels' |
||||||
|
|
||||||
|
on: |
||||||
|
# Triggered manually |
||||||
|
workflow_dispatch: |
||||||
|
inputs: |
||||||
|
issue_label: |
||||||
|
description: "All issues with such label will be closed" |
||||||
|
required: true |
||||||
|
version: |
||||||
|
description: "Which version is this issue fixed in" |
||||||
|
required: true |
||||||
|
# Triggered by release-nocodb.yml |
||||||
|
workflow_call: |
||||||
|
inputs: |
||||||
|
issue_label: |
||||||
|
description: "All issues with such label will be closed" |
||||||
|
required: true |
||||||
|
type: string |
||||||
|
version: |
||||||
|
description: "Which version is this issue fixed in" |
||||||
|
required: true |
||||||
|
type: string |
||||||
|
jobs: |
||||||
|
close-issues: |
||||||
|
runs-on: ubuntu-latest |
||||||
|
steps: |
||||||
|
- uses: actions/checkout@master |
||||||
|
- name: close-resolved-issues |
||||||
|
uses: wingkwong/close-issues-based-on-label@master |
||||||
|
env: |
||||||
|
LABEL: ${{ github.event.inputs.issue_label || inputs.issue_label }} |
||||||
|
VERSION: ${{ github.event.inputs.version || inputs.version }} |
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
@ -0,0 +1,52 @@ |
|||||||
|
name: 'NocoDB Release' |
||||||
|
|
||||||
|
on: |
||||||
|
# Triggered manually |
||||||
|
workflow_dispatch: |
||||||
|
inputs: |
||||||
|
tag: |
||||||
|
description: "Target Tag" |
||||||
|
required: true |
||||||
|
prev_tag: |
||||||
|
description: "Previous Tag" |
||||||
|
required: true |
||||||
|
jobs: |
||||||
|
# Close all issues with target tags 'Fixed' & 'Resolved' |
||||||
|
close-fixed-issues: |
||||||
|
needs: release-npm |
||||||
|
uses: ./.github/workflows/release-close-issue.yml |
||||||
|
with: |
||||||
|
issue_label: 'Fixed' |
||||||
|
version: ${{ github.event.inputs.tag }} |
||||||
|
close-resolved-issues: |
||||||
|
needs: close-fixed-issues |
||||||
|
uses: ./.github/workflows/release-close-issue.yml |
||||||
|
with: |
||||||
|
issue_label: 'Resolved' |
||||||
|
version: ${{ github.event.inputs.tag }} |
||||||
|
|
||||||
|
# Build, install, publish frontend and backend to npm |
||||||
|
release-npm: |
||||||
|
uses: ./.github/workflows/release-npm.yml |
||||||
|
with: |
||||||
|
tag: ${{ github.event.inputs.tag }} |
||||||
|
|
||||||
|
# Draft Release Note |
||||||
|
release-draft-note: |
||||||
|
needs: close-issues |
||||||
|
uses: ./.github/workflows/release-draft.yml |
||||||
|
with: |
||||||
|
tag: ${{ github.event.inputs.tag }} |
||||||
|
prev_tag: ${{ github.event.inputs.prev_tag }} |
||||||
|
|
||||||
|
# Build docker image and push to docker hub |
||||||
|
release-docker: |
||||||
|
needs: release-draft-note |
||||||
|
uses: ./.github/workflows/release-docker.yml |
||||||
|
with: |
||||||
|
tag: ${{ github.event.inputs.tag }} |
||||||
|
|
||||||
|
# Sync changes to develop |
||||||
|
sync-to-develop: |
||||||
|
needs: release-docker |
||||||
|
uses: ./.github/workflows/sync-to-develop.yml |
@ -0,0 +1,23 @@ |
|||||||
|
name: 'Sync changes back to develop branch from master' |
||||||
|
|
||||||
|
on: |
||||||
|
# Triggered manually |
||||||
|
workflow_dispatch: |
||||||
|
# Triggered by release-nocodb.yml |
||||||
|
workflow_call: |
||||||
|
jobs: |
||||||
|
close-issues: |
||||||
|
runs-on: ubuntu-latest |
||||||
|
steps: |
||||||
|
- name: Checkout |
||||||
|
uses: actions/checkout@v1 |
||||||
|
|
||||||
|
- name: Merge from master to develop |
||||||
|
uses: robotology/gh-action-nightly-merge@v1.3.1 |
||||||
|
with: |
||||||
|
stable_branch: 'master' |
||||||
|
development_branch: 'develop' |
||||||
|
allow_ff: true |
||||||
|
allow_forks: true |
||||||
|
env: |
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
@ -0,0 +1,65 @@ |
|||||||
|
--- |
||||||
|
title: "i18n" |
||||||
|
description: "Contribute to NocoDB's i18n translation" |
||||||
|
position: 2000 |
||||||
|
category: "Engineering" |
||||||
|
menuTitle: "i18n" |
||||||
|
--- |
||||||
|
|
||||||
|
NocoDB supports many foreign languages & we welcome community contributions via an easy to use [google-spreadsheet](https://docs.google.com/spreadsheets/d/1kGp92yLwhs1l7lwwgeor3oN1dFl7JZWuQOa4WSeZ0TE/edit#gid=2076107172). |
||||||
|
Your help in fixing i18n goes a long way supporting NocoDB. Please follow below simple procedure to request corrections to existing translation errors. |
||||||
|
|
||||||
|
## How to contribute ? (for community members) |
||||||
|
|
||||||
|
### 1. How to change a string value ? |
||||||
|
- Make a copy of [Google spreadsheet](https://docs.google.com/spreadsheets/d/1kGp92yLwhs1l7lwwgeor3oN1dFl7JZWuQOa4WSeZ0TE/edit#gid=2076107172) |
||||||
|
<img width="995" alt="Screenshot 2022-02-10 at 1 47 06 PM" src="https://user-images.githubusercontent.com/86527202/153368423-d1d898ef-bdcb-48c4-a772-b75e2c66566d.png"> |
||||||
|
- Find your language code [here](https://developers.google.com/admin-sdk/directory/v1/languages) |
||||||
|
- Go to the column containing your language code. Make necessary changes. Origin text in ENGLISH can be found in `Column B` of master spreadsheet. |
||||||
|
- Create a new [issue in Github](https://github.com/nocodb/nocodb/issues/new?assignees=dstala&labels=i18n+translation&template=i18n-translation-request.md&title=%5Bi18n%5D+Language+support+extension-+%3Clanguage+code%3E) request with a link to your spreadsheet from Step-1 (for us to verify & update master spreadsheet). |
||||||
|
- NocoDB Maintainers will take changes and merge it. |
||||||
|
- It's that simple! |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 2. How to add a new language ? |
||||||
|
|
||||||
|
Your native language not in list, we will be glad to support with your help! Please follow below steps |
||||||
|
|
||||||
|
- Make a copy of [Google spreadsheet](https://docs.google.com/spreadsheets/d/1kGp92yLwhs1l7lwwgeor3oN1dFl7JZWuQOa4WSeZ0TE/edit#gid=2076107172) |
||||||
|
<img width="995" alt="Screenshot 2022-02-10 at 1 47 06 PM" src="https://user-images.githubusercontent.com/86527202/153368423-d1d898ef-bdcb-48c4-a772-b75e2c66566d.png"> |
||||||
|
- Find your language code [here](https://developers.google.com/admin-sdk/directory/v1/languages) |
||||||
|
- Replace cell $AB$1 (rightmost, containing text `en`) with language code obtained above. |
||||||
|
- Google will generate first version translation in column AB. Review. Make changes as you find appropriate for various items listed. Origin text in ENGLISH can be found in `Column B` of master spreadsheet. |
||||||
|
- Create new [issue](https://github.com/nocodb/nocodb/issues/new?assignees=dstala&labels=i18n+translation&template=i18n-translation-request.md&title=%5Bi18n%5D+Language+support+extension-+%3Clanguage+code%3E) request with a link to your spreadsheet from Step-1 (for us to verify & update master spreadsheet). |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
## How to accept i18n contributions ? (for NocoDB maintainers) |
||||||
|
|
||||||
|
> _This is exclusive to NocoDB maintainers only_ |
||||||
|
|
||||||
|
### 1. Adding / Updating a string |
||||||
|
- Open master [Spreadsheet](https://docs.google.com/spreadsheets/d/1kGp92yLwhs1l7lwwgeor3oN1dFl7JZWuQOa4WSeZ0TE/edit#gid=2076107172) |
||||||
|
- For the string/ text under consideration, look-up in existing sheet if it exists already |
||||||
|
- [New string already exists] Consider re-using it; align string key if required |
||||||
|
- [New string need to be inserted] Insert a new record into appropriate categories as defined below |
||||||
|
- Download spreadsheet as .csv (File > Download > Comma-seperated values (.csv, current sheet) |
||||||
|
- Use noco-i18n-from-cli to generate new language JSON file |
||||||
|
- Copy respective i18n/\*.json files to `nocodb/packages/nc-gui/lang` |
||||||
|
|
||||||
|
### 2. String Categories |
||||||
|
- **General**: simple & common tokens (save, cancel, submit, open, close, home, and such) |
||||||
|
- **Objects**: objects from NocoDB POV (project, table, field, column, view, page, and such) |
||||||
|
- **Title**: screen headers (compact) (menu headers, modal headers) |
||||||
|
- **Lables**: text box/ radio/ field headers (few words) (Labels over textbox, radio buttons, and such) |
||||||
|
- **Activity**/ actions: work items (few words) (Create Project, Delete Table, Add Row, and such) |
||||||
|
- **Tooltip**: additional information associated with work items (usually lengthy) (Additional information provided for activity) |
||||||
|
- **Placeholder**: placeholders associated with various textboxes (Text placeholders) |
||||||
|
- **Msg** |
||||||
|
- Info: general/success category for everything |
||||||
|
- Error: warnings & errors |
||||||
|
- Toast: pop-up toast messages |
||||||
|
|
||||||
|
> Note: string name should be in camelCase. Use above list as priority order in case of ambiguity. |
@ -1,52 +1,56 @@ |
|||||||
{ |
{ |
||||||
"baseUrl": "http://localhost:3000/", |
"baseUrl": "http://localhost:3000/", |
||||||
"testFiles": [ |
"testFiles": [ |
||||||
"test/restTableOps.js", |
"test/restTableOps.js", |
||||||
"test/restViews.js", |
"test/restViews.js", |
||||||
"test/restRoles.js", |
"test/restRoles.js", |
||||||
"test/restMisc.js", |
"test/restMisc.js", |
||||||
"test/xcdb-restTableOps.js", |
"test/xcdb-restTableOps.js", |
||||||
"test/xcdb-restViews.js", |
"test/xcdb-restViews.js", |
||||||
"test/xcdb-restRoles.js", |
"test/xcdb-restRoles.js", |
||||||
"test/xcdb-restMisc.js", |
"test/xcdb-restMisc.js", |
||||||
"test/gqlTableOps.js", |
"test/gqlTableOps.js", |
||||||
"test/gqlViews.js", |
"test/gqlViews.js", |
||||||
"test/gqlRoles.js", |
"test/gqlRoles.js", |
||||||
"test/gqlMisc.js", |
"test/gqlMisc.js", |
||||||
"test/xcdb-gqlTableOps.js", |
"test/xcdb-gqlTableOps.js", |
||||||
"test/xcdb-gqlViews.js", |
"test/xcdb-gqlViews.js", |
||||||
"test/xcdb-gqlRoles.js", |
"test/xcdb-gqlRoles.js", |
||||||
"test/xcdb-gqlMisc.js" |
"test/xcdb-gqlMisc.js", |
||||||
], |
"test/pg-restTableOps.js", |
||||||
"defaultCommandTimeout": 13000, |
"test/pg-restViews.js", |
||||||
"pageLoadTimeout": 600000, |
"test/pg-restRoles.js", |
||||||
"viewportWidth": 1980, |
"test/pg-restMisc.js" |
||||||
"viewportHeight": 1000, |
], |
||||||
"video": false, |
"defaultCommandTimeout": 13000, |
||||||
"retries": 0, |
"pageLoadTimeout": 600000, |
||||||
"screenshotOnRunFailure": false, |
"viewportWidth": 1980, |
||||||
"numTestsKeptInMemory": 0, |
"viewportHeight": 1000, |
||||||
"env": { |
"video": false, |
||||||
"testMode": "extREST.extGQL.xcdbREST.xcdbGQL", |
"retries": 0, |
||||||
"db": { |
"screenshotOnRunFailure": false, |
||||||
"host": "127.0.0.1", |
"numTestsKeptInMemory": 0, |
||||||
"user": "root", |
"env": { |
||||||
"password": "password" |
"testMode": [ |
||||||
} |
{ "apiType": "rest", "dbType": "xcdb" }, |
||||||
}, |
{ "apiType": "graphql", "dbType": "xcdb" }, |
||||||
"supportedOptionsForTestModes": [ |
{ "apiType": "rest", "dbType": "mysql" }, |
||||||
"extGQL", |
{ "apiType": "graphql", "dbType": "mysql" }, |
||||||
"extREST", |
{ "apiType": "rest", "dbType": "postgres" } |
||||||
"xcdbREST", |
], |
||||||
"xcdbREST", |
"db": { |
||||||
"can configure multiple too, seperated by a . as in extREST.extGQL" |
"host": "127.0.0.1", |
||||||
], |
"user": "root", |
||||||
"fixturesFolder": "scripts/cypress/fixtures", |
"password": "password" |
||||||
"integrationFolder": "scripts/cypress/integration", |
}, |
||||||
"pluginsFile": "scripts/cypress/plugins/index.js", |
"screenshot": false |
||||||
"screenshotsFolder": "scripts/cypress/screenshots", |
}, |
||||||
"videosFolder": "scripts/cypress/videos", |
"fixturesFolder": "scripts/cypress/fixtures", |
||||||
"downloadsFolder": "scripts/cypress/downloads", |
"integrationFolder": "scripts/cypress/integration", |
||||||
"supportFile": "scripts/cypress/support/index.js", |
"pluginsFile": "scripts/cypress/plugins/index.js", |
||||||
"chromeWebSecurity": false |
"screenshotsFolder": "scripts/cypress/screenshots", |
||||||
|
"videosFolder": "scripts/cypress/videos", |
||||||
|
"downloadsFolder": "scripts/cypress/downloads", |
||||||
|
"supportFile": "scripts/cypress/support/index.js", |
||||||
|
"chromeWebSecurity": false |
||||||
} |
} |
||||||
|
@ -0,0 +1,17 @@ |
|||||||
|
version: "2.1" |
||||||
|
|
||||||
|
services: |
||||||
|
pg96: |
||||||
|
image: postgres:9.6 |
||||||
|
restart: always |
||||||
|
environment: |
||||||
|
POSTGRES_PASSWORD: password |
||||||
|
ports: |
||||||
|
- 5432:5432 |
||||||
|
volumes: |
||||||
|
- ../../packages/nocodb/tests/pg-sakila-db:/docker-entrypoint-initdb.d |
||||||
|
healthcheck: |
||||||
|
test: ["CMD-SHELL", "pg_isready -U postgres"] |
||||||
|
interval: 10s |
||||||
|
timeout: 5s |
||||||
|
retries: 5 |
@ -0,0 +1,171 @@ |
|||||||
|
import { |
||||||
|
isTestSuiteActive, |
||||||
|
isXcdb, |
||||||
|
getProjectString, |
||||||
|
isPostgres, |
||||||
|
} from "../../support/page_objects/projectConstants"; |
||||||
|
|
||||||
|
export const genTest = (apiType, dbType) => { |
||||||
|
if (!isTestSuiteActive(apiType, dbType)) return; |
||||||
|
|
||||||
|
describe(`${apiType.toUpperCase()} Table/view drag-drop reorder`, () => { |
||||||
|
function validateTreeField(index, tblName) { |
||||||
|
cy.get(`:nth-child(${index}) > .v-list-item__title > .caption`) |
||||||
|
.contains(tblName) |
||||||
|
.should("exist"); |
||||||
|
} |
||||||
|
|
||||||
|
/* |
||||||
|
Original order of list items |
||||||
|
Actor, Address, Category, City, Country, Customer, FIlm, FilmText, Language, Payment, Rental Staff |
||||||
|
ActorInfo, CustomerList, FilmList, NiceButSlowerFilmList, SalesByFilmCategory, SalesByStore, StaffList |
||||||
|
*/ |
||||||
|
|
||||||
|
it(`Table & SQL View list, Drag/drop`, () => { |
||||||
|
// expand tree-view menu
|
||||||
|
// cy.get(".nc-project-tree")
|
||||||
|
// .find(".v-list-item__title:contains(Tables)", { timeout: 10000 })
|
||||||
|
// .should("exist")
|
||||||
|
// .first()
|
||||||
|
// .click({ force: true });
|
||||||
|
|
||||||
|
validateTreeField(1, "Actor"); |
||||||
|
|
||||||
|
// move Actor field down, above Staff (drag, drop)
|
||||||
|
cy.get(".nc-child-draggable-icon-Actor").drag( |
||||||
|
".nc-child-draggable-icon-Film" |
||||||
|
); |
||||||
|
|
||||||
|
validateTreeField(7, "Actor"); |
||||||
|
|
||||||
|
// move ActorInfo (View) field up to first place (drag, drop)
|
||||||
|
cy.get(".nc-child-draggable-icon-ActorInfo").drag( |
||||||
|
".nc-child-draggable-icon-Address" |
||||||
|
); |
||||||
|
|
||||||
|
validateTreeField(1, "ActorInfo"); |
||||||
|
validateTreeField(2, "Address"); |
||||||
|
validateTreeField(8, "Actor"); |
||||||
|
|
||||||
|
// restore ActorInfo field (drag, drop)
|
||||||
|
cy.get(".nc-child-draggable-icon-ActorInfo").drag( |
||||||
|
".nc-child-draggable-icon-Staff" |
||||||
|
); |
||||||
|
|
||||||
|
// restore Actor field (drag, drop)
|
||||||
|
cy.get(".nc-child-draggable-icon-Actor").drag( |
||||||
|
".nc-child-draggable-icon-Address" |
||||||
|
); |
||||||
|
|
||||||
|
validateTreeField(1, "Actor"); |
||||||
|
validateTreeField(2, "Address"); |
||||||
|
if (isPostgres()) { |
||||||
|
validateTreeField(17, "Staff"); |
||||||
|
validateTreeField(18, "ActorInfo"); |
||||||
|
validateTreeField(19, "CustomerList"); |
||||||
|
} else { |
||||||
|
validateTreeField(12, "Staff"); |
||||||
|
validateTreeField(13, "ActorInfo"); |
||||||
|
validateTreeField(14, "CustomerList"); |
||||||
|
} |
||||||
|
|
||||||
|
// undo project-tree expand operation
|
||||||
|
cy.get(".nc-project-tree") |
||||||
|
.find(".v-list-item__title:contains(Tables)", { |
||||||
|
timeout: 10000, |
||||||
|
}) |
||||||
|
.should("exist") |
||||||
|
.first() |
||||||
|
.click({ force: true }); |
||||||
|
}); |
||||||
|
|
||||||
|
// create new view as specified by 'viewType'
|
||||||
|
// can be - grid/ gallery/ form
|
||||||
|
// wait for toast to appear
|
||||||
|
//
|
||||||
|
function createView(viewType) { |
||||||
|
// click on 'Grid/Gallery' button on Views bar
|
||||||
|
cy.get(`.nc-create-${viewType}-view`).click(); |
||||||
|
|
||||||
|
cy.snipActiveModal(`Modal_createView_${viewType}`); |
||||||
|
|
||||||
|
// Pop up window, click Submit (accepting default name for view)
|
||||||
|
cy.getActiveModal().find("button:contains(Submit)").click(); |
||||||
|
|
||||||
|
cy.toastWait("View created successfully"); |
||||||
|
} |
||||||
|
|
||||||
|
// verify view 'viewName' to be present at position 'index'
|
||||||
|
// index starts from 0
|
||||||
|
function validateViewField(index, viewName) { |
||||||
|
cy.get(".nc-view-item.nc-draggable-child") |
||||||
|
.eq(index) |
||||||
|
.contains(viewName) |
||||||
|
.should("exist"); |
||||||
|
} |
||||||
|
|
||||||
|
it(`View (Gallery/ Grid/ Form) re-order`, () => { |
||||||
|
cy.openTableTab("Actor", 25); |
||||||
|
|
||||||
|
// create 3 views, use default names
|
||||||
|
// Actor1, Actor2, Actor3
|
||||||
|
createView("grid"); |
||||||
|
createView("gallery"); |
||||||
|
createView("form"); |
||||||
|
|
||||||
|
// validate position order
|
||||||
|
validateViewField(0, "Actor"); |
||||||
|
validateViewField(1, "Actor1"); |
||||||
|
validateViewField(2, "Actor2"); |
||||||
|
validateViewField(3, "Actor3"); |
||||||
|
|
||||||
|
// move Actor3 field on top (drag, drop)
|
||||||
|
cy.get(".nc-child-draggable-icon-Actor3").drag( |
||||||
|
`.nc-child-draggable-icon-${ |
||||||
|
isXcdb() ? `nc_${getProjectString()}__` : `` |
||||||
|
}actor` |
||||||
|
); |
||||||
|
|
||||||
|
// validate new position order, Actor3 on top
|
||||||
|
validateViewField(0, "Actor3"); |
||||||
|
validateViewField(1, "Actor"); |
||||||
|
validateViewField(2, "Actor1"); |
||||||
|
validateViewField(3, "Actor2"); |
||||||
|
|
||||||
|
// delete all created views
|
||||||
|
// click on delete icon (becomes visible on hovering mouse)
|
||||||
|
cy.get(".nc-view-delete-icon").eq(0).click({ force: true }); |
||||||
|
cy.toastWait("View deleted successfully"); |
||||||
|
cy.get(".nc-view-delete-icon").eq(0).click({ force: true }); |
||||||
|
cy.toastWait("View deleted successfully"); |
||||||
|
cy.get(".nc-view-delete-icon").eq(0).click({ force: true }); |
||||||
|
cy.toastWait("View deleted successfully"); |
||||||
|
|
||||||
|
// wind up
|
||||||
|
cy.closeTableTab("Actor"); |
||||||
|
}); |
||||||
|
}); |
||||||
|
}; |
||||||
|
|
||||||
|
/** |
||||||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd |
||||||
|
* |
||||||
|
* @author Pranav C Balan <pranavxc@gmail.com> |
||||||
|
* @author Raju Udava <sivadstala@gmail.com> |
||||||
|
* |
||||||
|
* @license GNU AGPL version 3 or any later version |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as |
||||||
|
* published by the Free Software Foundation, either version 3 of the |
||||||
|
* License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* |
||||||
|
*/ |
@ -0,0 +1,202 @@ |
|||||||
|
import { mainPage } from "../../support/page_objects/mainPage"; |
||||||
|
import { loginPage } from "../../support/page_objects/navigation"; |
||||||
|
import { |
||||||
|
getCurrentMode, |
||||||
|
getProjectString, |
||||||
|
isTestSuiteActive, |
||||||
|
isXcdb, |
||||||
|
} from "../../support/page_objects/projectConstants"; |
||||||
|
|
||||||
|
export const genTest = (apiType, dbType) => { |
||||||
|
if (!isTestSuiteActive(apiType, dbType)) return; |
||||||
|
|
||||||
|
let projPrefix = `sakila.`; |
||||||
|
let dbCmd = `pgExec`; |
||||||
|
let tblDisplayPrefix = ``; |
||||||
|
|
||||||
|
describe(`${apiType.toUpperCase()} api - Meta Sync`, () => { |
||||||
|
// Run once before test- create project (rest/graphql)
|
||||||
|
//
|
||||||
|
before(() => { |
||||||
|
mainPage.openMetaTab(); |
||||||
|
}); |
||||||
|
|
||||||
|
after(() => { |
||||||
|
mainPage.closeMetaTab(); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Create table`, () => { |
||||||
|
cy.log("this works"); |
||||||
|
// Create Table
|
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`CREATE TABLE table1( id INT NOT NULL, col1 INT NOT NULL, PRIMARY KEY(id))` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`CREATE TABLE table2( id INT NOT NULL, col1 INT NOT NULL, PRIMARY KEY(id))` |
||||||
|
); |
||||||
|
mainPage.metaSyncValidate(`${tblDisplayPrefix}table1`, "New table"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Add relation`, () => { |
||||||
|
// working with relations in sqlite requires table to be deleted & recreated
|
||||||
|
//
|
||||||
|
// Add relation (FK)
|
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`ALTER TABLE table1 ADD CONSTRAINT fk_idx FOREIGN KEY (id) REFERENCES table2 (id);` |
||||||
|
); |
||||||
|
// cy.task(
|
||||||
|
// dbCmd,
|
||||||
|
// `ALTER TABLE ${projPrefix}table1 ADD CONSTRAINT fk1 FOREIGN KEY (col1) REFERENCES ${projPrefix}table2 (id) ON DELETE NO ACTION ON UPDATE NO ACTION`
|
||||||
|
// );
|
||||||
|
mainPage.metaSyncValidate( |
||||||
|
`${tblDisplayPrefix}table1`, |
||||||
|
"New relation added" |
||||||
|
); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Remove relation`, () => { |
||||||
|
// working with relations in sqlite requires table to be deleted & recreated
|
||||||
|
//
|
||||||
|
// Remove relation (FK)
|
||||||
|
cy.task(dbCmd, `ALTER TABLE table1 DROP CONSTRAINT fk_idx`); |
||||||
|
mainPage.metaSyncValidate( |
||||||
|
`${tblDisplayPrefix}table1`, |
||||||
|
"Relation removed" |
||||||
|
); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Add column`, () => { |
||||||
|
// Add Column
|
||||||
|
let queryString = `ALTER TABLE table1 ADD COLUMN newCol INT`; |
||||||
|
cy.task(dbCmd, queryString); |
||||||
|
mainPage.metaSyncValidate( |
||||||
|
`${tblDisplayPrefix}table1`, |
||||||
|
"New column(newcol)" |
||||||
|
); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Rename column`, () => { |
||||||
|
// Rename Column
|
||||||
|
let queryString = `ALTER TABLE table1 RENAME COLUMN newCol TO newColName`; |
||||||
|
cy.task(dbCmd, queryString); |
||||||
|
mainPage.metaSyncValidate( |
||||||
|
`${tblDisplayPrefix}table1`, |
||||||
|
"New column(newcolname), Column removed(newcol)" |
||||||
|
); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Delete column`, () => { |
||||||
|
// Remove Column
|
||||||
|
cy.task(dbCmd, `ALTER TABLE table1 DROP COLUMN newColName`); |
||||||
|
mainPage.metaSyncValidate( |
||||||
|
`${tblDisplayPrefix}table1`, |
||||||
|
"Column removed(newcolname)" |
||||||
|
); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Delete table`, () => { |
||||||
|
// DROP TABLE
|
||||||
|
cy.task(dbCmd, `DROP TABLE IF EXISTS table1`); |
||||||
|
cy.task(dbCmd, `DROP TABLE IF EXISTS table2`); |
||||||
|
mainPage.metaSyncValidate( |
||||||
|
`${tblDisplayPrefix}table1`, |
||||||
|
"Table removed" |
||||||
|
); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Hide, Filter, Sort`, () => { |
||||||
|
// kludge: bulk insert fail.
|
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`CREATE TABLE table1( id INT NOT NULL, col1 INT NOT NULL, col2 INT NOT NULL, col3 INT NOT NULL, col4 INT NOT NULL, PRIMARY KEY(id))` |
||||||
|
); |
||||||
|
cy.wait(3000); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (1,1,1,1,1)` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (2,2,2,2,2)` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (3,3,3,3,3)` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (4,4,4,4,4)` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (5,5,5,5,5)` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (6,6,6,6,6)` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (7,7,7,7,7)` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (8,8,8,8,8)` |
||||||
|
); |
||||||
|
cy.task( |
||||||
|
dbCmd, |
||||||
|
`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (9,9,9,9,9)` |
||||||
|
); |
||||||
|
mainPage.metaSyncValidate(`${tblDisplayPrefix}table1`, "New table"); |
||||||
|
mainPage.closeMetaTab(); |
||||||
|
|
||||||
|
cy.openTableTab("Table1", 9); |
||||||
|
mainPage.hideField("Col1"); |
||||||
|
mainPage.sortField("Col1", "Z -> A"); |
||||||
|
mainPage.filterField(`Col1`, ">=", "5"); |
||||||
|
cy.get(".nc-grid-row").should("have.length", 5); |
||||||
|
cy.closeTableTab("Table1"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Verify`, () => { |
||||||
|
mainPage.openMetaTab(); |
||||||
|
// Rename Column
|
||||||
|
let queryString = `ALTER TABLE table1 RENAME COLUMN col1 TO newcol`; |
||||||
|
cy.task(dbCmd, queryString); |
||||||
|
mainPage.metaSyncValidate( |
||||||
|
`${tblDisplayPrefix}table1`, |
||||||
|
"New column(newcol), Column removed(col1)" |
||||||
|
); |
||||||
|
|
||||||
|
cy.openTableTab("Table1", 9); |
||||||
|
// kludge- delete table triggered post sql backend operations doesnt carry any trigger toast
|
||||||
|
cy.deleteTable("Table1", "mysql"); |
||||||
|
}); |
||||||
|
}); |
||||||
|
}; |
||||||
|
|
||||||
|
/** |
||||||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd |
||||||
|
* |
||||||
|
* @author Pranav C Balan <pranavxc@gmail.com> |
||||||
|
* @author Raju Udava <sivadstala@gmail.com> |
||||||
|
* |
||||||
|
* @license GNU AGPL version 3 or any later version |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as |
||||||
|
* published by the Free Software Foundation, either version 3 of the |
||||||
|
* License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* |
||||||
|
*/ |
@ -0,0 +1,471 @@ |
|||||||
|
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; |
||||||
|
import { mainPage } from "../../support/page_objects/mainPage"; |
||||||
|
|
||||||
|
let storedURL = ""; |
||||||
|
|
||||||
|
// 0: all enabled
|
||||||
|
// 1: field hide
|
||||||
|
// 2: field sort
|
||||||
|
// 3: field filter
|
||||||
|
// 4: default (address table): for view operation validation
|
||||||
|
// 5: default (country table): for update row/column validation
|
||||||
|
let viewURL = {}; |
||||||
|
|
||||||
|
export const genTest = (apiType, dbType) => { |
||||||
|
if (!isTestSuiteActive(apiType, dbType)) return; |
||||||
|
|
||||||
|
const generateViewLink = (viewName) => { |
||||||
|
// click on share view
|
||||||
|
// cy.get(".v-navigation-drawer__content > .container")
|
||||||
|
// .find(".v-list > .v-list-item")
|
||||||
|
// .contains("Share View")
|
||||||
|
// .click();
|
||||||
|
mainPage.shareView().click(); |
||||||
|
|
||||||
|
// wait, as URL initially will be /undefined
|
||||||
|
cy.getActiveModal() |
||||||
|
.find(".share-link-box") |
||||||
|
.contains("/nc/view/", { timeout: 10000 }) |
||||||
|
.should("exist"); |
||||||
|
|
||||||
|
// copy link text, visit URL
|
||||||
|
cy.getActiveModal() |
||||||
|
.find(".share-link-box") |
||||||
|
.contains("/nc/view/", { timeout: 10000 }) |
||||||
|
.then(($obj) => { |
||||||
|
cy.get("body").type("{esc}"); |
||||||
|
// viewURL.push($obj.text())
|
||||||
|
viewURL[viewName] = $obj.text().trim(); |
||||||
|
}); |
||||||
|
}; |
||||||
|
|
||||||
|
describe(`${apiType.toUpperCase()} api - GRID view (Share)`, () => { |
||||||
|
// Run once before test- create project (rest/graphql)
|
||||||
|
//
|
||||||
|
before(() => { |
||||||
|
// open a table to work on views
|
||||||
|
//
|
||||||
|
cy.openTableTab("Address", 25); |
||||||
|
|
||||||
|
cy.saveLocalStorage(); |
||||||
|
}); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
cy.restoreLocalStorage(); |
||||||
|
}); |
||||||
|
|
||||||
|
afterEach(() => { |
||||||
|
cy.saveLocalStorage(); |
||||||
|
}); |
||||||
|
|
||||||
|
after(() => { |
||||||
|
// close table
|
||||||
|
// mainPage.deleteCreatedViews()
|
||||||
|
cy.closeTableTab("Address"); |
||||||
|
}); |
||||||
|
|
||||||
|
// Common routine to create/edit/delete GRID & GALLERY view
|
||||||
|
// Input: viewType - 'grid'/'gallery'
|
||||||
|
//
|
||||||
|
const viewTest = (viewType) => { |
||||||
|
it(`Create ${viewType.toUpperCase()} view`, () => { |
||||||
|
// create a normal public view
|
||||||
|
cy.get(`.nc-create-${viewType}-view`).click(); |
||||||
|
cy.getActiveModal().find("button:contains(Submit)").click(); |
||||||
|
cy.toastWait("View created successfully"); |
||||||
|
|
||||||
|
// store base URL- to re-visit and delete form view later
|
||||||
|
cy.url().then((url) => { |
||||||
|
storedURL = url; |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} hide, sort, filter & verify`, () => { |
||||||
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
||||||
|
.contains("Address1") |
||||||
|
.click(); |
||||||
|
mainPage.hideField("Address2"); |
||||||
|
mainPage.sortField("Address", "Z -> A"); |
||||||
|
mainPage.filterField("Address", "is like", "Ab"); |
||||||
|
generateViewLink("combined"); |
||||||
|
cy.log(viewURL["combined"]); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share GRID view : ensure we have only one link even if shared multiple times`, () => { |
||||||
|
// generate view link multiple times
|
||||||
|
generateViewLink("combined"); |
||||||
|
generateViewLink("combined"); |
||||||
|
|
||||||
|
// verify if only one link exists in table
|
||||||
|
// cy.get(".v-navigation-drawer__content > .container")
|
||||||
|
// .find(".v-list > .v-list-item")
|
||||||
|
// .contains("Share View")
|
||||||
|
// .parent()
|
||||||
|
// .find("button.mdi-dots-vertical")
|
||||||
|
// .click();
|
||||||
|
mainPage.shareViewList().click(); |
||||||
|
|
||||||
|
// cy.getActiveMenu().find(".v-list-item").contains("Views List").click();
|
||||||
|
|
||||||
|
cy.get('th:contains("View Link")').should("exist"); |
||||||
|
|
||||||
|
cy.get('th:contains("View Link")') |
||||||
|
.parent() |
||||||
|
.parent() |
||||||
|
.next() |
||||||
|
.find("tr") |
||||||
|
.its("length") |
||||||
|
.should("eq", 1) |
||||||
|
.then(() => { |
||||||
|
// cy.get(".v-overlay__content > .d-flex > .v-icon").click();
|
||||||
|
// close modal (fix me! add a close button to share view list modal)
|
||||||
|
cy.get(".v-overlay--active > .v-overlay__scrim").click({ |
||||||
|
force: true, |
||||||
|
}); |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : Visit URL, Verify title`, () => { |
||||||
|
// visit public view
|
||||||
|
cy.visit(viewURL["combined"], { |
||||||
|
baseUrl: null, |
||||||
|
}); |
||||||
|
|
||||||
|
// wait for page rendering to complete
|
||||||
|
cy.get(".nc-grid-row").should("have.length", 18); |
||||||
|
|
||||||
|
// verify title
|
||||||
|
cy.get("div.model-name").contains("Address1").should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : verify fields hidden/open`, () => { |
||||||
|
// verify column headers
|
||||||
|
cy.get('[data-col="Address"]').should("exist"); |
||||||
|
cy.get('[data-col="Address2"]').should("not.exist"); |
||||||
|
cy.get('[data-col="District"]').should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : verify fields sort/ filter`, () => { |
||||||
|
// country column content verification before sort
|
||||||
|
mainPage |
||||||
|
.getCell("Address", 1) |
||||||
|
.contains("669 Firozabad Loop") |
||||||
|
.should("exist"); |
||||||
|
mainPage |
||||||
|
.getCell("Address", 2) |
||||||
|
.contains("48 Maracabo Place") |
||||||
|
.should("exist"); |
||||||
|
mainPage |
||||||
|
.getCell("Address", 3) |
||||||
|
.contains("44 Najafabad Way") |
||||||
|
.should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : verify download CSV`, () => { |
||||||
|
mainPage.hideField("LastUpdate"); |
||||||
|
const verifyCsv = (retrievedRecords) => { |
||||||
|
// expected output, statically configured
|
||||||
|
let storedRecords = [ |
||||||
|
`Address,District,PostalCode,Phone`, |
||||||
|
`669 Firozabad Loop,,92265,,[object Object],2,,Kanchrapara,`, |
||||||
|
`48 Maracabo Place,,1570,,[object Object],2,,Tafuna,`, |
||||||
|
`44 Najafabad Way,,61391,,[object Object],2,,Tambaram,`, |
||||||
|
`381 Kabul Way,,87272,,[object Object],1,,Pudukkottai,`, |
||||||
|
]; |
||||||
|
|
||||||
|
for (let i = 0; i < storedRecords.length; i++) { |
||||||
|
let strCol = storedRecords[i].split(","); |
||||||
|
let retCol = retrievedRecords[i].split(","); |
||||||
|
expect(strCol[0]).to.be.equal(retCol[0]); |
||||||
|
expect(strCol[2]).to.be.equal(retCol[2]); |
||||||
|
// expect(retrievedRecords[i]).to.be.equal(storedRecords[i])
|
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
// download & verify
|
||||||
|
mainPage.downloadAndVerifyCsv( |
||||||
|
`Address_exported_1.csv`, |
||||||
|
verifyCsv |
||||||
|
); |
||||||
|
mainPage.unhideField("LastUpdate"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : Disable sort`, () => { |
||||||
|
// remove sort and validate
|
||||||
|
mainPage.clearSort(); |
||||||
|
mainPage |
||||||
|
.getCell("Address", 1) |
||||||
|
.contains("217 Botshabelo Place") |
||||||
|
.should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : Enable sort`, () => { |
||||||
|
// Sort menu operations (Country Column, Z->A)
|
||||||
|
mainPage.sortField("Address", "Z -> A"); |
||||||
|
mainPage |
||||||
|
.getCell("Address", 1) |
||||||
|
.contains("669 Firozabad Loop") |
||||||
|
.should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : Create Filter`, () => { |
||||||
|
// add filter & validate
|
||||||
|
mainPage.filterField("Address", "is like", "drive"); |
||||||
|
// wait for page rendering to complete
|
||||||
|
cy.get(".nc-grid-row").should("have.length", 3); |
||||||
|
mainPage |
||||||
|
.getCell("Address", 1) |
||||||
|
.contains("1888 Kabul Drive") |
||||||
|
.should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : verify download CSV after local filter`, () => { |
||||||
|
mainPage.hideField("LastUpdate"); |
||||||
|
const verifyCsv = (retrievedRecords) => { |
||||||
|
// expected output, statically configured
|
||||||
|
let storedRecords = [ |
||||||
|
`Address,District,PostalCode,Phone,Location,Address => Customer,Address => Staff,City <= Address,Address <=> Staff`, |
||||||
|
`1888 Kabul Drive,,20936,,1,,Ife,,`, |
||||||
|
`1661 Abha Drive,,14400,,1,,Pudukkottai,,`, |
||||||
|
]; |
||||||
|
|
||||||
|
// for (let i = 0; i < storedRecords.length; i++) {
|
||||||
|
// expect(retrievedRecords[i]).to.be.equal(storedRecords[i])
|
||||||
|
// }
|
||||||
|
|
||||||
|
for (let i = 0; i < storedRecords.length; i++) { |
||||||
|
let strCol = storedRecords[i].split(","); |
||||||
|
let retCol = retrievedRecords[i].split(","); |
||||||
|
expect(strCol[0]).to.be.equal(retCol[0]); |
||||||
|
expect(strCol[2]).to.be.equal(retCol[2]); |
||||||
|
} |
||||||
|
}; |
||||||
|
mainPage.downloadAndVerifyCsv( |
||||||
|
`Address_exported_1.csv`, |
||||||
|
verifyCsv |
||||||
|
); |
||||||
|
mainPage.unhideField("LastUpdate"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share ${viewType.toUpperCase()} view : Delete Filter`, () => { |
||||||
|
// Remove sort and Validate
|
||||||
|
mainPage.filterReset(); |
||||||
|
mainPage |
||||||
|
.getCell("Address", 1) |
||||||
|
.contains("669 Firozabad Loop") |
||||||
|
.should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share GRID view : Virtual column validation > has many`, () => { |
||||||
|
// verify column headers
|
||||||
|
cy.get('[data-col="Address => Customer"]').should("exist"); |
||||||
|
cy.get('[data-col="Address => Staff"]').should("exist"); |
||||||
|
cy.get('[data-col="City <= Address"]').should("exist"); |
||||||
|
cy.get('[data-col="Address <=> Staff"]').should("exist"); |
||||||
|
|
||||||
|
// has many field validation
|
||||||
|
mainPage |
||||||
|
.getCell("Address => Customer", 3) |
||||||
|
.click() |
||||||
|
.find("button.mdi-close-thick") |
||||||
|
.should("not.exist"); |
||||||
|
mainPage |
||||||
|
.getCell("Address => Customer", 3) |
||||||
|
.click() |
||||||
|
.find("button.mdi-plus") |
||||||
|
.should("not.exist"); |
||||||
|
mainPage |
||||||
|
.getCell("Address => Customer", 3) |
||||||
|
.click() |
||||||
|
.find("button.mdi-arrow-expand") |
||||||
|
.click(); |
||||||
|
|
||||||
|
cy.getActiveModal().find("button.mdi-reload").should("exist"); |
||||||
|
cy.getActiveModal() |
||||||
|
.find("button") |
||||||
|
.contains("Link to") |
||||||
|
.should("not.exist"); |
||||||
|
cy.getActiveModal() |
||||||
|
.find(".child-card") |
||||||
|
.contains("2") |
||||||
|
.should("exist"); |
||||||
|
cy.getActiveModal() |
||||||
|
.find(".child-card") |
||||||
|
.find("button") |
||||||
|
.should("not.exist"); |
||||||
|
cy.get("body").type("{esc}"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share GRID view : Virtual column validation > belongs to`, () => { |
||||||
|
// belongs to field validation
|
||||||
|
mainPage |
||||||
|
.getCell("City <= Address", 1) |
||||||
|
.click() |
||||||
|
.find("button.mdi-close-thick") |
||||||
|
.should("not.exist"); |
||||||
|
mainPage |
||||||
|
.getCell("City <= Address", 1) |
||||||
|
.click() |
||||||
|
.find("button.mdi-arrow-expand") |
||||||
|
.should("not.exist"); |
||||||
|
mainPage |
||||||
|
.getCell("City <= Address", 1) |
||||||
|
.find(".v-chip") |
||||||
|
.contains("al-Ayn") |
||||||
|
.should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share GRID view : Virtual column validation > many to many`, () => { |
||||||
|
// many-to-many field validation
|
||||||
|
mainPage |
||||||
|
.getCell("Address <=> Staff", 1) |
||||||
|
.click() |
||||||
|
.find("button.mdi-close-thick") |
||||||
|
.should("not.exist"); |
||||||
|
mainPage |
||||||
|
.getCell("Address <=> Staff", 1) |
||||||
|
.click() |
||||||
|
.find("button.mdi-plus") |
||||||
|
.should("not.exist"); |
||||||
|
mainPage |
||||||
|
.getCell("Address <=> Staff", 1) |
||||||
|
.click() |
||||||
|
.find("button.mdi-arrow-expand") |
||||||
|
.click(); |
||||||
|
|
||||||
|
cy.getActiveModal().find("button.mdi-reload").should("exist"); |
||||||
|
cy.getActiveModal() |
||||||
|
.find("button") |
||||||
|
.contains("Link to") |
||||||
|
.should("not.exist"); |
||||||
|
cy.get("body").type("{esc}"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Delete ${viewType.toUpperCase()} view`, () => { |
||||||
|
// go back to base page
|
||||||
|
cy.visit(storedURL, { |
||||||
|
baseUrl: null, |
||||||
|
}); |
||||||
|
|
||||||
|
// number of view entries should be 2 before we delete
|
||||||
|
cy.get(".nc-view-item").its("length").should("eq", 2); |
||||||
|
|
||||||
|
cy.get(".nc-view-delete-icon").eq(0).click({ force: true }); |
||||||
|
cy.toastWait("View deleted successfully"); |
||||||
|
|
||||||
|
// confirm if the number of veiw entries is reduced by 1
|
||||||
|
cy.get(".nc-view-item").its("length").should("eq", 1); |
||||||
|
}); |
||||||
|
}; |
||||||
|
|
||||||
|
// below scenario's will be invoked twice, once for rest & then for graphql
|
||||||
|
viewTest("grid"); |
||||||
|
}); |
||||||
|
|
||||||
|
describe(`${apiType.toUpperCase()} api - Grid view/ row-column update verification`, () => { |
||||||
|
before(() => { |
||||||
|
// Address table has belongs to, has many & many-to-many
|
||||||
|
cy.openTableTab("Country", 25); |
||||||
|
|
||||||
|
cy.saveLocalStorage(); |
||||||
|
// store base URL- to re-visit and delete form view later
|
||||||
|
cy.url().then((url) => { |
||||||
|
storedURL = url; |
||||||
|
generateViewLink("rowColUpdate"); |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
after(() => { |
||||||
|
// close table
|
||||||
|
cy.restoreLocalStorage(); |
||||||
|
cy.visit(storedURL, { |
||||||
|
baseUrl: null, |
||||||
|
}); |
||||||
|
|
||||||
|
// delete row
|
||||||
|
mainPage.getPagination(5).click(); |
||||||
|
// wait for page rendering to complete
|
||||||
|
cy.get(".nc-grid-row").should("have.length", 10); |
||||||
|
mainPage |
||||||
|
.getRow(10) |
||||||
|
.find(".mdi-checkbox-blank-outline") |
||||||
|
.click({ force: true }); |
||||||
|
mainPage.getCell("Country", 10).rightclick(); |
||||||
|
cy.getActiveMenu().contains("Delete Selected Row").click(); |
||||||
|
|
||||||
|
// delete column
|
||||||
|
cy.get(`th:contains('dummy') .mdi-menu-down`) |
||||||
|
.trigger("mouseover") |
||||||
|
.click(); |
||||||
|
cy.get(".nc-column-delete").click(); |
||||||
|
cy.get("button:contains(Confirm)").click(); |
||||||
|
|
||||||
|
cy.toastWait("Update table successful"); |
||||||
|
|
||||||
|
mainPage.deleteCreatedViews(); |
||||||
|
|
||||||
|
// close table
|
||||||
|
cy.closeTableTab("Country"); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Generate default Shared GRID view URL`, () => { |
||||||
|
// add row
|
||||||
|
cy.get(".nc-add-new-row-btn").click({ force: true }); |
||||||
|
cy.get("#data-table-form-Country > input") |
||||||
|
.first() |
||||||
|
.click() |
||||||
|
.type("a"); |
||||||
|
cy.contains("Save Row").filter("button").click({ force: true }); |
||||||
|
cy.toastWait("updated successfully"); |
||||||
|
|
||||||
|
// add column
|
||||||
|
mainPage.addColumn("dummy", "Country"); |
||||||
|
|
||||||
|
// visit public view
|
||||||
|
cy.log(viewURL["rowColUpdate"]); |
||||||
|
cy.restoreLocalStorage(); |
||||||
|
cy.visit(viewURL["rowColUpdate"], { |
||||||
|
baseUrl: null, |
||||||
|
}); //5
|
||||||
|
// wait for public view page to load!
|
||||||
|
// wait for page rendering to complete
|
||||||
|
cy.get(".nc-grid-row").should("have.length", 25); |
||||||
|
}); |
||||||
|
|
||||||
|
it(`Share GRID view : new row visible`, () => { |
||||||
|
// verify row
|
||||||
|
cy.get(`.v-pagination > li:contains('5') button`).click(); |
||||||
|
// wait for page rendering to complete
|
||||||
|
cy.get(".nc-grid-row").should("have.length", 10); |
||||||
|
mainPage.getCell("Country", 10).contains("a").should("exist"); |
||||||
|
}); |
||||||
|
|
||||||
|
it.skip(`Share GRID view : new column visible`, () => { |
||||||
|
// verify column headers
|
||||||
|
cy.get('[data-col="dummy"]').should("exist"); |
||||||
|
}); |
||||||
|
}); |
||||||
|
}; |
||||||
|
|
||||||
|
/** |
||||||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd |
||||||
|
* |
||||||
|
* @author Pranav C Balan <pranavxc@gmail.com> |
||||||
|
* @author Raju Udava <sivadstala@gmail.com> |
||||||
|
* |
||||||
|
* @license GNU AGPL version 3 or any later version |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as |
||||||
|
* published by the Free Software Foundation, either version 3 of the |
||||||
|
* License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* |
||||||
|
*/ |
@ -0,0 +1,61 @@ |
|||||||
|
let t0 = require("./explicitLogin"); |
||||||
|
let t01 = require("../common/00_pre_configurations"); |
||||||
|
let t6b = require("../common/6b_downloadCsv"); |
||||||
|
let t6c = require("../common/6c_swagger_api"); |
||||||
|
let t6d = require("../common/6d_language_validation"); |
||||||
|
let t6e = require("../common/6e_project_operations"); |
||||||
|
let t6f = require("../common/6f_attachments"); |
||||||
|
let t6g = require("../common/6g_base_share"); |
||||||
|
let t7a = require("../common/7a_create_project_from_excel"); |
||||||
|
const { |
||||||
|
setCurrentMode, |
||||||
|
} = require("../../support/page_objects/projectConstants"); |
||||||
|
|
||||||
|
// use 0 as mode to execute individual files (debug mode, skip pre-configs)
|
||||||
|
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
|
||||||
|
const executionMode = 1; |
||||||
|
|
||||||
|
const nocoTestSuite = (apiType, dbType) => { |
||||||
|
setCurrentMode(apiType, dbType); |
||||||
|
if (0 == executionMode) { |
||||||
|
t0.genTest(apiType, dbType); |
||||||
|
} else { |
||||||
|
t01.genTest(apiType, dbType); |
||||||
|
} |
||||||
|
|
||||||
|
t6b.genTest(apiType, dbType); |
||||||
|
t6d.genTest(apiType, dbType); |
||||||
|
t6c.genTest(apiType, dbType); |
||||||
|
t6f.genTest(apiType, dbType); |
||||||
|
t6g.genTest(apiType, dbType); |
||||||
|
// **deletes created project, hence place it @ end
|
||||||
|
t6e.genTest(apiType, dbType); |
||||||
|
|
||||||
|
// intended to keep this after earlier project deletion
|
||||||
|
// creates project using excel & deletes it
|
||||||
|
t7a.genTest(apiType, dbType); |
||||||
|
}; |
||||||
|
|
||||||
|
nocoTestSuite("rest", "postgres"); |
||||||
|
|
||||||
|
/** |
||||||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd |
||||||
|
* |
||||||
|
* @author Raju Udava <sivadstala@gmail.com> |
||||||
|
* |
||||||
|
* @license GNU AGPL version 3 or any later version |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as |
||||||
|
* published by the Free Software Foundation, either version 3 of the |
||||||
|
* License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* |
||||||
|
*/ |
@ -0,0 +1,47 @@ |
|||||||
|
let t0 = require("./explicitLogin"); |
||||||
|
let t01 = require("../common/00_pre_configurations"); |
||||||
|
let t5a = require("../common/5a_user_role"); |
||||||
|
let t5b = require("../common/5b_preview_role"); |
||||||
|
const { |
||||||
|
setCurrentMode, |
||||||
|
} = require("../../support/page_objects/projectConstants"); |
||||||
|
|
||||||
|
// use 0 as mode to execute individual files (debug mode, skip pre-configs)
|
||||||
|
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
|
||||||
|
const executionMode = 1; |
||||||
|
|
||||||
|
const nocoTestSuite = (apiType, dbType) => { |
||||||
|
setCurrentMode(apiType, dbType); |
||||||
|
if (0 == executionMode) { |
||||||
|
t0.genTest(apiType, dbType); |
||||||
|
} else { |
||||||
|
t01.genTest(apiType, dbType); |
||||||
|
} |
||||||
|
|
||||||
|
t5a.genTest(apiType, dbType); |
||||||
|
t5b.genTest(apiType, dbType); |
||||||
|
}; |
||||||
|
|
||||||
|
nocoTestSuite("rest", "postgres"); |
||||||
|
|
||||||
|
/** |
||||||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd |
||||||
|
* |
||||||
|
* @author Raju Udava <sivadstala@gmail.com> |
||||||
|
* |
||||||
|
* @license GNU AGPL version 3 or any later version |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as |
||||||
|
* published by the Free Software Foundation, either version 3 of the |
||||||
|
* License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* |
||||||
|
*/ |
@ -0,0 +1,65 @@ |
|||||||
|
let t0 = require("./explicitLogin"); |
||||||
|
let t01 = require("../common/00_pre_configurations"); |
||||||
|
let t1a = require("../common/1a_table_operations"); |
||||||
|
let t1b = require("../common/1b_table_column_operations"); |
||||||
|
let t1c = require("../common/1c_sql_view"); |
||||||
|
let t1d = require("../common/1d_pg_table_view_drag_drop_reorder"); |
||||||
|
let t1e = require("../common/1e_pg_meta_sync"); |
||||||
|
let t2a = require("../common/2a_table_with_belongs_to_colulmn"); |
||||||
|
let t2b = require("../common/2b_table_with_m2m_column"); |
||||||
|
let t3a = require("../common/3a_filter_sort_fields_operations"); |
||||||
|
let t3b = require("../common/3b_formula_column"); |
||||||
|
let t3c = require("../common/3c_lookup_column"); |
||||||
|
let t3d = require("../common/3d_rollup_column"); |
||||||
|
const { |
||||||
|
setCurrentMode, |
||||||
|
} = require("../../support/page_objects/projectConstants"); |
||||||
|
|
||||||
|
// use 0 as mode to execute individual files (debug mode, skip pre-configs)
|
||||||
|
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
|
||||||
|
const executionMode = 1; |
||||||
|
|
||||||
|
const nocoTestSuite = (apiType, dbType) => { |
||||||
|
setCurrentMode(apiType, dbType); |
||||||
|
if (0 == executionMode) { |
||||||
|
t0.genTest(apiType, dbType); |
||||||
|
} else { |
||||||
|
t01.genTest(apiType, dbType); |
||||||
|
} |
||||||
|
|
||||||
|
t1a.genTest(apiType, dbType); |
||||||
|
t1b.genTest(apiType, dbType); |
||||||
|
t1c.genTest(apiType, dbType); |
||||||
|
t1d.genTest(apiType, dbType); |
||||||
|
t1e.genTest(apiType, dbType); |
||||||
|
t2a.genTest(apiType, dbType); |
||||||
|
t2b.genTest(apiType, dbType); |
||||||
|
t3a.genTest(apiType, dbType); |
||||||
|
// t3b.genTest(apiType, dbType);
|
||||||
|
t3c.genTest(apiType, dbType); |
||||||
|
t3d.genTest(apiType, dbType); |
||||||
|
}; |
||||||
|
|
||||||
|
nocoTestSuite("rest", "postgres"); |
||||||
|
|
||||||
|
/** |
||||||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd |
||||||
|
* |
||||||
|
* @author Raju Udava <sivadstala@gmail.com> |
||||||
|
* |
||||||
|
* @license GNU AGPL version 3 or any later version |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as |
||||||
|
* published by the Free Software Foundation, either version 3 of the |
||||||
|
* License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* |
||||||
|
*/ |
@ -0,0 +1,55 @@ |
|||||||
|
let t0 = require("./explicitLogin"); |
||||||
|
let t01 = require("../common/00_pre_configurations"); |
||||||
|
let t4a = require("../common/4a_table_view_grid_gallery_form"); |
||||||
|
let t4b = require("../common/4b_table_view_share"); |
||||||
|
let t4c = require("../common/4c_form_view_detailed"); |
||||||
|
let t4d = require("../common/4d_table_view_grid_locked"); |
||||||
|
let t4e = require("../common/4e_form_view_share"); |
||||||
|
let t4f = require("../common/4f_pg_grid_view_share"); |
||||||
|
const { |
||||||
|
setCurrentMode, |
||||||
|
} = require("../../support/page_objects/projectConstants"); |
||||||
|
|
||||||
|
// use 0 as mode to execute individual files (debug mode, skip pre-configs)
|
||||||
|
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
|
||||||
|
const executionMode = 1; |
||||||
|
|
||||||
|
const nocoTestSuite = (apiType, dbType) => { |
||||||
|
setCurrentMode(apiType, dbType); |
||||||
|
if (0 == executionMode) { |
||||||
|
t0.genTest(apiType, dbType); |
||||||
|
} else { |
||||||
|
t01.genTest(apiType, dbType); |
||||||
|
} |
||||||
|
|
||||||
|
t4a.genTest(apiType, dbType); |
||||||
|
t4b.genTest(apiType, dbType); |
||||||
|
t4c.genTest(apiType, dbType); |
||||||
|
t4d.genTest(apiType, dbType); |
||||||
|
t4e.genTest(apiType, dbType); |
||||||
|
t4f.genTest(apiType, dbType); |
||||||
|
}; |
||||||
|
|
||||||
|
nocoTestSuite("rest", "postgres"); |
||||||
|
|
||||||
|
/** |
||||||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd |
||||||
|
* |
||||||
|
* @author Raju Udava <sivadstala@gmail.com> |
||||||
|
* |
||||||
|
* @license GNU AGPL version 3 or any later version |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as |
||||||
|
* published by the Free Software Foundation, either version 3 of the |
||||||
|
* License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* |
||||||
|
*/ |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue