Browse Source

Merge branch 'develop' into feat/kanban-view

pull/3563/head
Wing-Kam Wong 2 years ago
parent
commit
ac750fb3a0
  1. 122
      packages/nc-gui/lang/de.json
  2. 5
      packages/nc-gui/lib/enums.ts
  3. 8
      packages/nc-gui/plugins/a.i18n.ts
  4. 6
      packages/nc-gui/plugins/state.ts
  5. 8
      packages/noco-docs/content/en/FAQs.md
  6. 14
      packages/noco-docs/content/en/setup-and-usages/share-base.md
  7. 687
      scripts/cypress/integration/common/9b_ERD.js
  8. 3
      scripts/cypress/integration/test/pg-restMisc.js
  9. 4
      scripts/cypress/integration/test/xcdb-restMisc.js
  10. 47
      scripts/cypress/support/page_objects/projectConstants.js

122
packages/nc-gui/lang/de.json

@ -6,7 +6,7 @@
"close": "Schließen", "close": "Schließen",
"yes": "Ja", "yes": "Ja",
"no": "Nein", "no": "Nein",
"ok": "OK", "ok": "Ok",
"and": "Und", "and": "Und",
"or": "Oder", "or": "Oder",
"add": "Hinzufügen", "add": "Hinzufügen",
@ -55,19 +55,19 @@
"notification": "Benachrichtigung", "notification": "Benachrichtigung",
"reference": "Referenz", "reference": "Referenz",
"function": "Funktion", "function": "Funktion",
"confirm": "Confirm", "confirm": "Bestätigen",
"generate": "Generate", "generate": "Generieren",
"copy": "Copy", "copy": "Kopieren",
"misc": "Miscellaneous", "misc": "Sonstiges",
"lock": "Lock", "lock": "Sperren",
"unlock": "Unlock", "unlock": "Entsperren",
"credentials": "Credentials", "credentials": "Anmeldeinformationen",
"help": "Help", "help": "Hilfe",
"questions": "Questions", "questions": "Fragen",
"reachOut": "Reach out here", "reachOut": "Erreichen sie uns hier",
"betaNote": "This feature is currently in beta.", "betaNote": "Diese Funktion befindet sich derzeit in der Beta.",
"moreInfo": "More information can be found here", "moreInfo": "Mehr Informationen können hier gefunden werden",
"logs": "Logs" "logs": "Protokolle"
}, },
"objects": { "objects": {
"project": "Projekt", "project": "Projekt",
@ -104,10 +104,10 @@
"commenter": "Kommentator", "commenter": "Kommentator",
"viewer": "Zuschauer" "viewer": "Zuschauer"
}, },
"sqlVIew": "SQL View" "sqlVIew": "SQL Ansicht"
}, },
"datatype": { "datatype": {
"ID": "ID", "ID": "Nummer",
"ForeignKey": "Unbekannter Schlüssel", "ForeignKey": "Unbekannter Schlüssel",
"SingleLineText": "Einzeiliger Text", "SingleLineText": "Einzeiliger Text",
"LongText": "Langer Text", "LongText": "Langer Text",
@ -129,7 +129,7 @@
"Duration": "Dauer", "Duration": "Dauer",
"Rating": "Klassifizierung", "Rating": "Klassifizierung",
"Formula": "Formel", "Formula": "Formel",
"Rollup": "Rollup", "Rollup": "Zusammenfassung",
"Count": "Zählen", "Count": "Zählen",
"Lookup": "Nachschlagen", "Lookup": "Nachschlagen",
"DateTime": "Datum/Zeit", "DateTime": "Datum/Zeit",
@ -158,7 +158,7 @@
"isNotNull": "ist nicht Null" "isNotNull": "ist nicht Null"
}, },
"title": { "title": {
"erdView": "ERD View", "erdView": "ERD Ansicht",
"newProj": "Neues Projekt", "newProj": "Neues Projekt",
"myProject": "Meine Projekte", "myProject": "Meine Projekte",
"formTitle": "Formular Titel", "formTitle": "Formular Titel",
@ -166,7 +166,7 @@
"lockedView": "Gesperrte Ansicht", "lockedView": "Gesperrte Ansicht",
"personalView": "Persönliche Ansicht", "personalView": "Persönliche Ansicht",
"appStore": "App-Store", "appStore": "App-Store",
"teamAndAuth": "Team & Auth", "teamAndAuth": "Team & Authentifizierung",
"rolesUserMgmt": "Rollen- & Benutzermanagement", "rolesUserMgmt": "Rollen- & Benutzermanagement",
"userMgmt": "Benutzermanagement", "userMgmt": "Benutzermanagement",
"apiTokenMgmt": "API-Tokens-Management", "apiTokenMgmt": "API-Tokens-Management",
@ -177,7 +177,7 @@
"exportImportMeta": "Metadaten exportieren / importieren", "exportImportMeta": "Metadaten exportieren / importieren",
"uiACL": "UI-Zugangskontrolle", "uiACL": "UI-Zugangskontrolle",
"metaOperations": "Metadatenoperationen", "metaOperations": "Metadatenoperationen",
"audit": "Audit", "audit": "Revisionen",
"auditLogs": "Audit-Log", "auditLogs": "Audit-Log",
"sqlMigrations": "SQL-Migrationen", "sqlMigrations": "SQL-Migrationen",
"dbCredentials": "Datenbank-Anmeldeinformationen", "dbCredentials": "Datenbank-Anmeldeinformationen",
@ -185,17 +185,17 @@
"headCreateProject": "Projekt erstellen | NocoDB", "headCreateProject": "Projekt erstellen | NocoDB",
"headLogin": "Anmelden | NocoDB", "headLogin": "Anmelden | NocoDB",
"resetPassword": "Passwort zurücksetzen", "resetPassword": "Passwort zurücksetzen",
"teamAndSettings": "Team & Settings", "teamAndSettings": "Team & Einstellungen",
"apiDocs": "API Docs", "apiDocs": "API Dokumentation",
"importFromAirtable": "Import aus Airtable", "importFromAirtable": "Import aus Airtable",
"generateToken": "Generate Token", "generateToken": "Token generieren",
"APIsAndSupport": "APIs & Support", "APIsAndSupport": "APIs & Support",
"helpCenter": "Help center", "helpCenter": "Hilfecenter",
"swaggerDocumentation": "Swagger Documentation", "swaggerDocumentation": "Swagger Dokumentation",
"quickImportFrom": "Quick Import From", "quickImportFrom": "Schnell importieren von",
"quickImport": "Quick Import", "quickImport": "Schnell Importieren",
"advancedSettings": "Advanced Settings", "advancedSettings": "Erweiterte Einstellungen",
"codeSnippet": "Code Snippet" "codeSnippet": "Code Ausschnitt"
}, },
"labels": { "labels": {
"notifyVia": "Benachrichtigen mit", "notifyVia": "Benachrichtigen mit",
@ -230,7 +230,7 @@
"chat": "Chat", "chat": "Chat",
"email": "Email", "email": "Email",
"storage": "Speicher", "storage": "Speicher",
"uiAcl": "UI-ACL", "uiAcl": "Oberflächenzugriffskontrollliste",
"models": "Modelle", "models": "Modelle",
"syncState": "Sync-Status", "syncState": "Sync-Status",
"created": "Erstellt", "created": "Erstellt",
@ -239,7 +239,7 @@
"aggregateFunction": "Globale Funktion", "aggregateFunction": "Globale Funktion",
"dbCreateIfNotExists": "Datenbank: Erstellen, falls nicht vorhanden", "dbCreateIfNotExists": "Datenbank: Erstellen, falls nicht vorhanden",
"clientKey": "Client-Schlüssel", "clientKey": "Client-Schlüssel",
"clientCert": "Client Cert", "clientCert": "Client Zertifikat",
"serverCA": "Server CA", "serverCA": "Server CA",
"requriedCa": "Erforderliches CA", "requriedCa": "Erforderliches CA",
"requriedIdentity": "Erforderliche Identität", "requriedIdentity": "Erforderliche Identität",
@ -263,15 +263,15 @@
"childColumn": "Child-Spalte", "childColumn": "Child-Spalte",
"onUpdate": "Update", "onUpdate": "Update",
"onDelete": "Löschen", "onDelete": "Löschen",
"account": "Account", "account": "Benutzerkonto",
"language": "Language", "language": "Sprache",
"primaryColor": "Primary Color", "primaryColor": "Primärfarbe",
"accentColor": "Accent Color", "accentColor": "Akzentfarbe",
"customTheme": "Custom Theme", "customTheme": "Benutzerdefiniertes Theme",
"requestDataSource": "Request a data source you need?", "requestDataSource": "Eine benötigte Datenquelle anfragen?",
"apiKey": "API Key", "apiKey": "API Schlüssel",
"sharedBase": "Shared Base", "sharedBase": "Geteilte Basis",
"importData": "Import Data", "importData": "Daten Importieren",
"importSecondaryViews": "Import Secondary Views", "importSecondaryViews": "Import Secondary Views",
"importRollupColumns": "Import Rollup Columns", "importRollupColumns": "Import Rollup Columns",
"importLookupColumns": "Import Lookup Columns", "importLookupColumns": "Import Lookup Columns",
@ -569,17 +569,17 @@
"requriedFieldsCantBeMoved": "Required field can't be moved", "requriedFieldsCantBeMoved": "Required field can't be moved",
"updateNotAllowedWithoutPK": "Update not allowed for table which doesn't have primary key", "updateNotAllowedWithoutPK": "Update not allowed for table which doesn't have primary key",
"autoIncFieldNotEditable": "Auto increment field is not editable", "autoIncFieldNotEditable": "Auto increment field is not editable",
"editingPKnotSupported": "Editing primary key not supported", "editingPKnotSupported": "Bearbeiten des Primärschlüssels nicht unterstützt",
"deletedCache": "Deleted cache successfully", "deletedCache": "Cache erfolgreich gelöscht",
"cacheEmpty": "Cache is empty", "cacheEmpty": "Cache ist leer",
"exportedCache": "Exported Cache Successfully", "exportedCache": "Cache erfolgreich exportiert",
"valueAlreadyInList": "This value is already in the list", "valueAlreadyInList": "Dieser Wert ist bereits in der Liste vorhanden",
"noColumnsToUpdate": "No columns to update", "noColumnsToUpdate": "Keine Spalten zu aktualisieren",
"tableDeleted": "Deleted table successfully", "tableDeleted": "Tabelle erfolgreich gelöscht",
"generatePublicShareableReadonlyBase": "Generate publicly shareable readonly base", "generatePublicShareableReadonlyBase": "Öffentlich lesbare Basis generieren",
"deleteViewConfirmation": "Are you sure you want to delete this view?", "deleteViewConfirmation": "Sind Sie sicher, dass Sie diese Ansicht löschen möchten?",
"deleteTableConfirmation": "Do you want to delete the table", "deleteTableConfirmation": "Möchten Sie die Tabelle löschen",
"showM2mTables": "Show M2M Tables" "showM2mTables": "M2M Tabellen anzeigen"
}, },
"error": { "error": {
"searchProject": "Ihre Suche nach {search} fand keine Ergebnisse", "searchProject": "Ihre Suche nach {search} fand keine Ergebnisse",
@ -595,17 +595,17 @@
"passwdRequired": "Passwort ist erforderlich", "passwdRequired": "Passwort ist erforderlich",
"passwdLength": "Ihr Passwort muß mindestens 8 Zeichen haben", "passwdLength": "Ihr Passwort muß mindestens 8 Zeichen haben",
"passwdMismatch": "Passwörter stimmen nicht überein", "passwdMismatch": "Passwörter stimmen nicht überein",
"completeRuleSet": "At least 8 characters with one Uppercase, one number and one special character", "completeRuleSet": "Mindestens 8 Zeichen mit einem Großbuchstaben, einer Zahl und einem Sonderzeichen",
"atLeast8Char": "At least 8 characters", "atLeast8Char": "Mindestens 8 Zeichen",
"atLeastOneUppercase": "One Uppercase letter", "atLeastOneUppercase": "Ein Großbuchstaben",
"atLeastOneNumber": "One Number", "atLeastOneNumber": "Eine Nummer",
"atLeastOneSpecialChar": "One special character", "atLeastOneSpecialChar": "Ein Sonderzeichen",
"allowedSpecialCharList": "Allowed special character list" "allowedSpecialCharList": "Erlaubte Sonderzeichenliste"
}, },
"invalidURL": "Invalid URL", "invalidURL": "Ungültige URL",
"internalError": "Some internal error occurred", "internalError": "Interner Fehler aufgetreten",
"templateGeneratorNotFound": "Template Generator cannot be found!", "templateGeneratorNotFound": "Template-Generator kann nicht gefunden werden!",
"fileUploadFailed": "Failed to upload file", "fileUploadFailed": "Fehler beim Hochladen der Datei",
"primaryColumnUpdateFailed": "Failed to update primary column", "primaryColumnUpdateFailed": "Failed to update primary column",
"formDescriptionTooLong": "Data too long for Form Description", "formDescriptionTooLong": "Data too long for Form Description",
"columnsRequired": "Following columns are required", "columnsRequired": "Following columns are required",

5
packages/nc-gui/lib/enums.ts

@ -55,6 +55,11 @@ export enum Language {
'zh-Hant' = '繁體中文', 'zh-Hant' = '繁體中文',
} }
export enum LanguageAlias {
zn_CN = 'zh-Hans',
zh_TW = 'zh-Hant',
}
export enum NavigateDir { export enum NavigateDir {
NEXT, NEXT,
PREV, PREV,

8
packages/nc-gui/plugins/a.i18n.ts

@ -2,6 +2,7 @@ import { defineNuxtPlugin } from 'nuxt/app'
import { createI18n } from 'vue-i18n' import { createI18n } from 'vue-i18n'
import { nextTick } from 'vue' import { nextTick } from 'vue'
import type { Language, NocoI18n } from '~/lib' import type { Language, NocoI18n } from '~/lib'
import { LanguageAlias } from '~/lib'
let globalI18n: NocoI18n let globalI18n: NocoI18n
@ -26,7 +27,12 @@ export async function setI18nLanguage(locale: keyof typeof Language, i18n = glob
i18n.global.locale.value = locale i18n.global.locale.value = locale
} }
export async function loadLocaleMessages(locale: keyof typeof Language, i18n: NocoI18n = globalI18n) { export async function loadLocaleMessages(
locale: keyof typeof Language | keyof typeof LanguageAlias,
i18n: NocoI18n = globalI18n,
) {
if (Object.keys(LanguageAlias).includes(locale)) locale = LanguageAlias[locale as keyof typeof LanguageAlias]
// load locale messages with dynamic import // load locale messages with dynamic import
const messages = await import(`../lang/${locale}.json`) const messages = await import(`../lang/${locale}.json`)

6
packages/nc-gui/plugins/state.ts

@ -1,5 +1,6 @@
import { defineNuxtPlugin, useApi, useGlobal } from '#imports' import { defineNuxtPlugin, useApi, useGlobal } from '#imports'
import { loadLocaleMessages, setI18nLanguage } from '~/plugins/a.i18n' import { loadLocaleMessages, setI18nLanguage } from '~/plugins/a.i18n'
import { Language, LanguageAlias } from '~/lib'
/** /**
* Initialize global state and watches for changes * Initialize global state and watches for changes
@ -18,7 +19,10 @@ export default defineNuxtPlugin(async () => {
const { api } = useApi() const { api } = useApi()
const currentLang = state.lang.value let currentLang = state.lang.value
/** fall back to EN language if the current language cannot be found in Language or LanguagesAlias */
if (![...Object.keys(Language), ...Object.keys(LanguageAlias)].includes(currentLang)) state.lang.value = currentLang = 'en'
/** force load initial locale messages */ /** force load initial locale messages */
await loadLocaleMessages(currentLang) await loadLocaleMessages(currentLang)

8
packages/noco-docs/content/en/FAQs.md

@ -23,13 +23,13 @@ menuTitle: 'FAQs'
- You can hover the NocoDB icon on the top left corner or check ``PackageVersion`` in Project info. - You can hover the NocoDB icon on the top left corner or check ``PackageVersion`` in Project info.
![image](https://user-images.githubusercontent.com/35857179/164968969-da53adda-97fc-4a79-9331-039ddef75a13.png) ![image](https://user-images.githubusercontent.com/35857179/192435277-1b1715b9-5885-4e15-861f-4f95bb60294b.png)
## How to check my Project info ? ## How to check my Project info ?
- You can click on top right icon and click ``Copy Project Info``. - You can click on top right icon and click ``Copy Project Info``.
![image](https://user-images.githubusercontent.com/35857179/164968940-6c987863-e7d8-4b44-a46d-2f755825af0a.png) ![image](https://user-images.githubusercontent.com/35857179/192435381-e01013b1-7f87-4d3f-b443-420e685f8c41.png)
You should see the similar result as below. You should see the similar result as below.
@ -39,9 +39,9 @@ Arch: **arm64**
Platform: **darwin** Platform: **darwin**
Docker: **false** Docker: **false**
Database: **mysql2** Database: **mysql2**
ProjectOnRootDB: **false** ProjectOnRootDB: **true**
RootDB: **mysql2** RootDB: **mysql2**
PackageVersion: **0.90.0** PackageVersion: **0.97.0**
``` ```
## What is available in free version ? ## What is available in free version ?

14
packages/noco-docs/content/en/setup-and-usages/share-base.md

@ -6,22 +6,22 @@ category: "Product"
menuTitle: "Share Base" menuTitle: "Share Base"
--- ---
## Generate `Share base` ## Generate Share base
- Open Project - Open Project
- Click on `Share` button on top right tool bar - Click on `Invite Team` button on bottom left tool bar
![image](https://user-images.githubusercontent.com/35857179/161957411-ee9ec53d-4745-43c3-99f2-600cb20923e7.png) ![image](https://user-images.githubusercontent.com/35857179/192435607-ee00326e-3890-4478-8260-e5c7c286f03a.png)
- Under `Shared base link` tab and toggle from `Disabled Share base` to `Anyone with the link` - Under `Shared base link` tab and toggle from `Disabled Share base` to `Anyone with the link`
![Screenshot 2022-02-19 at 11 16 02 AM](https://user-images.githubusercontent.com/86527202/154789352-87e65fcc-fbe5-48f0-a1e1-e54dce91a1f3.png) ![image](https://user-images.githubusercontent.com/35857179/192435735-71fc161b-48fc-49e2-94ad-55713932f10a.png)
- Share base link generated is displayed over & can be used to share this project to others in the team [Selection (2) in the image below] - Share base link generated is displayed over & can be used to share this project to others in the team [Selection (2) in the image below]
![Screenshot 2022-02-19 at 12 01 58 PM](https://user-images.githubusercontent.com/86527202/154789725-a1194e30-3101-423a-bd5c-25009c361b96.png) ![Screenshot 2022-02-19 at 12 01 58 PM](https://user-images.githubusercontent.com/86527202/154789725-a1194e30-3101-423a-bd5c-25009c361b96.png)
## Modify `Share base` ## Modify Share base
Modifying `Share base` will invalidate the `Share base` link generated previously and will generate a new link. Modifying `Share base` will invalidate the `Share base` link generated previously and will generate a new link.
@ -29,7 +29,7 @@ Modifying `Share base` will invalidate the `Share base` link generated previousl
- Click on 'Share' button on top right tool bar - Click on 'Share' button on top right tool bar
- Click on 'Reload' button on Quick menu (next to Shared base link) - Click on 'Reload' button on Quick menu (next to Shared base link)
## Disable `Share base` ## Disable Share base
Disabling `Share base` will invalidate the generated `Share base` link Disabling `Share base` will invalidate the generated `Share base` link
@ -37,7 +37,7 @@ Disabling `Share base` will invalidate the generated `Share base` link
- Click on 'Share' button on top right tool bar - Click on 'Share' button on top right tool bar
- Under `Shared base link` and toggle from `Anyone with the link` to `Disable Share base` - Under `Shared base link` and toggle from `Anyone with the link` to `Disable Share base`
## `Share base` Access Permissions ## Share base Access Permissions
Shared base can be configured as Shared base can be configured as

687
scripts/cypress/integration/common/9b_ERD.js

@ -1,28 +1,45 @@
import { mainPage, settingsPage } from "../../support/page_objects/mainPage"; import { mainPage } from "../../support/page_objects/mainPage";
import { loginPage, projectsPage } from "../../support/page_objects/navigation"; import {loginPage} from "../../support/page_objects/navigation";
import { import { isTestSuiteActive, mysqlSakilaSqlViews, mysqlSakilaTables, pgSakilaSqlViews, pgSakilaTables, sqliteSakilaSqlViews } from "../../support/page_objects/projectConstants";
isTestSuiteActive,
sakilaSqlViews, import {getProjectString} from "../../support/page_objects/projectConstants";
sakilaTables,
} from "../../support/page_objects/projectConstants";
export const genTest = (apiType, dbType) => { export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return; if (!isTestSuiteActive(apiType, dbType)) return;
let projectId;
let sakilaTables, sakilaSqlViews;
describe(`${apiType.toUpperCase()} ERD`, () => { describe(`${apiType.toUpperCase()} ERD`, () => {
// before(() => { before(() => {
cy.restoreLocalStorage();
// loginPage.loginAndOpenProject(apiType, dbType); // loginPage.loginAndOpenProject(apiType, dbType);
// cy.openTableTab("Country", 25);
// cy.saveLocalStorage(); cy.openTableTab("Country", 25);
// }); projectId = getProjectString()
cy.log('erd:getProjectString' + projectId)
if (dbType === "postgres") {
sakilaTables = pgSakilaTables;
sakilaSqlViews = pgSakilaSqlViews;
} else if(dbType === "mysql") {
sakilaTables = mysqlSakilaTables;
sakilaSqlViews = mysqlSakilaSqlViews;
} else if(dbType === "xcdb") {
sakilaTables = mysqlSakilaTables.map((tableName) => `${projectId}${tableName}`);
sakilaSqlViews = sqliteSakilaSqlViews.map((viewName) => `${projectId}${viewName}`);
}
cy.saveLocalStorage();
});
beforeEach(() => { beforeEach(() => {
cy.restoreLocalStorage(); cy.restoreLocalStorage();
}); })
afterEach(() => { afterEach(() => {
cy.saveLocalStorage(); cy.saveLocalStorage();
}); })
after(() => { after(() => {
cy.restoreLocalStorage(); cy.restoreLocalStorage();
@ -33,7 +50,7 @@ export const genTest = (apiType, dbType) => {
// Test cases // Test cases
it(`Enable MM setting Open Table ERD`, () => { it(`Enable MM setting Open Table ERD`, () => {
cy.openTableTab("Country", 25); // cy.openTableTab("Country", 25);
mainPage.toggleShowMMSetting(); mainPage.toggleShowMMSetting();
mainPage.openErdTab(); mainPage.openErdTab();
@ -42,408 +59,500 @@ export const genTest = (apiType, dbType) => {
it(`Verify ERD Context menu in all table view`, () => { it(`Verify ERD Context menu in all table view`, () => {
mainPage.openErdTab(); mainPage.openErdTab();
cy.get(".nc-erd-context-menu").should("be.visible"); cy.get('.nc-erd-context-menu').should('be.visible');
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-histogram').should('be.visible');
.get(".nc-erd-histogram") cy.get('.nc-erd-context-menu').find('.ant-checkbox').should('have.length', 3);
.should("be.visible"); cy.get('.nc-erd-context-menu').find('.ant-checkbox').eq(0).should('have.class', 'ant-checkbox-checked');
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').find('.ant-checkbox').eq(1).should('have.class', 'ant-checkbox-checked');
.find(".ant-checkbox") cy.get('.nc-erd-context-menu').find('.ant-checkbox').eq(2).should('not.have.class', 'ant-checkbox-checked');
.should("have.length", 3);
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').find('.nc-erd-showColumns-label').dblclick();
.find(".ant-checkbox") cy.get('.nc-erd-context-menu').find('.ant-checkbox').should('have.length', 5);
.eq(0)
.should("have.class", "ant-checkbox-checked");
cy.get(".nc-erd-context-menu")
.find(".ant-checkbox")
.eq(1)
.should("have.class", "ant-checkbox-checked");
cy.get(".nc-erd-context-menu")
.find(".ant-checkbox")
.eq(2)
.should("not.have.class", "ant-checkbox-checked");
cy.get(".nc-erd-context-menu")
.find(".nc-erd-showColumns-label")
.dblclick();
cy.get(".nc-erd-context-menu")
.find(".ant-checkbox")
.should("have.length", 5);
}); });
it("Verify ERD of all tables view and verify columns of actor and payment with default config", () => { it("Verify ERD of all tables view and verify columns of actor and payment with default config", () => {
cy.get(".nc-erd-vue-flow") if(dbType === "mysql") {
.find(".nc-erd-table-node") cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 12)
.should("have.length", 12); cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 14)
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 11)
.find(".vue-flow__edge") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 17)
.should("have.length", 14); } else if (dbType === "postgres") {
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 17)
.find(".nc-erd-edge-circle") cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 32)
.should("have.length", 11); cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 29)
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 35)
.find(".nc-erd-edge-rect") } else {
.should("have.length", 17); cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 12)
cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 14)
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 11)
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 17)
}
for(const tableName of sakilaTables) { for(const tableName of sakilaTables) {
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${tableName}`).should('exist');
.find(`.nc-erd-table-node-${tableName}`)
.should("exist");
} }
// Actor table // Actor table
[ [
"actor_id", 'actor_id',
"first_name", 'first_name',
"last_name", 'last_name',
"last_update", 'last_update',
"film_list", 'film_list'
].forEach((colTitle) => { ].forEach((colTitle) => {
cy.get(".nc-erd-vue-flow") if (dbType === "xcdb") {
.find(`.nc-erd-table-node-actor`) cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}actor`).find(`.nc-erd-table-node-${projectId}actor-column-${colTitle}`).should('exist');
.find(`.nc-erd-table-node-actor-column-${colTitle}`) } else {
.should("exist"); cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-actor`).find(`.nc-erd-table-node-actor-column-${colTitle}`).should('exist');
}
}); });
// Payment table // Payment table
if(dbType === "mysql") {
[ [
"payment_id", 'payment_id',
"customer_id", 'customer_id',
"staff_id", 'staff_id',
"rental_id", 'rental_id',
"amount", 'amount',
"payment_date", 'payment_date',
"last_update", 'last_update',
"customer", 'customer',
"rental", 'rental',
"staff", 'staff'
].forEach((colTitle) => { ]
cy.get(".nc-erd-vue-flow") .forEach((colTitle) => {
.find(`.nc-erd-table-node-payment`) cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-payment`).find(`.nc-erd-table-node-payment-column-${colTitle}`).should('exist');
.find(`.nc-erd-table-node-payment-column-${colTitle}`) });
.should("exist"); } else if(dbType === "postgres") {
[
'payment_id',
'customer_id',
'staff_id',
'rental_id',
'amount',
'payment_date',
'customer',
'rental',
'staff'
]
.forEach((colTitle) => {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-payment`).find(`.nc-erd-table-node-payment-column-${colTitle}`).should('exist');
});
} else {
[
'payment_id',
'customer_id',
'staff_id',
'rental_id',
'amount',
'payment_date',
'last_update',
'customer',
'rental',
'staff'
]
.forEach((colTitle) => {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}payment`).find(`.nc-erd-table-node-${projectId}payment-column-${colTitle}`).should('exist');
}); });
}
}); });
it("Verify ERD of all tables view and verify columns of actor and payment with default config with showAllColumn disabled", () => { it("Verify ERD of all tables view and verify columns of actor and payment with default config with showAllColumn disabled", () => {
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-showColumns-checkbox').click();
.get(".nc-erd-showColumns-checkbox") cy.get('.nc-erd-showPkAndFk-checkbox-disabled').should('exist');
.click(); cy.get('.nc-erd-showPkAndFk-checkbox-unchecked').should('exist');
cy.get(".nc-erd-showPkAndFk-checkbox-disabled").should("exist");
cy.get(".nc-erd-showPkAndFk-checkbox-unchecked").should("exist");
// Actor table // Actor table
["film_list"].forEach((colTitle) => { [
cy.get(".nc-erd-vue-flow") 'film_list'
.find(`.nc-erd-table-node-actor`) ].forEach((colTitle) => {
.find(`.nc-erd-table-node-actor-column-${colTitle}`) if(dbType === "xcdb") {
.should("exist"); cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}actor`).find(`.nc-erd-table-node-${projectId}actor-column-${colTitle}`).should('exist');
} else {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-actor`).find(`.nc-erd-table-node-actor-column-${colTitle}`).should('exist');
}
}); });
// Payment table // Payment table
["customer", "rental", "staff"].forEach((colTitle) => { [
cy.get(".nc-erd-vue-flow") 'customer',
.find(`.nc-erd-table-node-payment`) 'rental',
.find(`.nc-erd-table-node-payment-column-${colTitle}`) 'staff'
.should("exist"); ].forEach((colTitle) => {
if(dbType === "xcdb") {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}payment`).find(`.nc-erd-table-node-${projectId}payment-column-${colTitle}`).should('exist');
} else {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-payment`).find(`.nc-erd-table-node-payment-column-${colTitle}`).should('exist');
}
}); });
}); });
it("Verify ERD of all tables view and verify columns of actor and payment with default config with showPkAndFk disabled", () => { it("Verify ERD of all tables view and verify columns of actor and payment with default config with showPkAndFk disabled", () => {
// enable showAllColumn // enable showAllColumn
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-showColumns-checkbox').click();
.get(".nc-erd-showColumns-checkbox") cy.get('.nc-erd-context-menu').get('.nc-erd-showPkAndFk-checkbox').click();
.click();
cy.get(".nc-erd-context-menu")
.get(".nc-erd-showPkAndFk-checkbox")
.click();
// Actor table // Actor table
["last_name", "last_update", "film_list"].forEach((colTitle) => { [
cy.get(".nc-erd-vue-flow") 'last_name',
.find(`.nc-erd-table-node-actor`) 'last_update',
.find(`.nc-erd-table-node-actor-column-${colTitle}`) 'film_list'
.should("exist"); ].forEach((colTitle) => {
if(dbType === "xcdb") {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}actor`).find(`.nc-erd-table-node-${projectId}actor-column-${colTitle}`).should('exist');
} else {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-actor`).find(`.nc-erd-table-node-actor-column-${colTitle}`).should('exist');
}
}); });
// Payment table // Payment table
if(dbType === "mysql") {
[ [
"amount", 'amount',
"payment_date", 'payment_date',
"last_update", 'last_update',
"customer", 'customer',
"rental", 'rental',
"staff", 'staff'
].forEach((colTitle) => { ].forEach((colTitle) => {
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-payment`).find(`.nc-erd-table-node-payment-column-${colTitle}`).should('exist');
.find(`.nc-erd-table-node-payment`)
.find(`.nc-erd-table-node-payment-column-${colTitle}`)
.should("exist");
}); });
} else if(dbType === "postgres") {
[
'amount',
'payment_date',
'customer',
'rental',
'staff'
].forEach((colTitle) => {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-payment`).find(`.nc-erd-table-node-payment-column-${colTitle}`).should('exist');
});
} else {
[
'amount',
'payment_date',
'last_update',
'customer',
'rental',
'staff'
].forEach((colTitle) => {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}payment`).find(`.nc-erd-table-node-${projectId}payment-column-${colTitle}`).should('exist');
});
}
}); });
it("Verify ERD of all tables view with sql grid on and verify columns of ActorInfo", () => { it("Verify ERD of all tables view with sql grid on and verify columns of ActorInfo", () => {
cy.get(".nc-erd-context-menu").get(".nc-erd-showViews-checkbox").click(); cy.get('.nc-erd-context-menu').get('.nc-erd-showViews-checkbox').click();
cy.get(".nc-erd-vue-flow") if(dbType === "mysql") {
.find(".nc-erd-table-node") cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 19)
.should("have.length", 19); cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 14)
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 11)
.find(".vue-flow__edge") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 17)
.should("have.length", 14); } else if(dbType === "postgres") {
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 24)
.find(".nc-erd-edge-circle") cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 32)
.should("have.length", 11); cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 29)
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 35)
.find(".nc-erd-edge-rect") } else {
.should("have.length", 17); cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 19)
cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 14)
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 11)
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 17)
}
for(const tableName of sakilaTables) { for(const tableName of sakilaTables) {
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${tableName}`).should('exist');
.find(`.nc-erd-table-node-${tableName}`)
.should("exist");
} }
for(const tableName of sakilaSqlViews) { for(const tableName of sakilaSqlViews) {
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${tableName}`).should('exist');
.find(`.nc-erd-table-node-${tableName}`)
.should("exist");
} }
// ActorInfo SQL View // ActorInfo SQL View
["actor_id", "first_name", "last_name", "film_info"].forEach( let actorInfoColumns;
(colTitle) => { if(dbType === "xcdb") {
cy.get(".nc-erd-vue-flow") actorInfoColumns = [
.find(`.nc-erd-table-node-actor_info`) 'ID',
.find(`.nc-erd-table-node-actor_info-column-${colTitle}`) 'name',
.should("exist"); 'address',
'zip_code',
'phone',
'city',
'country',
'SID',
];
} else {
actorInfoColumns = [
'actor_id',
'first_name',
'last_name',
'film_info'
];
}
actorInfoColumns.forEach((colTitle) => {
if(dbType === "xcdb") {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}actor_info`).find(`.nc-erd-table-node-${projectId}actor_info-column-${colTitle}`).should('exist');
} else {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-actor_info`).find(`.nc-erd-table-node-actor_info-column-${colTitle}`).should('exist');
} }
); })
}); });
it("Verify show MM tables", () => { it("Verify show MM tables", () => {
cy.get(".nc-erd-vue-flow") if(dbType === "xcdb") {
.find(`.nc-erd-table-node-store`) cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}store`).should('not.exist');
.should("not.exist"); } else {
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-store`).should('not.exist');
}
// disable showViews // disable showViews
cy.get(".nc-erd-context-menu").get(".nc-erd-showViews-checkbox").click(); cy.get('.nc-erd-context-menu').get('.nc-erd-showViews-checkbox').click();
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-showMMTables-checkbox').click();
.get(".nc-erd-showMMTables-checkbox")
.click(); if(dbType === "mysql") {
cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 16)
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 26)
.find(".nc-erd-table-node") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 22)
.should("have.length", 16); cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 30)
cy.get(".nc-erd-vue-flow") } else if(dbType === "postgres") {
.find(".vue-flow__edge") cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 21)
.should("have.length", 26); cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 44)
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 40)
.find(".nc-erd-edge-circle") cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 48)
.should("have.length", 22); } else {
cy.get(".nc-erd-vue-flow") cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 16)
.find(".nc-erd-edge-rect") cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 26)
.should("have.length", 30); cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 22)
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 30)
}
// Check if store table is present // Check if store table is present
cy.get(".nc-erd-vue-flow") if(dbType === "xcdb") {
.find(`.nc-erd-table-node-store`) cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${projectId}store`).should('exist');
.should("exist"); } else {
}); cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-store`).should('exist');
}
})
it("Verify show junction table names", () => { it("Verify show junction table names", () => {
// disable showViews // disable showViews
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-showJunctionTableNames-checkbox').click();
.get(".nc-erd-showJunctionTableNames-checkbox")
.click();
cy.get(".nc-erd-vue-flow") if(dbType === "xcdb") {
.get(".nc-erd-table-label-filmactor-film_actor") cy.get('.nc-erd-vue-flow').get(`.nc-erd-table-label-filmactor-${projectId}film_actor`).should('exist');
.should("exist"); } else {
cy.get('.nc-erd-vue-flow').get('.nc-erd-table-label-filmactor-film_actor').should('exist');
}
mainPage.closeMetaTab(); mainPage.closeMetaTab();
}); })
it("Verify table ERD view of country", () => { it('Verify table ERD view of country', () => {
mainPage.openTableErdView(); mainPage.openTableErdView();
cy.get(".nc-erd-vue-flow-single-table") cy.get('.nc-erd-vue-flow-single-table').find('.nc-erd-table-node').should('have.length', 2)
.find(".nc-erd-table-node") cy.get('.nc-erd-vue-flow-single-table').find('.vue-flow__edge').should('have.length', 1)
.should("have.length", 2); cy.get('.nc-erd-vue-flow-single-table').find('.nc-erd-edge-circle').should('have.length', 1)
cy.get(".nc-erd-vue-flow-single-table") cy.get('.nc-erd-vue-flow-single-table').find('.nc-erd-edge-rect').should('have.length', 1)
.find(".vue-flow__edge")
.should("have.length", 1);
cy.get(".nc-erd-vue-flow-single-table")
.find(".nc-erd-edge-circle")
.should("have.length", 1);
cy.get(".nc-erd-vue-flow-single-table")
.find(".nc-erd-edge-rect")
.should("have.length", 1);
const countryColumns = [ const countryColumns = [
"country_id", 'country_id',
"country", 'country',
"last_update", 'last_update',
"city_list", 'city_list'
]; ]
// Country table // Country table
countryColumns.forEach((colTitle) => { countryColumns.forEach((colTitle) => {
cy.get(".nc-erd-vue-flow-single-table") if(dbType === "xcdb") {
.find(`.nc-erd-table-node-country`) cy.get('.nc-erd-vue-flow-single-table').find(`.nc-erd-table-node-${projectId}country`).find(`.nc-erd-table-node-${projectId}country-column-${colTitle}`).should('exist');
.find(`.nc-erd-table-node-country-column-${colTitle}`) } else {
.should("exist"); cy.get('.nc-erd-vue-flow-single-table').find(`.nc-erd-table-node-country`).find(`.nc-erd-table-node-country-column-${colTitle}`).should('exist');
}
}); });
const cityColumns = [ const cityColumns = [
"city_id", 'city_id',
"city", 'city',
"last_update", 'last_update',
"country", 'country',
"address_list", 'address_list'
]; ]
// City table // City table
cityColumns.forEach((colTitle) => { cityColumns.forEach((colTitle) => {
cy.get(".nc-erd-vue-flow-single-table") if(dbType === "xcdb") {
.find(`.nc-erd-table-node-city`) cy.get('.nc-erd-vue-flow-single-table').find(`.nc-erd-table-node-${projectId}city`).find(`.nc-erd-table-node-${projectId}city-column-${colTitle}`).should('exist');
.find(`.nc-erd-table-node-city-column-${colTitle}`) } else {
.should("exist"); cy.get('.nc-erd-vue-flow-single-table').find(`.nc-erd-table-node-city`).find(`.nc-erd-table-node-city-column-${colTitle}`).should('exist');
}); }
}); });
})
it("Verify table ERD view of country showAllColumn disabled", () => { it('Verify table ERD view of country showAllColumn disabled', () => {
cy.get(".nc-erd-vue-flow-single-table").within(() => { cy.get('.nc-erd-vue-flow-single-table').within(() => {
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-showColumns-checkbox').click();
.get(".nc-erd-showColumns-checkbox") cy.get('.nc-erd-showPkAndFk-checkbox-disabled').should('exist');
.click(); cy.get('.nc-erd-showPkAndFk-checkbox-unchecked').should('exist');
cy.get(".nc-erd-showPkAndFk-checkbox-disabled").should("exist");
cy.get(".nc-erd-showPkAndFk-checkbox-unchecked").should("exist");
const countryColumns = ["city_list"]; const countryColumns = [
'city_list'
]
// Country table // Country table
countryColumns.forEach((colTitle) => { countryColumns.forEach((colTitle) => {
cy.get(`.nc-erd-table-node-country`) if(dbType === "xcdb") {
.find(`.nc-erd-table-node-country-column-${colTitle}`) cy.get(`.nc-erd-table-node-${projectId}country`).find(`.nc-erd-table-node-${projectId}country-column-${colTitle}`).should('exist');
.should("exist"); } else {
cy.get(`.nc-erd-table-node-country`).find(`.nc-erd-table-node-country-column-${colTitle}`).should('exist');
}
}); });
const cityColumns = ["country", "address_list"]; const cityColumns = [
'country',
'address_list'
]
// City table // City table
cityColumns.forEach((colTitle) => { cityColumns.forEach((colTitle) => {
cy.get(`.nc-erd-table-node-city`) if(dbType === "xcdb") {
.find(`.nc-erd-table-node-city-column-${colTitle}`) cy.get(`.nc-erd-table-node-${projectId}city`).find(`.nc-erd-table-node-${projectId}city-column-${colTitle}`).should('exist');
.should("exist"); } else {
cy.get(`.nc-erd-table-node-city`).find(`.nc-erd-table-node-city-column-${colTitle}`).should('exist');
}
}); });
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-showColumns-checkbox').click();
.get(".nc-erd-showColumns-checkbox") })
.click(); })
});
});
it("Verify table ERD view of country show PK AND FK disabled", () => { it('Verify table ERD view of country show PK AND FK disabled', () => {
cy.get(".nc-erd-vue-flow-single-table").within(() => { cy.get('.nc-erd-vue-flow-single-table').within(() => {
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-showPkAndFk-checkbox').click();
.get(".nc-erd-showPkAndFk-checkbox")
.click();
const countryColumns = ["country", "last_update", "city_list"]; const countryColumns = [
'country',
'last_update',
'city_list'
]
// Country table // Country table
countryColumns.forEach((colTitle) => { countryColumns.forEach((colTitle) => {
cy.get(`.nc-erd-table-node-country`) if(dbType === "xcdb") {
.find(`.nc-erd-table-node-country-column-${colTitle}`) cy.get(`.nc-erd-table-node-${projectId}country`).find(`.nc-erd-table-node-${projectId}country-column-${colTitle}`).should('exist');
.should("exist"); } else {
cy.get(`.nc-erd-table-node-country`).find(`.nc-erd-table-node-country-column-${colTitle}`).should('exist');
}
}); });
const cityColumns = ["city", "last_update", "country", "address_list"]; const cityColumns = [
'city',
'last_update',
'country',
'address_list'
]
// City table // City table
cityColumns.forEach((colTitle) => { cityColumns.forEach((colTitle) => {
cy.get(`.nc-erd-table-node-city`) if(dbType === "xcdb") {
.find(`.nc-erd-table-node-city-column-${colTitle}`) cy.get(`.nc-erd-table-node-${projectId}city`).find(`.nc-erd-table-node-${projectId}city-column-${colTitle}`).should('exist');
.should("exist"); } else {
cy.get(`.nc-erd-table-node-city`).find(`.nc-erd-table-node-city-column-${colTitle}`).should('exist');
}
}); });
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').get('.nc-erd-showPkAndFk-checkbox').click();
.get(".nc-erd-showPkAndFk-checkbox")
.click();
});
cy.getActiveModal().find(".nc-modal-close").click({ force: true });
});
it("create column and check if the change is in the schema", () => { })
mainPage.addColumn("test_column", "country"); cy.getActiveModal().find('.nc-modal-close').click({ force: true });
})
it('create column and check if the change is in the schema', () => {
mainPage.addColumn('test_column', 'country')
// table view // table view
mainPage.openTableErdView(); mainPage.openTableErdView();
cy.get(".nc-erd-vue-flow-single-table").within(() => { cy.get('.nc-erd-vue-flow-single-table').within(() => {
cy.get(".nc-erd-table-node-country") if(dbType === "xcdb") {
.find(".nc-erd-table-node-country-column-test_column") cy.get(`.nc-erd-table-node-${projectId}country`).find(`.nc-erd-table-node-${projectId}country-column-test_column`).should('exist');
.should("exist"); } else {
}); cy.get('.nc-erd-table-node-country').find('.nc-erd-table-node-country-column-test_column').should('exist');
cy.getActiveModal().find(".nc-modal-close").click({ force: true }); }
})
cy.getActiveModal().find('.nc-modal-close').click({ force: true });
// All table view // All table view
mainPage.openErdTab(); mainPage.openErdTab();
cy.get(".nc-erd-vue-flow").within(() => { cy.get('.nc-erd-vue-flow').within(() => {
cy.get(".nc-erd-table-node-country") if(dbType === "xcdb") {
.find(".nc-erd-table-node-country-column-test_column") cy.get(`.nc-erd-table-node-${projectId}country`).find(`.nc-erd-table-node-${projectId}country-column-test_column`).should('exist');
.should("exist"); } else {
}); cy.get('.nc-erd-table-node-country').find('.nc-erd-table-node-country-column-test_column').should('exist');
}
})
mainPage.closeMetaTab(); mainPage.closeMetaTab();
mainPage.deleteColumn("test_column");
mainPage.deleteColumn('test_column')
// table view // table view
mainPage.openTableErdView(); mainPage.openTableErdView();
cy.get(".nc-erd-vue-flow-single-table").within(() => { cy.get('.nc-erd-vue-flow-single-table').within(() => {
cy.get(".nc-erd-table-node-country") if(dbType === "xcdb") {
.find(".nc-erd-table-node-country-column-test_column") cy.get(`.nc-erd-table-node-${projectId}country`).find(`.nc-erd-table-node-${projectId}country-column-test_column`).should('not.exist');
.should("not.exist"); } else {
}); cy.get('.nc-erd-table-node-country').find('.nc-erd-table-node-country-column-test_column').should('not.exist');
cy.getActiveModal().find(".nc-modal-close").click({ force: true }); }
})
cy.getActiveModal().find('.nc-modal-close').click({ force: true });
// All table view // All table view
mainPage.openErdTab(); mainPage.openErdTab();
cy.get(".nc-erd-vue-flow").within(() => { cy.get('.nc-erd-vue-flow').within(() => {
cy.get(".nc-erd-table-node-country") if(dbType === "xcdb") {
.find(".nc-erd-table-node-country-column-test_column") cy.get(`.nc-erd-table-node-${projectId}country`).find(`.nc-erd-table-node-${projectId}country-column-test_column`).should('not.exist');
.should("not.exist"); } else {
}); cy.get('.nc-erd-table-node-country').find('.nc-erd-table-node-country-column-test_column').should('not.exist');
}
})
mainPage.closeMetaTab(); mainPage.closeMetaTab();
}); })
it("Create table should reflected in ERD", () => { it('Create table should reflected in ERD', () => {
cy.createTable("new"); cy.createTable('new')
mainPage.openErdTab(); mainPage.openErdTab();
cy.get(".nc-erd-vue-flow").within(() => { cy.get('.nc-erd-vue-flow').within(() => {
cy.get(".nc-erd-table-node-new").should("exist"); if(dbType === "xcdb") {
}); cy.get(`.nc-erd-table-node-${projectId}new`).should('exist');
} else {
cy.get('.nc-erd-table-node-new').should('exist');
}
})
mainPage.closeMetaTab(); mainPage.closeMetaTab();
cy.deleteTable("new"); cy.deleteTable('new')
mainPage.openErdTab(); mainPage.openErdTab();
cy.get(".nc-erd-vue-flow").within(() => { cy.get('.nc-erd-vue-flow').within(() => {
cy.get(".nc-erd-table-node-new").should("not.exist"); if(dbType === "xcdb") {
}); cy.get(`.nc-erd-table-node-${projectId}new`).should('not.exist');
} else {
cy.get('.nc-erd-table-node-new').should('not.exist');
}
})
mainPage.closeMetaTab(); mainPage.closeMetaTab();
}); })
it(`Disable MM setting Open Table ERD and check easter egg should not work`, () => { it(`Disable MM setting Open Table ERD and check easter egg should not work`, () => {
mainPage.toggleShowMMSetting(); mainPage.toggleShowMMSetting();
mainPage.openErdTab(); mainPage.openErdTab();
cy.get(".nc-erd-vue-flow").within(() => { cy.get('.nc-erd-vue-flow').within(() => {
cy.get(".nc-erd-context-menu") cy.get('.nc-erd-context-menu').find('.nc-erd-showColumns-label').dblclick();
.find(".nc-erd-showColumns-label") cy.get('.nc-erd-context-menu').find('.ant-checkbox').should('have.length', 3);
.dblclick(); })
cy.get(".nc-erd-context-menu")
.find(".ant-checkbox")
.should("have.length", 3);
});
mainPage.closeMetaTab(); mainPage.closeMetaTab();
}); });

3
scripts/cypress/integration/test/pg-restMisc.js

@ -11,6 +11,7 @@ const {
setCurrentMode, setCurrentMode,
} = require("../../support/page_objects/projectConstants"); } = require("../../support/page_objects/projectConstants");
const t8a = require("../common/8a_webhook"); const t8a = require("../common/8a_webhook");
const t9b = require("../common/9b_ERD");
const nocoTestSuite = (apiType, dbType) => { const nocoTestSuite = (apiType, dbType) => {
setCurrentMode(apiType, dbType); setCurrentMode(apiType, dbType);
@ -31,7 +32,7 @@ const nocoTestSuite = (apiType, dbType) => {
t6f.genTest(apiType, dbType); t6f.genTest(apiType, dbType);
// ERD: // ERD:
// t9b.genTest(apiType, dbType); t9b.genTest(apiType, dbType);
// Webhook tests // Webhook tests
t8a.genTest(apiType, dbType); t8a.genTest(apiType, dbType);

4
scripts/cypress/integration/test/xcdb-restMisc.js

@ -8,11 +8,11 @@ let t6f = require("../common/6f_attachments");
let t6g = require("../common/6g_base_share"); let t6g = require("../common/6g_base_share");
let t7a = require("../common/7a_create_project_from_excel"); let t7a = require("../common/7a_create_project_from_excel");
let t8a = require("../common/8a_webhook"); let t8a = require("../common/8a_webhook");
const t9b = require("../common/9b_ERD");
const { const {
setCurrentMode, setCurrentMode,
} = require("../../support/page_objects/projectConstants"); } = require("../../support/page_objects/projectConstants");
const t9b = require("../common/9b_ERD");
const nocoTestSuite = (apiType, dbType) => { const nocoTestSuite = (apiType, dbType) => {
setCurrentMode(apiType, dbType); setCurrentMode(apiType, dbType);
@ -33,7 +33,7 @@ const nocoTestSuite = (apiType, dbType) => {
t6f.genTest(apiType, dbType); t6f.genTest(apiType, dbType);
// ERD: // ERD:
// t9b.genTest(apiType, dbType); t9b.genTest(apiType, dbType);
// Webhook tests // Webhook tests
t8a.genTest(apiType, dbType); t8a.genTest(apiType, dbType);

47
scripts/cypress/support/page_objects/projectConstants.js

@ -157,29 +157,24 @@ export function getProjectString() {
return xcdbProjectString; return xcdbProjectString;
} }
const sakilaTables = [ const mysqlSakilaTables = [
"actor", 'actor', 'address', 'category', 'city', 'country', 'customer', 'film', 'film_text', 'language', 'payment', 'rental', 'staff'
"address", ]
"category",
"city", const mysqlSakilaSqlViews = [
"country", 'actor_info', 'customer_list', 'film_list', 'nicer_but_slower_film_list', 'sales_by_film_category', 'sales_by_store', 'staff_list'
"customer", ]
"film",
"film_text", const pgSakilaTables = [
"language", 'actor', 'address', 'category', 'city', 'country', 'customer', 'film', 'language', 'payment', 'payment_p2007_01', 'payment_p2007_02', 'payment_p2007_03', 'payment_p2007_04', 'payment_p2007_05', 'payment_p2007_06', 'rental', 'staff'
"payment", ]
"rental",
"staff", const pgSakilaSqlViews = [
]; 'actor_info', 'customer_list', 'film_list', 'nicer_but_slower_film_list', 'sales_by_film_category', 'sales_by_store', 'staff_list'
]
const sakilaSqlViews = [
"actor_info", const sqliteSakilaSqlViews = [
"customer_list", 'actor_info', 'customer_list', 'film_list', 'nice_but_slower_film_list', 'sales_by_film_category', 'sales_by_store', 'staff_list'
"film_list", ]
"nicer_but_slower_film_list",
"sales_by_film_category", export { mysqlSakilaTables, mysqlSakilaSqlViews, pgSakilaTables, pgSakilaSqlViews, sqliteSakilaSqlViews }
"sales_by_store",
"staff_list",
];
export { sakilaTables, sakilaSqlViews };
Loading…
Cancel
Save