From aa212f580223254d6370a76d2e837e7c811ba2cc Mon Sep 17 00:00:00 2001 From: CANCI0 Date: Fri, 26 Apr 2024 18:10:37 +0200 Subject: [PATCH] =?UTF-8?q?M=C3=A1s=20arreglos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/e2e/steps/create-group.steps.js | 17 +++++++++++++++++ webapp/e2e/steps/login-form.steps.js | 4 ++-- webapp/e2e/steps/register-form.steps.js | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/webapp/e2e/steps/create-group.steps.js b/webapp/e2e/steps/create-group.steps.js index 4728d3b9..2c27b4df 100644 --- a/webapp/e2e/steps/create-group.steps.js +++ b/webapp/e2e/steps/create-group.steps.js @@ -8,6 +8,23 @@ const feature = loadFeature("./features/create-group.feature"); let page; let browser; +function generateUUID() { + const hexDigits = '0123456789abcdef'; + let uuid = ''; + for (let i = 0; i < 36; i++) { + if (i === 8 || i === 13 || i === 18 || i === 23) { + uuid += '-'; + } else if (i === 14) { + uuid += '4'; + } else if (i === 19) { + uuid += hexDigits.charAt(Math.floor(Math.random() * 4) + 8); + } else { + uuid += hexDigits.charAt(Math.floor(Math.random() * 16)); + } + } + return uuid; +} + defineFeature(feature, (test) => { beforeAll(async () => { browser = process.env.GITHUB_ACTIONS diff --git a/webapp/e2e/steps/login-form.steps.js b/webapp/e2e/steps/login-form.steps.js index b643568e..6e298965 100644 --- a/webapp/e2e/steps/login-form.steps.js +++ b/webapp/e2e/steps/login-form.steps.js @@ -70,8 +70,8 @@ defineFeature(feature, (test) => { }); test("The user is registered in the site", ({ given, when, then }) => { - let username; - let password; + var username; + var password; given("A registered user", async () => { username = "testuser"; diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index df2ff179..2e965f96 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -87,8 +87,8 @@ defineFeature(feature, (test) => { }); test("The user is not registered in the site", ({ given, when, then }) => { - let username; - let password; + var username; + var password; given("An unregistered user", async () => { await expect(page).toClick("a", { text: "RegĂ­strate" });