diff --git a/console/cypress.json b/console/cypress.json index 33cfde3725c9e..2f89832de8c05 100644 --- a/console/cypress.json +++ b/console/cypress.json @@ -2,7 +2,7 @@ "baseUrl": "http://localhost:3000", "env": { "BASE_URL": "http://localhost:3000", - "TEST_MODE": "cli", + "TEST_MODE": "parallel", "MIGRATE_URL": "http://localhost:9693/apis/migrate" }, "ignoreTestFiles": ["*spec.js", "validators.js", "utils.js"], diff --git a/console/cypress/integration/api-explorer/graphql/spec.js b/console/cypress/integration/api-explorer/graphql/spec.js index 80c5dec1e4d36..ddb639fc9e746 100644 --- a/console/cypress/integration/api-explorer/graphql/spec.js +++ b/console/cypress/integration/api-explorer/graphql/spec.js @@ -65,8 +65,9 @@ export const checkExecuteQueryButton = () => { }; export const checkQuery = () => { - cy.get(getElementFromAlias('header-key-2')).type('someKey'); - cy.get(getElementFromAlias('header-value-2')).type('someValue'); + const headerIndex = accessKey ? 2 : 1; + cy.get(getElementFromAlias(`header-key-${headerIndex}`)).type('someKey'); + cy.get(getElementFromAlias(`header-value-${headerIndex}`)).type('someValue'); cy.get('textarea') .first() diff --git a/console/cypress/integration/api-explorer/graphql/test.js b/console/cypress/integration/api-explorer/graphql/test.js index 5dfd0a60ce340..50fce973acf57 100644 --- a/console/cypress/integration/api-explorer/graphql/test.js +++ b/console/cypress/integration/api-explorer/graphql/test.js @@ -27,16 +27,22 @@ const setup = () => { }); }; +const testPrefix = 'api-explorer'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runApiExplorerTests = () => { describe('API Explorer', () => { - it('Create test table', createTestTable); - it('Insert row into test table', insertValue); - it('Open API Explorer', openAPIExplorer); + makeAssertion('Create test table', createTestTable); + makeAssertion('Insert row into test table', insertValue); + makeAssertion('Open API Explorer', openAPIExplorer); // it('Check Run Query button', checkExecuteQueryButton); - it('Check query result', checkQuery); - it('Check mutation result', checkMutation); - it('Check subscription result', checkSub); - it('Delete test table', delTestTable); + makeAssertion('Check query result', checkQuery); + makeAssertion('Check mutation result', checkMutation); + makeAssertion('Check subscription result', checkSub); + makeAssertion('Delete test table', delTestTable); }); }; diff --git a/console/cypress/integration/data/404/test.js b/console/cypress/integration/data/404/test.js index 82140a4b6c827..94cdf4d444a69 100644 --- a/console/cypress/integration/data/404/test.js +++ b/console/cypress/integration/data/404/test.js @@ -15,7 +15,7 @@ const setup = () => { export const run404Test = () => { describe('404', () => { - it('Open random page', () => { + it('404-test : Open random page', () => { cy.visit('/someRandomPage'); cy.get('h1').contains('404'); }); diff --git a/console/cypress/integration/data/create-table/test.js b/console/cypress/integration/data/create-table/test.js index 3a1038bb0a517..518c4189afe2c 100644 --- a/console/cypress/integration/data/create-table/test.js +++ b/console/cypress/integration/data/create-table/test.js @@ -29,19 +29,44 @@ const setup = () => { }); }; +const testPrefix = 'create-table'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runCreateTableTests = () => { describe('Create Table', () => { - it('Create table button opens the correct route', checkCreateTableRoute); - it('Fails to create table without columns', failCTWithoutColumns); - it('Fails to create table without primary key', failCTWithoutPK); - it('Fails to create with duplicate columns', failCTDuplicateColumns); - it('Fails to create with duplicate primary key', failCTDuplicatePrimaryKey); - it('Fails to create with wrong default value', failCTWrongDefaultValue); - it('Successfuly creates table', passCT); - it('Fails to add existing table', failAddExistingTable); - it('Passes add existing table', passAddExistingTable); - it('Fails to create duplicate table', failCTDuplicateTable); - it('Delete off the test table', deleteCTTestTable); + makeAssertion( + 'Create table button opens the correct route', + checkCreateTableRoute + ); + makeAssertion( + 'Fails to create table without columns', + failCTWithoutColumns + ); + makeAssertion('Fails to create table without primary key', failCTWithoutPK); + makeAssertion( + 'Fails to create with duplicate columns', + failCTDuplicateColumns + ); + makeAssertion( + 'Fails to create with duplicate primary key', + failCTDuplicatePrimaryKey + ); + makeAssertion( + 'Fails to create with wrong default value', + failCTWrongDefaultValue + ); + makeAssertion('Successfuly creates table', passCT); + makeAssertion('Fails to add existing table', failAddExistingTable); + makeAssertion('Passes add existing table', passAddExistingTable); + makeAssertion('Fails to create duplicate table', failCTDuplicateTable); + makeAssertion('Delete off the test table', deleteCTTestTable); + makeAssertion( + 'Create table button opens the correct route', + checkCreateTableRoute + ); }); }; diff --git a/console/cypress/integration/data/insert-browse/test.js b/console/cypress/integration/data/insert-browse/test.js index 68b1b6186897c..b5f2b345484c3 100644 --- a/console/cypress/integration/data/insert-browse/test.js +++ b/console/cypress/integration/data/insert-browse/test.js @@ -35,26 +35,43 @@ const setup = () => { }); }; +const testPrefix = 'insert-browse'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runInsertBrowseTests = () => { describe('Table: Browse and Insert', () => { - it('Create a table with fields of all data types', passBICreateTable); - it('Search for tables', passSearchTables); - it('Check Insert Route', checkInsertRoute); - it('Fails when entered wrong data type', failBIWrongDataType); - it('Insert 20 rows', passBIInsert20Rows); - it('Fail for adding null for not null keys', failBINullKeys); - it('Fail for adding same data for Unique keys', failBIUniqueKeys); - it('Check browser rows route', checkBrowseRoute); - it('20 Inserted rows reflect in browse rows', passBI20RowsExist); - it('Check pagination in Browse Rows table', checkPagination); - it('Ascending sort works as expected', () => passBISort('asc')); - it('Descending sort works as expected', () => passBISort('desc')); - it('Filter query works as expected with $eq', passBIFilterQueryEq); - it('Check edit button', passEditButton); - it('Check for clone clear', passCloneButton); - it('Delete the row', passDeleteRow); - it('Check view relationship', checkViewRelationship); - it('Delete test table', deleteBITestTable); + makeAssertion( + 'Create a table with fields of all data types', + passBICreateTable + ); + makeAssertion('Search for tables', passSearchTables); + makeAssertion('Check Insert Route', checkInsertRoute); + makeAssertion('Fails when entered wrong data type', failBIWrongDataType); + makeAssertion('Insert 20 rows', passBIInsert20Rows); + makeAssertion('Fail for adding null for not null keys', failBINullKeys); + makeAssertion( + 'Fail for adding same data for Unique keys', + failBIUniqueKeys + ); + makeAssertion('Check browser rows route', checkBrowseRoute); + makeAssertion('20 Inserted rows reflect in browse rows', passBI20RowsExist); + makeAssertion('Check pagination in Browse Rows table', checkPagination); + makeAssertion('Ascending sort works as expected', () => passBISort('asc')); + makeAssertion('Descending sort works as expected', () => + passBISort('desc') + ); + makeAssertion( + 'Filter query works as expected with $eq', + passBIFilterQueryEq + ); + makeAssertion('Check edit button', passEditButton); + makeAssertion('Check for clone clear', passCloneButton); + makeAssertion('Delete the row', passDeleteRow); + makeAssertion('Check view relationship', checkViewRelationship); + makeAssertion('Delete test table', deleteBITestTable); }); }; diff --git a/console/cypress/integration/data/migration-mode/test.js b/console/cypress/integration/data/migration-mode/test.js index 005cef4299ed4..db15ab3645ba1 100644 --- a/console/cypress/integration/data/migration-mode/test.js +++ b/console/cypress/integration/data/migration-mode/test.js @@ -20,7 +20,7 @@ const setup = () => { export const runMigrationModeTests = () => { describe('Migration mode', () => { - it('Check the toggle button', checkToggleButton); + it('migration-mode : Check the toggle button', checkToggleButton); }); }; diff --git a/console/cypress/integration/data/modify/test.js b/console/cypress/integration/data/modify/test.js index 2b4c96c3eff88..83af59d995c1f 100644 --- a/console/cypress/integration/data/modify/test.js +++ b/console/cypress/integration/data/modify/test.js @@ -31,21 +31,39 @@ const setup = () => { }); }; +const testPrefix = 'modify-table'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runModifyTableTests = () => { describe('Modify Table', () => { - it('Creating a table', passMTCreateTable); - it('Moving to the table', passMTMoveToTable); - it('Modify table button opens the correct route', passMTCheckRoute); - it('Fails to add column without column name', failMTWithoutColName); - it('Fails without type selected', failMTWithoutColType); - it('Add a column', passMTAddColumn); - it('Fail modify with wrong default value', failMCWithWrongDefaultValue); - it('Pass modify with wrong default value', passMCWithRightDefaultValue); - it('Pass create foreign-key', passCreateForeignKey); - it('Pass remove foreign-key', passRemoveForeignKey); - it('Delete the column', passMTDeleteCol); - it('Delete Table Cancel', passMTDeleteTableCancel); - it('Delete table', passMTDeleteTable); + makeAssertion('Creating a table', passMTCreateTable); + makeAssertion('Moving to the table', passMTMoveToTable); + makeAssertion( + 'Modify table button opens the correct route', + passMTCheckRoute + ); + makeAssertion( + 'Fails to add column without column name', + failMTWithoutColName + ); + makeAssertion('Fails without type selected', failMTWithoutColType); + makeAssertion('Add a column', passMTAddColumn); + makeAssertion( + 'Fail modify with wrong default value', + failMCWithWrongDefaultValue + ); + makeAssertion( + 'Pass modify with wrong default value', + passMCWithRightDefaultValue + ); + makeAssertion('Pass create foreign-key', passCreateForeignKey); + makeAssertion('Pass remove foreign-key', passRemoveForeignKey); + makeAssertion('Delete the column', passMTDeleteCol); + makeAssertion('Delete Table Cancel', passMTDeleteTableCancel); + makeAssertion('Delete table', passMTDeleteTable); }); }; diff --git a/console/cypress/integration/data/permissions/test.js b/console/cypress/integration/data/permissions/test.js index ccb6b7ad56147..5fa1576ec3e72 100644 --- a/console/cypress/integration/data/permissions/test.js +++ b/console/cypress/integration/data/permissions/test.js @@ -28,18 +28,36 @@ const setup = () => { }); }; +const testPrefix = 'create-table'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runPermissionsTests = () => { describe('Permissions', () => { - it('Create a table', passPTCreateTable); - it('Create a view', passPVCreateView); - it('Check permission route', passPTCheckRoute); - it('Table No-check permissions work as expected', passPTNoChecks); - it('Table Custom-check permissions work as expected', passPTCustomChecks); - it('Table Permissions removal works as expected', passPTRemovePerms); - it('View permissions work as expected', passPVPermissions); - it('View Permissions removal works as expected', passPVRemovePerms); - it('Delete off the views', passPVDeleteView); - it('Delete off the test table', passPTDeleteTable); + makeAssertion('Create a table', passPTCreateTable); + makeAssertion('Create a view', passPVCreateView); + makeAssertion('Check permission route', passPTCheckRoute); + makeAssertion( + 'Table No-check permissions work as expected', + passPTNoChecks + ); + makeAssertion( + 'Table Custom-check permissions work as expected', + passPTCustomChecks + ); + makeAssertion( + 'Table Permissions removal works as expected', + passPTRemovePerms + ); + makeAssertion('View permissions work as expected', passPVPermissions); + makeAssertion( + 'View Permissions removal works as expected', + passPVRemovePerms + ); + makeAssertion('Delete off the views', passPVDeleteView); + makeAssertion('Delete off the test table', passPTDeleteTable); }); }; diff --git a/console/cypress/integration/data/raw-sql/test.js b/console/cypress/integration/data/raw-sql/test.js index e165dd2de6a47..ffdcebc738f9e 100644 --- a/console/cypress/integration/data/raw-sql/test.js +++ b/console/cypress/integration/data/raw-sql/test.js @@ -24,14 +24,20 @@ const setup = () => { }); }; +const testPrefix = 'raw-sql'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runRawSQLTests = () => { describe('Raw SQL', () => { - it('Open Raw SQL page', openRawSQL); - it('Pass create table', passCreateTable); - it('Pass insert values', passInsertValues); - it('Pass alter table', passAlterTable); - it('Pass create view', passCreateView); - it('Delete test table', delTestTables); + makeAssertion('Open Raw SQL page', openRawSQL); + makeAssertion('Pass create table', passCreateTable); + makeAssertion('Pass insert values', passInsertValues); + makeAssertion('Pass alter table', passAlterTable); + makeAssertion('Pass create view', passCreateView); + makeAssertion('Delete test table', delTestTables); }); }; diff --git a/console/cypress/integration/data/relationships/test.js b/console/cypress/integration/data/relationships/test.js index c3a3dbfff5718..251e3f75cf2ae 100644 --- a/console/cypress/integration/data/relationships/test.js +++ b/console/cypress/integration/data/relationships/test.js @@ -28,22 +28,31 @@ const setup = () => { }); }; +const testPrefix = 'relationships'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runRelationshipsTests = () => { describe('Relationships', () => { - it('Creating testing tables', passRTCreateTables); - it('Moving to the table', passRTMoveToTable); - it('Adding Manual Relationship Object', passRTAddManualObjRel); - it('Adding Manual Relationship Array', passRTAddManualArrayRel); - it('Adding a Foreign Key', passRTAddForeignKey); - it( + makeAssertion('Creating testing tables', passRTCreateTables); + makeAssertion('Moving to the table', passRTMoveToTable); + makeAssertion('Adding Manual Relationship Object', passRTAddManualObjRel); + makeAssertion('Adding Manual Relationship Array', passRTAddManualArrayRel); + makeAssertion('Adding a Foreign Key', passRTAddForeignKey); + makeAssertion( 'Check Add manual relationships button', checkAddManualRelationshipsButton ); - it('Deleting the relationships', passRTDeleteRelationships); - it('Adding Suggested Relationships Error', failRTAddSuggestedRel); - it('Adding Suggested Relationships', passRTAddSuggestedRel); - it('Deleting the relationships', passRTDeleteRelationships); - it('Deleting testing tables', passRTDeleteTables); + makeAssertion('Deleting the relationships', passRTDeleteRelationships); + makeAssertion( + 'Adding Suggested Relationships Error', + failRTAddSuggestedRel + ); + makeAssertion('Adding Suggested Relationships', passRTAddSuggestedRel); + makeAssertion('Deleting the relationships', passRTDeleteRelationships); + makeAssertion('Deleting testing tables', passRTDeleteTables); }); }; diff --git a/console/cypress/integration/data/views/test.js b/console/cypress/integration/data/views/test.js index 4c977b0fb2e22..891dc92b914a4 100644 --- a/console/cypress/integration/data/views/test.js +++ b/console/cypress/integration/data/views/test.js @@ -30,20 +30,26 @@ const setup = () => { }); }; +const testPrefix = 'views'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runViewsTest = () => { describe('Views', () => { - it('Create Tables', passVCreateTables); - it('Add data to table', passVAddData); - it('Create View', passVCreateViews); - it('Adding it to the table', passTrackTable); - it('Check the view route', passViewRoute); - it('Ascending order View Table', passVAscendingSort); - it('Filter the View table', passVFilterQueryEq); - it('Modify the View', passModifyView); - it('Adding Object Relationship to View', passVAddManualObjRel); - it('Deleting Relationship', passVDeleteRelationships); - it('Deleting View', passVDeleteView); - it('Deleting Tables', passVDeleteTables); + makeAssertion('Create Tables', passVCreateTables); + makeAssertion('Add data to table', passVAddData); + makeAssertion('Create View', passVCreateViews); + makeAssertion('Adding it to the table', passTrackTable); + makeAssertion('Check the view route', passViewRoute); + makeAssertion('Ascending order View Table', passVAscendingSort); + makeAssertion('Filter the View table', passVFilterQueryEq); + makeAssertion('Modify the View', passModifyView); + makeAssertion('Adding Object Relationship to View', passVAddManualObjRel); + makeAssertion('Deleting Relationship', passVDeleteRelationships); + makeAssertion('Deleting View', passVDeleteView); + makeAssertion('Deleting Tables', passVDeleteTables); }); }; diff --git a/console/cypress/integration/events/create-trigger/test.js b/console/cypress/integration/events/create-trigger/test.js index 06569cbfc1f10..db4cb8ca28963 100644 --- a/console/cypress/integration/events/create-trigger/test.js +++ b/console/cypress/integration/events/create-trigger/test.js @@ -28,20 +28,26 @@ const setup = () => { }); }; +const testPrefix = 'create-trigger'; + +const makeAssertion = (assertion, specFunc) => { + it(`${testPrefix} : ${assertion}`, specFunc); +}; + export const runCreateTriggerTests = () => { describe('Create Trigger', () => { - it('Create table to use in triggers', passPTCreateTable); - it('Visit events manage page', visitEventsManagePage); - it( + makeAssertion('Create table to use in triggers', passPTCreateTable); + makeAssertion('Visit events manage page', visitEventsManagePage); + makeAssertion( 'Create trigger button opens the correct route', checkCreateTriggerRoute ); - it('Fails to create trigger without data', failCTWithoutData); - it('Successfuly creates trigger', passCT); - it('Fails to create duplicate trigger', failCTDuplicateTrigger); - it('Insert a row and invoke trigger', insertTableRow); - it('Delete off the test trigger', deleteCTTestTrigger); - it('Delete off the test table', deleteCTTestTable); + makeAssertion('Fails to create trigger without data', failCTWithoutData); + makeAssertion('Successfuly creates trigger', passCT); + makeAssertion('Fails to create duplicate trigger', failCTDuplicateTrigger); + makeAssertion('Insert a row and invoke trigger', insertTableRow); + makeAssertion('Delete off the test trigger', deleteCTTestTrigger); + makeAssertion('Delete off the test table', deleteCTTestTable); }); }; diff --git a/console/package-lock.json b/console/package-lock.json index cb57bed7337a7..f09aff94d32a1 100644 --- a/console/package-lock.json +++ b/console/package-lock.json @@ -5674,8 +5674,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -5693,13 +5692,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5712,18 +5709,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -5826,8 +5820,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -5837,7 +5830,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5850,20 +5842,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.2.4", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5880,7 +5869,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -5953,8 +5941,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -5964,7 +5951,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -6040,8 +6026,7 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -6071,7 +6056,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6089,7 +6073,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6128,13 +6111,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.2", - "bundled": true, - "optional": true + "bundled": true } } }, diff --git a/console/package.json b/console/package.json index 0386e58bada91..a9576ff872a47 100644 --- a/console/package.json +++ b/console/package.json @@ -23,7 +23,7 @@ "dev": "concurrently --kill-others \"npm run watch-client\" \"npm run start-dev\" ", "precommit": "lint-staged", "cypress": "cypress open", - "test": "cypress run --spec 'cypress/integration/test_complete.js' --config baseUrl=$CYPRESS_BASE_URL" + "test": "sleep 60 && find ./cypress/integration/* -name 'test.js' | xargs -n1 -P2 cypress run --spec" }, "lint-staged": { "*.js": [