Skip to content

Commit

Permalink
fix: login_register_negative_blank_email_credentials.steps.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Toto-hitori committed May 5, 2024
1 parent 95346c2 commit 96aa9b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion webapp/e2e/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
testMatch: ["**/playing_full_game_pos*.steps.js","**/login_register_negative_bad_email_format.steps.js", "**/login_positive.steps.js","**/about_positive_logged_user_seeing_about_screen.steps.js"
testMatch: ["**/playing_full_game_pos*.steps.js","**/login_register_negative_bad_email_format.steps.js","**/login_register_negative_blank_email_credentials.steps.js", "**/login_positive.steps.js","**/about_positive_logged_user_seeing_about_screen.steps.js"
,"**/about_positive_non_logged_user_seeing_about_screen.steps.js"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
testTimeout: 30000
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { waitForPageToLoad } from '../e2e_utils/e2e_utils_timeout.js';

const { defineFeature, loadFeature }=require('jest-cucumber');
const puppeteer = require('puppeteer');
const setDefaultOptions = require("expect-puppeteer").setDefaultOptions;
Expand All @@ -26,13 +24,9 @@ defineFeature(feature, test => {
}, 120000);

test("A registered user wants to log in using his credentials but leaving the email in blank", ({given,when,and,then}) => {
let username = "t.login.neg.blank_em"
let user;
let password;


given('A registered user in the root screen', async () => {
waitForPageToLoad();
await new Promise(resolve => setTimeout(resolve, 5000)); // Waiting for page to fully load
let header = await page.$eval("button[data-testid='Login']", (element) => {
return element.innerHTML
})
Expand All @@ -46,7 +40,7 @@ defineFeature(feature, test => {
});

and('User enters in the log in screen', async() => {
waitForPageToLoad();
await new Promise(resolve => setTimeout(resolve, 5000)); // Waiting for page to fully load
let header = await page.$eval("h2", (element) => {
return element.innerHTML
})
Expand All @@ -56,16 +50,16 @@ defineFeature(feature, test => {
});

and('User fills the form with his proper password but leaves the email in blank', async() => {
await expect(page).toFill("#user", user);
await expect(page).toFill("#password", password);
await expect(page).toFill("#user", "");
await expect(page).toFill("#password", "password");
});

and('User presses the log in button', async() => {
await expect(page).toClick("button[data-testid='Login'");
});

then('Log in screen shows an informative error message and does not allow the user to log in', async() => {
waitForPageToLoad();
await new Promise(resolve => setTimeout(resolve, 5000)); // Waiting for page to fully load
let header = await page.$eval("div[class='chakra-alert__desc css-zzks76'", (element) => {
return element.innerHTML
})
Expand Down

0 comments on commit 96aa9b5

Please sign in to comment.