From d184f3436877f828ef51ecbab79e1549ab12472d Mon Sep 17 00:00:00 2001 From: uo289267 Date: Thu, 25 Apr 2024 16:07:50 +0200 Subject: [PATCH] fixed flaky --- webapp/e2e/features/competitiveGame.feature | 4 ++++ webapp/e2e/steps/competitiveGame.steps.js | 17 +++++++++++++++-- .../GameConfigurator/GameConfigurator.js | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/webapp/e2e/features/competitiveGame.feature b/webapp/e2e/features/competitiveGame.feature index 073860b..3062007 100644 --- a/webapp/e2e/features/competitiveGame.feature +++ b/webapp/e2e/features/competitiveGame.feature @@ -2,4 +2,8 @@ Feature: Game Configurator and Competitive Game functionality Scenario: Create Competitive Game should go to /questions Given I am on the game configurator When I click on new competitive game + Then I am in /questions + Scenario: Create Customized Game should go to /questions + Given I am on the game configurator + When I click on new customized game Then I am in /questions \ No newline at end of file diff --git a/webapp/e2e/steps/competitiveGame.steps.js b/webapp/e2e/steps/competitiveGame.steps.js index 95f41da..8bd7682 100644 --- a/webapp/e2e/steps/competitiveGame.steps.js +++ b/webapp/e2e/steps/competitiveGame.steps.js @@ -9,8 +9,8 @@ const { register, login, logout } = require("../utils"); let page; let browser; -const email = "testUser@example.com"; -const username = "testUser" +const email = "testUser1@example.com"; +const username = "testUser1" const password = "testUserPassword" defineFeature(feature, test => { @@ -46,5 +46,18 @@ defineFeature(feature, test => { await expect(page).toMatchElement('.questionContainer'); }); }); + + test('Create Customized Game should go to /questions', ({ given,when, then }) => { + given('I am on the game configurator', async () => { + await page.goto('http://localhost:3000/configurator'); + await page.waitForSelector('.GameConfiguratorDiv'); + }); + when('I click on new customized game', async () => { + await page.click('.linkButton'); + }); + then('I am in /questions', async () => { + await expect(page).toMatchElement('.questionContainer'); + }); + }); }); diff --git a/webapp/src/components/GameConfigurator/GameConfigurator.js b/webapp/src/components/GameConfigurator/GameConfigurator.js index 5ab12b2..899a852 100644 --- a/webapp/src/components/GameConfigurator/GameConfigurator.js +++ b/webapp/src/components/GameConfigurator/GameConfigurator.js @@ -71,7 +71,7 @@ function ButtonRandomizeCustom({t,handleClick}){ function ButtonCustomized({t,handleClick}) { return ( - + ); }