Browse Source

chore: change cypress-v2 to cypress

pull/3497/head
Wing-Kam Wong 2 years ago
parent
commit
7f73b99470
  1. 14
      scripts/cypress/cypress.json
  2. 4
      scripts/cypress/integration/common/6g_base_share.js
  3. 4
      scripts/cypress/integration/common/7a_create_project_from_excel.js
  4. 6
      scripts/cypress/plugins/index.js

14
scripts/cypress/cypress.json

@ -41,12 +41,12 @@
"sharedBase": "https://airtable.com/shr4z0qmh6dg5s3eB" "sharedBase": "https://airtable.com/shr4z0qmh6dg5s3eB"
} }
}, },
"fixturesFolder": "scripts/cypress-v2/fixtures", "fixturesFolder": "scripts/cypress/fixtures",
"integrationFolder": "scripts/cypress-v2/integration", "integrationFolder": "scripts/cypress/integration",
"pluginsFile": "scripts/cypress-v2/plugins/index.js", "pluginsFile": "scripts/cypress/plugins/index.js",
"screenshotsFolder": "scripts/cypress-v2/screenshots", "screenshotsFolder": "scripts/cypress/screenshots",
"videosFolder": "scripts/cypress-v2/videos", "videosFolder": "scripts/cypress/videos",
"downloadsFolder": "scripts/cypress-v2/downloads", "downloadsFolder": "scripts/cypress/downloads",
"supportFile": "scripts/cypress-v2/support/index.js", "supportFile": "scripts/cypress/support/index.js",
"chromeWebSecurity": false "chromeWebSecurity": false
} }

4
scripts/cypress/integration/common/6g_base_share.js

@ -113,7 +113,7 @@ style="background: transparent; "></iframe>
</html> </html>
`; `;
cy.writeFile( cy.writeFile(
"scripts/cypress-v2/fixtures/sampleFiles/iFrame.html", "scripts/cypress/fixtures/sampleFiles/iFrame.html",
htmlFile htmlFile
); );
}); });
@ -156,7 +156,7 @@ style="background: transparent; "></iframe>
// https://docs.cypress.io/api/commands/visit#Prefixes // https://docs.cypress.io/api/commands/visit#Prefixes
it("Generate & verify embed HTML IFrame", {baseUrl: null}, () => { it("Generate & verify embed HTML IFrame", {baseUrl: null}, () => {
let filePath = "scripts/cypress-v2/fixtures/sampleFiles/iFrame.html"; let filePath = "scripts/cypress/fixtures/sampleFiles/iFrame.html";
cy.log(filePath); cy.log(filePath);
cy.visit(filePath, {baseUrl: null}); cy.visit(filePath, {baseUrl: null});

4
scripts/cypress/integration/common/7a_create_project_from_excel.js

@ -75,14 +75,14 @@ export const genTest = (apiType, dbType) => {
cy.wait(1000); cy.wait(1000);
cy.task("readSheetList", { cy.task("readSheetList", {
file: `./scripts/cypress-v2/fixtures/${filepath}`, file: `./scripts/cypress/fixtures/${filepath}`,
}).then((rows) => { }).then((rows) => {
cy.log(rows); cy.log(rows);
sheetList = rows; sheetList = rows;
}); });
cy.task("readXlsx", { cy.task("readXlsx", {
file: `./scripts/cypress-v2/fixtures/${filepath}`, file: `./scripts/cypress/fixtures/${filepath}`,
sheet: "Sheet2", sheet: "Sheet2",
}).then((rows) => { }).then((rows) => {
cy.log(rows); cy.log(rows);

6
scripts/cypress/plugins/index.js

@ -29,7 +29,7 @@ module.exports = (on, config) => {
copyFile() { copyFile() {
console.log("copyFile", __dirname) console.log("copyFile", __dirname)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
copyFile("./scripts/cypress-v2/fixtures/quickTest/noco_0_91_7.db", "./packages/nocodb/noco.db", (err) => { copyFile("./scripts/cypress/fixtures/quickTest/noco_0_91_7.db", "./packages/nocodb/noco.db", (err) => {
if(err) { if(err) {
console.log(err) console.log(err)
return reject(err) return reject(err)
@ -129,7 +129,7 @@ function _sqliteExecReturnValue(query) {
// open the database // open the database
console.log("Current directory: " + process.cwd()); console.log("Current directory: " + process.cwd());
let db = new sqlite3.Database( let db = new sqlite3.Database(
"./scripts/cypress-v2/fixtures/sqlite-sakila/sakila.db", "./scripts/cypress/fixtures/sqlite-sakila/sakila.db",
sqlite3.OPEN_READWRITE, sqlite3.OPEN_READWRITE,
(err) => { (err) => {
if (err) { if (err) {
@ -157,7 +157,7 @@ function _sqliteExec(query) {
// open the database // open the database
console.log("Current directory: " + process.cwd()); console.log("Current directory: " + process.cwd());
let db = new sqlite3.Database( let db = new sqlite3.Database(
"./scripts/cypress-v2/fixtures/sqlite-sakila/sakila.db", "./scripts/cypress/fixtures/sqlite-sakila/sakila.db",
sqlite3.OPEN_READWRITE, sqlite3.OPEN_READWRITE,
(err) => { (err) => {
if (err) { if (err) {

Loading…
Cancel
Save