Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed flaky #128

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions webapp/e2e/features/competitiveGame.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 15 additions & 2 deletions webapp/e2e/steps/competitiveGame.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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');
});
});

});
2 changes: 1 addition & 1 deletion webapp/src/components/GameConfigurator/GameConfigurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function ButtonRandomizeCustom({t,handleClick}){

function ButtonCustomized({t,handleClick}) {
return (
<button className="linkButton" onClick={handleClick}>{t("gameConfigurator.play_custom")}</button>
<button className="linkButton" id="customized" onClick={handleClick}>{t("gameConfigurator.play_custom")}</button>
);
}

Expand Down