From 965fcfde0a63e79a4f098f5eb4a8047302b636c6 Mon Sep 17 00:00:00 2001 From: Raju Udava Date: Fri, 31 Dec 2021 15:57:23 +0530 Subject: [PATCH] test(cypress) xcdb-spec files Signed-off-by: Raju Udava --- .../cypress/integration/test/xcdb-gqlMisc.js | 56 ++++++++++++++++ .../cypress/integration/test/xcdb-gqlRoles.js | 47 ++++++++++++++ .../integration/test/xcdb-gqlTableOps.js | 65 +++++++++++++++++++ .../cypress/integration/test/xcdb-gqlViews.js | 55 ++++++++++++++++ .../cypress/integration/test/xcdb-restMisc.js | 61 +++++++++++++++++ .../integration/test/xcdb-restRoles.js | 47 ++++++++++++++ .../integration/test/xcdb-restTableOps.js | 65 +++++++++++++++++++ .../integration/test/xcdb-restViews.js | 55 ++++++++++++++++ 8 files changed, 451 insertions(+) create mode 100644 scripts/cypress/integration/test/xcdb-gqlMisc.js create mode 100644 scripts/cypress/integration/test/xcdb-gqlRoles.js create mode 100644 scripts/cypress/integration/test/xcdb-gqlTableOps.js create mode 100644 scripts/cypress/integration/test/xcdb-gqlViews.js create mode 100644 scripts/cypress/integration/test/xcdb-restMisc.js create mode 100644 scripts/cypress/integration/test/xcdb-restRoles.js create mode 100644 scripts/cypress/integration/test/xcdb-restTableOps.js create mode 100644 scripts/cypress/integration/test/xcdb-restViews.js diff --git a/scripts/cypress/integration/test/xcdb-gqlMisc.js b/scripts/cypress/integration/test/xcdb-gqlMisc.js new file mode 100644 index 0000000000..0d7c04d18a --- /dev/null +++ b/scripts/cypress/integration/test/xcdb-gqlMisc.js @@ -0,0 +1,56 @@ +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"); +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 = (type, xcdb) => { + setCurrentMode(type, xcdb); + if (0 == executionMode) { + t0.genTest(type, xcdb); + } else { + t01.genTest(type, xcdb); + } + + t6b.genTest(type, xcdb); + t6c.genTest(type, xcdb); + t6d.genTest(type, xcdb); + t6f.genTest(type, xcdb); + t6g.genTest(type, xcdb); + // **deletes created project, hence place it @ end + t6e.genTest(type, xcdb); +}; + +nocoTestSuite("graphql", true); + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @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 . + * + */ diff --git a/scripts/cypress/integration/test/xcdb-gqlRoles.js b/scripts/cypress/integration/test/xcdb-gqlRoles.js new file mode 100644 index 0000000000..6599fd810f --- /dev/null +++ b/scripts/cypress/integration/test/xcdb-gqlRoles.js @@ -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 = (type, xcdb) => { + setCurrentMode(type, xcdb); + if (0 == executionMode) { + t0.genTest(type, xcdb); + } else { + t01.genTest(type, xcdb); + } + + t5a.genTest(type, xcdb); + t5b.genTest(type, xcdb); +}; + +nocoTestSuite("graphql", true); + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @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 . + * + */ diff --git a/scripts/cypress/integration/test/xcdb-gqlTableOps.js b/scripts/cypress/integration/test/xcdb-gqlTableOps.js new file mode 100644 index 0000000000..7389f2da4c --- /dev/null +++ b/scripts/cypress/integration/test/xcdb-gqlTableOps.js @@ -0,0 +1,65 @@ +let t0 = require("./explicitLogin"); +let t01 = require("../common/00_pre_configurations"); +let t1a = require("../common/1a_table_operations"); +let t1c = require("../common/1c_sql_view"); +let t1d = require("../common/1d_table_view_drag_drop_reorder"); +let t1b = require("../common/1b_table_column_operations"); +let t1e = require("../common/1e_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 = (type, xcdb) => { + if (0 == executionMode) { + setCurrentMode(type, xcdb); + t0.genTest(type, xcdb); + } else { + t01.genTest(type, xcdb); + } + + t1a.genTest(type, xcdb); + t1b.genTest(type, xcdb); + t1c.genTest(type, xcdb); + t1d.genTest(type, xcdb); + t1e.genTest(type, xcdb); + t2a.genTest(type, xcdb); + t2b.genTest(type, xcdb); + t3a.genTest(type, xcdb); + t3b.genTest(type, xcdb); + t3c.genTest(type, xcdb); + t3d.genTest(type, xcdb); +}; + +nocoTestSuite("graphql", true); + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @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 . + * + */ diff --git a/scripts/cypress/integration/test/xcdb-gqlViews.js b/scripts/cypress/integration/test/xcdb-gqlViews.js new file mode 100644 index 0000000000..d2482c2866 --- /dev/null +++ b/scripts/cypress/integration/test/xcdb-gqlViews.js @@ -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_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 = (type, xcdb) => { + setCurrentMode(type, xcdb); + if (0 == executionMode) { + t0.genTest(type, xcdb); + } else { + t01.genTest(type, xcdb); + } + + t4a.genTest(type, xcdb); + t4b.genTest(type, xcdb); + t4c.genTest(type, xcdb); + t4d.genTest(type, xcdb); + t4e.genTest(type, xcdb); + t4f.genTest(type, xcdb); +}; + +nocoTestSuite("graphql", true); + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @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 . + * + */ diff --git a/scripts/cypress/integration/test/xcdb-restMisc.js b/scripts/cypress/integration/test/xcdb-restMisc.js new file mode 100644 index 0000000000..9e19177d20 --- /dev/null +++ b/scripts/cypress/integration/test/xcdb-restMisc.js @@ -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 = (type, xcdb) => { + setCurrentMode(type, xcdb); + if (0 == executionMode) { + t0.genTest(type, xcdb); + } else { + t01.genTest(type, xcdb); + } + + t6b.genTest(type, xcdb); + t6d.genTest(type, xcdb); + t6c.genTest(type, xcdb); + t6f.genTest(type, xcdb); + t6g.genTest(type, xcdb); + // **deletes created project, hence place it @ end + t6e.genTest(type, xcdb); + + // intended to keep this after earlier project deletion + // creates project using excel & deletes it + t7a.genTest(type, xcdb); +}; + +nocoTestSuite("rest", true); + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @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 . + * + */ diff --git a/scripts/cypress/integration/test/xcdb-restRoles.js b/scripts/cypress/integration/test/xcdb-restRoles.js new file mode 100644 index 0000000000..4d992a0842 --- /dev/null +++ b/scripts/cypress/integration/test/xcdb-restRoles.js @@ -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 = (type, xcdb) => { + setCurrentMode(type, xcdb); + if (0 == executionMode) { + t0.genTest(type, xcdb); + } else { + t01.genTest(type, xcdb); + } + + t5a.genTest(type, xcdb); + t5b.genTest(type, xcdb); +}; + +nocoTestSuite("rest", true); + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @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 . + * + */ diff --git a/scripts/cypress/integration/test/xcdb-restTableOps.js b/scripts/cypress/integration/test/xcdb-restTableOps.js new file mode 100644 index 0000000000..e54f194c99 --- /dev/null +++ b/scripts/cypress/integration/test/xcdb-restTableOps.js @@ -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_table_view_drag_drop_reorder"); +let t1e = require("../common/1e_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 = (type, xcdb) => { + setCurrentMode(type, xcdb); + if (0 == executionMode) { + t0.genTest(type, xcdb); + } else { + t01.genTest(type, xcdb); + } + + t1a.genTest(type, xcdb); + t1b.genTest(type, xcdb); + t1c.genTest(type, xcdb); + t1d.genTest(type, xcdb); + t1e.genTest(type, xcdb); + t2a.genTest(type, xcdb); + t2b.genTest(type, xcdb); + t3a.genTest(type, xcdb); + t3b.genTest(type, xcdb); + t3c.genTest(type, xcdb); + t3d.genTest(type, xcdb); +}; + +nocoTestSuite("rest", true); + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @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 . + * + */ diff --git a/scripts/cypress/integration/test/xcdb-restViews.js b/scripts/cypress/integration/test/xcdb-restViews.js new file mode 100644 index 0000000000..71a0c248b7 --- /dev/null +++ b/scripts/cypress/integration/test/xcdb-restViews.js @@ -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_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 = (type, xcdb) => { + setCurrentMode(type, xcdb); + if (0 == executionMode) { + t0.genTest(type, xcdb); + } else { + t01.genTest(type, xcdb); + } + + t4a.genTest(type, xcdb); + t4b.genTest(type, xcdb); + t4c.genTest(type, xcdb); + t4d.genTest(type, xcdb); + t4e.genTest(type, xcdb); + t4f.genTest(type, xcdb); +}; + +nocoTestSuite("rest", true); + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @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 . + * + */