Skip to content

Commit

Permalink
Merge pull request #13 from JoanEsquivel/cypress-12
Browse files Browse the repository at this point in the history
Cypress 12 & path aliases implemented
  • Loading branch information
JoanEsquivel authored Dec 10, 2022
2 parents 556f5b7 + 89fc9f0 commit 2dffd3b
Show file tree
Hide file tree
Showing 6 changed files with 627 additions and 616 deletions.
3 changes: 2 additions & 1 deletion cypress/e2e/step_definitions/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import {
When,
Then,
} from "@badeball/cypress-cucumber-preprocessor";
const loginPage = require("../../pages/LoginPage");
import {loginPage} from '@pages/LoginPage'

Given("A web browser is at the saucelabs login page", () => {
cy.visit("/");
});

When("A user enters the username {string}, the password {string}, and clicks on the login button", (username,password) => {
loginPage.submitLogin(username,password)

});

When("A user provides incorrect credentials, and clicks on the login button", (table) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/step_definitions/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
When,
Then,
} from "@badeball/cypress-cucumber-preprocessor";
const loginPage = require("../../pages/LoginPage");
import {loginPage} from '@pages/LoginPage'

Given("A web browser is at the saucelabs login page - tag demo", () => {
cy.visit("/");
Expand Down
4 changes: 2 additions & 2 deletions cypress/pages/LoginPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class homeSaucePage {
class LoginPage {
elements = {
usernameInput: () => cy.get("#user-name"),
passwordInput: () => cy.get("#password"),
Expand All @@ -25,4 +25,4 @@ class homeSaucePage {
}
}

module.exports = new homeSaucePage();
export const loginPage = new LoginPage();
10 changes: 10 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@pages/*": [
"./cypress/pages/*"
]
}
}
}
Loading

0 comments on commit 2dffd3b

Please sign in to comment.