-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Cypress test cases running (#130)
- Loading branch information
1 parent
bd0a1cd
commit 0ebe932
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# To Run the CYPRESS test cases | ||
|
||
Run all the services of the hyperswitch-helm repository as mentioned in the `README.md` file of the repository. | ||
|
||
## In `hyperswitch-control-center` | ||
|
||
1. Run the following command to start the hyperswitch control center test cases: | ||
```sh cypress_hyperswitch_control_center.sh``` | ||
|
||
## In `hyperswitch-web` | ||
|
||
1. `git clone https://github.com/juspay/hyperswitch-web.git` | ||
|
||
2. `cd hyperswitch-web` | ||
|
||
3. In the `cypress-tests/cypress.env.json` file update the keys correctly | ||
|
||
4. In the `cypress-tests/cypress/support/utils.ts` update the profileId | ||
|
||
5. In the `Hyperswitch-React-Demo-App/.env` update the profileId, keys, server and client urls | ||
|
||
6. Make sure you have cypress installed in the system `npm install cypress --save-dev` | ||
|
||
7. Run the following command to start the hyperswitch web test cases: | ||
```sh cypress_web.sh``` | ||
|
||
## In `hyperswitch` | ||
|
||
1. `git clone https://github.com/juspay/hyperswitch` | ||
|
||
2. `cd hyperswitch` | ||
|
||
3. Have the `creds.json` file in the `hyperswitch/cypress-tests` directory | ||
|
||
4. Make sure you replace the the command in cypress_router.sh with the correct domain name of the postgresql service in the hyperswitch namespace. | ||
``psql --host=your-hypers-v1-postgresql-0-domain --username=hyperswitch --dbname=hyperswitch --command "\copy cards_info FROM '../.github/data/cards_info.csv' DELIMITER ',' CSV HEADER;"`` | ||
|
||
5. Password | ||
`ZGJwYXNzd29yZDEx` | ||
|
||
6. Run the following command to start the hyperswitch test cases: | ||
```sh cypress_router.sh``` |
5 changes: 5 additions & 0 deletions
5
charts/incubator/hyperswitch-app/templates/misc/cypress_hyperswitch_control_center.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
git clone https://github.com/juspay/hyperswitch-control-center | ||
cd hyperswitch-control-center | ||
|
||
npm install | ||
npx cypress run |
12 changes: 12 additions & 0 deletions
12
charts/incubator/hyperswitch-app/templates/misc/cypress_router.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cd cypress-tests | ||
|
||
npm ci | ||
psql --host=your-hypers-v1-postgresql-0-domain --username=hyperswitch --dbname=hyperswitch --command "\copy cards_info FROM '../.github/data/cards_info.csv' DELIMITER ',' CSV HEADER;" | ||
|
||
export CYPRESS_CONNECTOR="stripe" | ||
export CYPRESS_BASEURL="localhost:8080" | ||
export DEBUG=cypress:cli | ||
export CYPRESS_ADMINAPIKEY="test_admin" | ||
export CYPRESS_CONNECTOR_AUTH_FILE_PATH="creds.json" | ||
|
||
npm run cypress:ci |
8 changes: 8 additions & 0 deletions
8
charts/incubator/hyperswitch-app/templates/misc/cypress_web.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
npm install | ||
|
||
cd Hyperswitch-React-Demo-App | ||
npm start & | ||
cd .. | ||
cd cypress-tests | ||
|
||
npm test |