From 06929c10404cfdc992d32197eb4b0ea0e9eb3e1d Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 30 Sep 2022 12:49:05 +0530 Subject: [PATCH] feat(cypress): Added mysql independent misc suite --- scripts/cypress/cypress.json | 3 +- .../cypress/integration/test/restMiscV2.js | 30 +++++++++++++++++++ scripts/cypress/support/commands.js | 7 +++-- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 scripts/cypress/integration/test/restMiscV2.js diff --git a/scripts/cypress/cypress.json b/scripts/cypress/cypress.json index a6855c5da0..eb8a6c4f92 100644 --- a/scripts/cypress/cypress.json +++ b/scripts/cypress/cypress.json @@ -15,7 +15,8 @@ "test/pg-restMisc.js", "test/quickTest.js", "test/db-independent.js", - "test/pg-restMiscV2.js" + "test/pg-restMiscV2.js", + "test/restMiscV2.js" ], "defaultCommandTimeout": 13000, "pageLoadTimeout": 600000, diff --git a/scripts/cypress/integration/test/restMiscV2.js b/scripts/cypress/integration/test/restMiscV2.js new file mode 100644 index 0000000000..293b70a3d3 --- /dev/null +++ b/scripts/cypress/integration/test/restMiscV2.js @@ -0,0 +1,30 @@ +// 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"); +// const t8a = require("../common/8a_webhook"); +const t9b = require("../common/9b_ERD"); + +const nocoTestSuite = (apiType, dbType) => { + setCurrentMode(apiType, dbType); + + // Download CSV + t6b.genTest(apiType, dbType); + + // Attachment cell + t6f.genTest(apiType, dbType); + + // ERD: + t9b.genTest(apiType, dbType); +}; + +nocoTestSuite("rest", "mysql"); + diff --git a/scripts/cypress/support/commands.js b/scripts/cypress/support/commands.js index 36d7425b45..0dfff6091f 100644 --- a/scripts/cypress/support/commands.js +++ b/scripts/cypress/support/commands.js @@ -45,8 +45,11 @@ Cypress.Commands.add('setup', ({ dbType }) => { let project; if(dbType === "postgres") { - const pgProject = response.body.projects.find((project) => project.title === 'pgExtREST'); - project = pgProject; + project = response.body.projects.find((project) => project.title === 'pgExtREST'); + } + + if(dbType === "mysql") { + project = response.body.projects.find((project) => project.title === 'externalREST'); } cy.visit(`http://localhost:3000/#/nc/${project.id}/auth`, {