Skip to content

Commit

Permalink
Merge pull request #157 from MarcusT96/test/bids
Browse files Browse the repository at this point in the history
Fixade custom command för login som pontus användare
  • Loading branch information
PontusPilatus authored May 16, 2024
2 parents 7d84fb2 + 4e1c23e commit 8c008b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cypress/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = defineConfig(
specPattern: '**/*.feature',
baseUrl,
video: false,
supportFile: false,
supportFile: "support/commands.js",
screenshotOnRunFailure: false,
setupNodeEvents(on, config) {
// implement node event listeners here
Expand Down
6 changes: 1 addition & 5 deletions Cypress/specs/step_definitions/bid.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { Given, When, Then } from "@badeball/cypress-cucumber-preprocessor";

Given('I am logged in', () => {
cy.visit('https://team4.nodehill.se/', { headers: { "Accept-Encoding": 'gzip, deflate' } });
cy.get('div.app__navbar-login').click();
cy.get('[type="email"]').type('[email protected]');
cy.get('[type="password"]').type('hej123');
cy.get('button[type="submit"]').click();
cy.login()
cy.wait(2000);
});

Expand Down
6 changes: 2 additions & 4 deletions Cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

Cypress.Commands.add('login', (email,password) => {
Cypress.Commands.add('login', () => {
cy.visit("https://team4.nodehill.se/", { headers: { "Accept-Encoding": 'gzip, deflate' } });
cy.get('div.app__navbar-login').click();
cy.get('[type="email"]').type('[email protected]');
cy.get('[type="password"]').type('hej123');
cy.get('button[type="submit"]').click();
});

Cypress.Commands.addAll({login})
});

0 comments on commit 8c008b5

Please sign in to comment.