Skip to content

Commit

Permalink
[CYP-7] Resolve PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostap-Z committed Jan 31, 2024
1 parent dcb8732 commit a7540c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 3 additions & 0 deletions helpers/data_classes/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import { Data } from 'dataclass';


class User extends Data {
ID;
EMAIL;
USERNAME;
PASSWORD;
TOKEN;
BIO;
IMAGE;
}

export {
Expand Down
4 changes: 2 additions & 2 deletions tests/login/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Feature: Login
Scenario: A user can get an error when loging in with an invalid email
Given I create a user via API
And I open the login page
When I perform log in with an invalid email
When I perform log in with an invalid 'email'
Then I should see the 'email or password is invalid' error

Scenario: A user can get an error when loging in with an invalid password
Given I create a user via API
And I open the login page
When I perform log in with an invalid password
When I perform log in with an invalid 'password'
Then I should see the 'email or password is invalid' error
13 changes: 5 additions & 8 deletions tests/login/login.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Given('I create a user via API', () => {
user = User.create({
EMAIL: response.body.user.email,
USERNAME: response.body.user.username,
PASSWORD: password,
TOKEN: response.body.user.token
PASSWORD: password
});
});
});
Expand All @@ -43,12 +42,10 @@ When('I perform login with a previous created user', () => {
loginPage.login(user.EMAIL, user.PASSWORD);
});

When('I perform log in with an invalid email', () => {
loginPage.login(generateEmail(), user.PASSWORD);
});

When('I perform log in with an invalid password', () => {
loginPage.login(user.EMAIL, generatePassword());
When('I perform log in with an invalid {string}', (credentialField) => {
credentialField === 'email'
? loginPage.login(generateEmail(), user.PASSWORD)
: loginPage.login(user.EMAIL, generatePassword());
});

Then('I should see I am logged in', () => {
Expand Down

0 comments on commit a7540c6

Please sign in to comment.