mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
3.6 KiB
106 lines
3.6 KiB
3 years ago
|
const { mainPage } = require("../../support/page_objects/mainPage");
|
||
|
const { loginPage } = require("../../support/page_objects/navigation");
|
||
|
const { roles } = require("../../support/page_objects/projectConstants");
|
||
|
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
|
||
3 years ago
|
|
||
3 years ago
|
export const genTest = (apiType, dbType) => {
|
||
|
if (!isTestSuiteActive(apiType, dbType)) return;
|
||
3 years ago
|
describe(`Language support`, () => {
|
||
|
before(() => {
|
||
3 years ago
|
loginPage.signIn(roles.owner.credentials)
|
||
3 years ago
|
// mainPage.toolBarTopLeft(mainPage.HOME).click();
|
||
3 years ago
|
cy.screenshot("Debug 6d-1", { overwrite: true });
|
||
3 years ago
|
});
|
||
3 years ago
|
|
||
3 years ago
|
const langVerification = (idx, lang) => {
|
||
|
// pick json from the file specified
|
||
|
it(`Language verification: ${lang} > Projects page`, () => {
|
||
|
let json = require(`../../../../packages/nc-gui/lang/${lang}`);
|
||
3 years ago
|
|
||
3 years ago
|
// toggle menu as per index
|
||
|
cy.get(".nc-menu-translate").click();
|
||
3 years ago
|
|
||
|
cy.snipActiveMenu("Menu_Translation");
|
||
|
|
||
3 years ago
|
cy.getActiveMenu().find(".v-list-item").eq(idx).click();
|
||
3 years ago
|
|
||
3 years ago
|
cy.screenshot("Debug 6d-2", { overwrite: true });
|
||
3 years ago
|
|
||
3 years ago
|
// basic validations
|
||
|
// 1. Page title: "My Projects"
|
||
|
// 2. Button: "New Project"
|
||
|
// 3. Search box palceholder text: "Search Projects"
|
||
|
// cy.get("b").contains(json.title.myProject).should("exist");
|
||
|
cy.get(".nc-project-page-title")
|
||
|
.contains(json.title.myProject)
|
||
|
.should("exist");
|
||
|
cy.get(".nc-new-project-menu")
|
||
|
.contains(json.title.newProj)
|
||
|
.should("exist");
|
||
|
cy.get(`[placeholder="${json.activity.searchProject}"]`).should(
|
||
|
"exist"
|
||
|
);
|
||
|
});
|
||
|
};
|
||
3 years ago
|
|
||
3 years ago
|
let langMenu = [
|
||
2 years ago
|
"ar.json",
|
||
2 years ago
|
"bn.json",
|
||
3 years ago
|
"da.json",
|
||
|
"de.json",
|
||
|
"en.json",
|
||
|
"es.json",
|
||
|
"fa.json",
|
||
|
"fi.json",
|
||
|
"fr.json",
|
||
2 years ago
|
"hi.json",
|
||
3 years ago
|
"hr.json",
|
||
|
"id.json",
|
||
|
"it_IT.json",
|
||
|
"iw.json",
|
||
|
"ja.json",
|
||
|
"ko.json",
|
||
|
"lv.json",
|
||
|
"nl.json",
|
||
|
"no.json",
|
||
|
"pt_BR.json",
|
||
|
"ru.json",
|
||
|
"sl.json",
|
||
|
"sv.json",
|
||
|
"th.json",
|
||
3 years ago
|
"tr.json",
|
||
2 years ago
|
"uk.json",
|
||
2 years ago
|
"vi.json",
|
||
3 years ago
|
"zh_CN.json",
|
||
|
"zh_HK.json",
|
||
|
"zh_TW.json",
|
||
|
];
|
||
|
|
||
3 years ago
|
// Index is the order in which menu options appear
|
||
3 years ago
|
for (let i = 0; i < langMenu.length; i++)
|
||
|
langVerification(i, langMenu[i]);
|
||
3 years ago
|
});
|
||
3 years ago
|
};
|
||
3 years ago
|
|
||
|
/**
|
||
|
* @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/>.
|
||
|
*
|
||
3 years ago
|
*/
|