mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-22 22:17:55 +00:00
* docs: jira * docs: formatting + Client Credentials grant type * docs: connection string pgsql * docs: parameterized queries mysql * docs: parameterized queries in PostgreSQL * docs: update mysql example * docs: TJDB sql editor * docs: add metadata to REST API * docs: add, update postgresql media * docs: add metadata to graphql * docs: update parameterized queries * docs: add parameterized queries for mssql * docs: add SSL Cert to mysql * docs: TJDB SQL restricted commands * docs: update JIRA token location * docs: update delete issue example * docs: update find user by query example * docs: remove session id from get assignable users * docs: use correct image for get issues for board * docs: update create issue example * docs: update delete issue media * docs: update assignable users media * docs: update examples * docs: update key desc * docs: v2.68.0-Beta
57 lines
No EOL
1.5 KiB
Markdown
57 lines
No EOL
1.5 KiB
Markdown
---
|
|
id: testing
|
|
title: Testing
|
|
---
|
|
|
|
Follow the steps below to setup and run the test specifications using Cypress. We recommend [setting up ToolJet locally](/docs/contributing-guide/setup/macos) before proceeding.
|
|
|
|
## Setting up
|
|
|
|
- Navigate to the `cypress-tests` directory and enter the following command:
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
## Running Tests
|
|
#### Headed mode
|
|
- To run cypress in **headed** mode, run the following command:
|
|
```bash
|
|
npm run cy:open
|
|
```
|
|
- In **headed** mode, the user will be able to choose the test specs from the test runner:
|
|
<div style={{textAlign: 'center'}}>
|
|
|
|
<img className="screenshot-full" src="/img/testing/headed.png" alt="Cypress headed mode" />
|
|
|
|
</div>
|
|
|
|
#### Headless mode
|
|
|
|
- To run cypress in **headless** mode, run the following command:
|
|
```bash
|
|
npm run cy:run
|
|
```
|
|
|
|
- For running specific spec in headless mode, run for specific spec
|
|
```bash
|
|
npm run cy:run -- --spec "cypress/e2e/dashboard/multi-workspace/manageSSO.cy.js
|
|
```
|
|
|
|
<div style={{textAlign: 'center'}}>
|
|
|
|
<img className="screenshot-full" src="/img/testing/headless.png" alt="Cypress headless mode" />
|
|
|
|
</div>
|
|
|
|
:::caution
|
|
If some test specs need the environment variables, the user can pass them similar to the following command:
|
|
```bash
|
|
npm run cy:open -- --env='{"pg_host":"localhost","pg_user":"postgres", "pg_password":"postgres"}'
|
|
```
|
|
or the user can add env-vars in the **cypress.config.js** file
|
|
:::
|
|
|
|
|
|
:::info
|
|
Check all the Cypress commands [here](https://docs.cypress.io/guides/guides/command-line#Commands)
|
|
::: |