Skip to content

Commit

Permalink
chore: add env
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 committed Jan 17, 2024
1 parent b6698fe commit ef67c8c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cypress-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
run: npm install --force

- name: Cypress run
env:
cypressUserName: ${{ secrets.CYPRESS_USERNAME }}
cypressPassword: ${{ secrets.CYPRESS_PASSWORD }}
uses: cypress-io/github-action@v6
with:
install: false
Expand Down
4 changes: 4 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ module.exports = defineConfig({
// implement node event listeners here
},
},
env: {
CYPRESS_USERNAME: "",
CYPRESS_PASSWORD: "",
},
});
10 changes: 6 additions & 4 deletions cypress/e2e/auth/login.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ describe("Login Module", () => {
});

it("should successfully log in with valid credentials", () => {
const username = Cypress.env("CYPRESS_USERNAME");
const password = Cypress.env("CYPRESS_PASSWORD");
cy.visit("http://localhost:9000/");
cy.get("[data-testid=email]").type("[email protected]");
cy.get("[data-testid=password]").type("Jeeva12#");
cy.get("[data-testid=email]").type(username);
cy.get("[data-testid=password]").type(password);
cy.get('button[type="submit"]').click({ force: true });
cy.url().should("eq", "http://localhost:9000/home");
cy.contains(
Expand All @@ -34,8 +36,8 @@ describe("Login Module", () => {

it("should display an error message with invalid credentials", () => {
cy.visit("http://localhost:9000/");
cy.get("[data-testid=email]").type("[email protected]");
cy.get("[data-testid=password]").type("invalid_password");
cy.get("[data-testid=email]").type("[email protected]");
cy.get("[data-testid=password]").type("xxxx");
cy.get('button[type="submit"]').click({ force: true });
cy.contains("Incorrect email or password").should("be.visible");
});
Expand Down
6 changes: 4 additions & 2 deletions cypress/e2e/processors/processors-list.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ describe.only("Processors Landing Module", () => {
cy.visit("http://localhost:9000/");
});
it("should successfully log in with valid credentials", () => {
cy.get("[data-testid=email]").type("[email protected]");
cy.get("[data-testid=password]").type("Jeeva12#");
const username = Cypress.env("CYPRESS_USERNAME");
const password = Cypress.env("CYPRESS_PASSWORD");
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=processors]").click({ force: true });
cy.url().should("eq", "http://localhost:9000/connectors");
Expand Down

0 comments on commit ef67c8c

Please sign in to comment.