这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
419ac9c
improve console relationships test (#130)
aswinmprabhu Jul 16, 2018
75c8f77
Merge remote-tracking branch 'upstream/master'
aswinmprabhu Jul 16, 2018
69c1970
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 18, 2018
3b7d52b
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 19, 2018
b368e53
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 19, 2018
9639a5d
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 23, 2018
4e00657
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 24, 2018
6149d2e
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 24, 2018
171dabb
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 24, 2018
39044b6
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 24, 2018
93fb28f
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 25, 2018
990dd6e
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 26, 2018
c148eaf
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Jul 31, 2018
72e829f
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Aug 7, 2018
e057963
Merge branch 'master' of github.com:hasura/graphql-engine
aswinmprabhu Aug 9, 2018
b398050
modify npm test command
aswinmprabhu Aug 9, 2018
7c7c429
Merge branch 'master' of github.com:hasura/graphql-engine into aswin
wawhal Aug 13, 2018
a6f5181
cypress: check proper header index
wawhal Aug 13, 2018
8dd1315
sleep 60 seconds before tests start
wawhal Aug 13, 2018
dea9b1c
update cypress path in test command
wawhal Aug 13, 2018
9aaf84f
add prefix to console test assertions
aswinmprabhu Aug 13, 2018
255ed72
Merge branch 'master' of github.com:hasura/graphql-engine into parall…
aswinmprabhu Aug 13, 2018
f7e6df2
Merge branch 'master' into parallel-tests
praveenweb Sep 5, 2018
093c510
console: tests across data,events with 3 parallel
praveenweb Sep 5, 2018
b033d51
console: update create trigger, 4 parallel
praveenweb Sep 5, 2018
4116077
console: revert parallel to 3
praveenweb Sep 5, 2018
51c0c7d
console: revert parallel to 2
praveenweb Sep 6, 2018
3b166a7
Merge branch 'master' into parallel-tests
praveenweb Sep 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion console/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
5 changes: 3 additions & 2 deletions console/cypress/integration/api-explorer/graphql/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
20 changes: 13 additions & 7 deletions console/cypress/integration/api-explorer/graphql/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

Expand Down
2 changes: 1 addition & 1 deletion console/cypress/integration/data/404/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down
47 changes: 36 additions & 11 deletions console/cypress/integration/data/create-table/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
});
};

Expand Down
53 changes: 35 additions & 18 deletions console/cypress/integration/data/insert-browse/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

Expand Down
2 changes: 1 addition & 1 deletion console/cypress/integration/data/migration-mode/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

Expand Down
44 changes: 31 additions & 13 deletions console/cypress/integration/data/modify/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

Expand Down
38 changes: 28 additions & 10 deletions console/cypress/integration/data/permissions/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

Expand Down
18 changes: 12 additions & 6 deletions console/cypress/integration/data/raw-sql/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

Expand Down
31 changes: 20 additions & 11 deletions console/cypress/integration/data/relationships/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

Expand Down
30 changes: 18 additions & 12 deletions console/cypress/integration/data/views/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

Expand Down
Loading