From 7e3f3f5eb3cf821f9b48f20ca92d326a13a03e47 Mon Sep 17 00:00:00 2001 From: "Dario G. Mori" Date: Sun, 5 May 2024 10:49:28 +0200 Subject: [PATCH] test: export functions --- webapp/e2e/e2e_utils/e2e_utils_logout.js | 3 +-- webapp/e2e/e2e_utils/e2e_utils_register.js | 2 +- webapp/e2e/e2e_utils/e2e_utils_timeout.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/webapp/e2e/e2e_utils/e2e_utils_logout.js b/webapp/e2e/e2e_utils/e2e_utils_logout.js index b1689b91..e95238b6 100644 --- a/webapp/e2e/e2e_utils/e2e_utils_logout.js +++ b/webapp/e2e/e2e_utils/e2e_utils_logout.js @@ -8,7 +8,7 @@ const {waitForPageToLoad} = require('../e2e_utils/e2e_utils_timeout.js'); * * @param {*} page The website */ -async function logOutUser(page) { +export async function logOutUser(page) { // Logging out await expect(page).toClick("#lateralMenuButton"); await expect(page).toClick("button[data-testid='LogOut']"); @@ -23,4 +23,3 @@ async function logOutUser(page) { expect(value).toBeTruthy(); } modules.export = {logOutUser} - \ No newline at end of file diff --git a/webapp/e2e/e2e_utils/e2e_utils_register.js b/webapp/e2e/e2e_utils/e2e_utils_register.js index c72db54d..b20fc483 100644 --- a/webapp/e2e/e2e_utils/e2e_utils_register.js +++ b/webapp/e2e/e2e_utils/e2e_utils_register.js @@ -7,7 +7,7 @@ * @param {*} page The website * @returns An array with the credentials of the user created [email, username] */ -async function registerUserFromRootDirectory(username, page) { +export async function registerUserFromRootDirectory(username, page) { // Credentials for the new user let email = username + "@email.com" let password = username + "ps" diff --git a/webapp/e2e/e2e_utils/e2e_utils_timeout.js b/webapp/e2e/e2e_utils/e2e_utils_timeout.js index f99c2d31..a2ad9b87 100644 --- a/webapp/e2e/e2e_utils/e2e_utils_timeout.js +++ b/webapp/e2e/e2e_utils/e2e_utils_timeout.js @@ -3,7 +3,7 @@ * Auxiliar function that times out the tests for some time, so the page can be fully loaded. * @param {*} timeout_ms Amount of ms to wait. */ -async function waitForPageToLoad(timeout_ms = 6000) { +export async function waitForPageToLoad(timeout_ms = 6000) { await new Promise(resolve => setTimeout(resolve, timeout_ms)); }