Skip to content

Commit

Permalink
test: cypress update (#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 authored Sep 19, 2024
1 parent 93382db commit 6f59156
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 398 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cypress-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:

- name: Make Curl Request
run: |
# Replace the URL with your actual endpoint
response=$(curl --location --request GET 'http://localhost:8080/health')
# Once the service is up, make the actual curl request
response=$(curl --location --request GET 'http://0.0.0.0:8080/health')
echo "Response:"
echo "$response"
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,38 @@ Welcome to the standard process for raising a Pull Request (PR) directly from a
- Include relevant tests, documentation updates, or screenshots, if applicable.
- Collaborate and communicate effectively with other contributors and maintainers throughout the review process.
## Cypress Test Suite
### Running Tests
1.
```
npm run build:test
npm run test:start
```
2. To run tests interactively in Cypress Test Runner:
```
npm run cy:open
```
3. To run tests in headless mode (CI/CD):
```
npm run cy:run
```
### Running Tests Locally
## Prerequisite
1. Make sure to run the Hyperswitch backend locally by following the instructions at https://github.com/juspay/hyperswitch.
2. Once the backend is running, follow the steps in Running Tests to execute the Cypress test suite.
## License
This project is open-source and available under the Apache 2.0 license.
Expand Down
33 changes: 29 additions & 4 deletions cypress/e2e/auth/auth.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ describe("Auth Module", () => {
cy.get("#footer").should("exist");
});

it("check singup flow", () => {
it("check signup flow", () => {
const password = "Cypress98#";
cy.visit("http://localhost:9000/");
cy.get("#card-subtitle").click();
cy.url().should("include", "/register");
cy.get("[data-testid=email]").type(username);
cy.get("[data-testid=password]").type(password);
cy.get('button[type="submit"]').click({ force: true });
cy.get("[data-testid=skip-now]").click({ force: true });
cy.url().should("eq", "http://localhost:9000/dashboard/home");
});

Expand Down Expand Up @@ -57,7 +58,12 @@ describe("Auth Module", () => {
sdk_url: "",
logo_url: "",
favicon_url: "",
agreement_url: "",
agreement_version: "",
apple_pay_certificate_url: "",
mixpanel_token: "",
recon_iframe_url: "",
dss_certificate_url: "",
},
features: {
test_live_toggle: false,
Expand All @@ -75,12 +81,25 @@ describe("Auth Module", () => {
mixpanel: false,
generate_report: false,
user_journey_analytics: false,
authentication_analytics: false,
surcharge: false,
permission_based_module: false,
dispute_evidence_upload: false,
paypal_automatic_flow: false,
invite_multiple: false,
"accept-invite": false,
threeds_authenticator: false,
global_search: false,
dispute_analytics: false,
configure_pmts: false,
branding: false,
live_users_counter: false,
granularity: false,
custom_webhook_headers: false,
compliance_certificate: false,
user_management_revamp: false,
pm_authentication_processor: true,
performance_monitor: false,
new_analytics: false,
down_time: false,
tax_processor: true,
},
},
}).as("getFeatureData");
Expand All @@ -90,6 +109,10 @@ describe("Auth Module", () => {
cy.url().should("include", "/login");
cy.get("#card-header").should("contain", "Hey there, Welcome back!");
cy.get("#card-subtitle").should("contain", "Sign up");
cy.get("[data-testid=card-foot-text]")
.should("contain", "sign in using password")
.click();

cy.get("[data-testid=forgot-password]").click();
cy.url().should("include", "/forget-password");
cy.get("#card-header").should("contain", "Forgot Password?");
Expand All @@ -101,6 +124,7 @@ describe("Auth Module", () => {
cy.get("[data-testid=email]").type(username);
cy.get("[data-testid=password]").type(password);
cy.get('button[type="submit"]').click({ force: true });
cy.get("[data-testid=skip-now]").click({ force: true });
cy.url().should("eq", "http://localhost:9000/dashboard/home");
});

Expand All @@ -118,6 +142,7 @@ describe("Auth Module", () => {
cy.get("[data-testid=email]").type(` ${username} `);
cy.get("[data-testid=password]").type(password);
cy.get('button[type="submit"]').click({ force: true });
cy.get("[data-testid=skip-now]").click({ force: true });
cy.url().should("eq", "http://localhost:9000/dashboard/home");
});
});
101 changes: 0 additions & 101 deletions cypress/e2e/processors/processores-paypal_test.cy.js

This file was deleted.

126 changes: 0 additions & 126 deletions cypress/e2e/quick-start/prod-quick-start.cy.js

This file was deleted.

Loading

0 comments on commit 6f59156

Please sign in to comment.