a1f25506f2
Closes: https://github.com/hasura/graphql-engine/issues/6903 Description: This PR adds `Select schema` as a default text in schema drop down box on events triggers. ![Screenshot from 2021-05-12 15-39-09](https://user-images.githubusercontent.com/68095256/117958025-3d204e80-b338-11eb-9169-ec529db0bf6f.png) Affected Components: - [x] Console https://github.com/hasura/graphql-engine-mono/pull/1348 GitOrigin-RevId: 28b6054addf8fcb11b80ae357cfcbe8b71a470bc |
||
---|---|---|
.. | ||
fixtures | ||
helpers | ||
integration | ||
plugins | ||
support | ||
.eslintrc | ||
global.d.ts | ||
README.md | ||
tsconfig.json |
Test
Running all tests to generate coverage
- Set the
TEST_MODE
field incypress.json
tocli
- Run the command
npm run test
from theconsole
directory to run all the tests.
You can also run the complete tests from the cypress electron app:
- Set the
TEST_MODE
field incypress.json
tocli
- Run
npm run cypress
from theconsole
directory. - Click on
test_complete.js
Running tests individually
Tests are modularized into following modules:
- API-Explorer
- Data
- Migration Mode
- Create Table
- Insert Browse
- Modify Table
- Table Relationships
- Table and View Permissions
- Views
To run the tests for the modules individually (say for create table),
- Go to the
cypress.json
and set theenv > TEST_MODE
variable toui
.
{
"env": {
"TEST_MODE": "ui"
}
}
- Run the command
npm run cypress
and click oncreate-table > test.js
Writing Tests
-
Read ups
-
If this is your first time with cypress, check out this getting started guide
-
Read cypress best practices
-
-
File Structure
The top-level directories in console/cypress are auto-generated by cypress except helpers. To understand the use of each directory check out Folder Structure
helpers directory is used for sharing reusable functions/constants across tests. Before adding a resubale function in this directory, consider if it will be better as a custom cypress command, if so, then add it to Support directory following this guide, preferrably to command.ts file.
-
Adding a Test
Tests go to integration directory, where there are folders corresponding to Components in Services directory (The top-level routes on the console).
Each of these folders contains different test folders, named after the particular feature they are testing. For example create-table folder tests the functionality of creating a table from the console UI.