Skip to content

Commit

Permalink
Added e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
uo289267 committed Apr 20, 2024
1 parent a503257 commit 504232b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webapp/e2e/features/gameMenu.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ Feature: Game Menu page functionality
Scenario: There should be visible three links
Given I am on the game menu
Then three buttons should be visible
Scenario: New Game should go to game configurator
Given I am on the game menu
When I click on New Game
Then I should be in the game configurator
12 changes: 12 additions & 0 deletions webapp/e2e/steps/gameMenu.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,17 @@ defineFeature(feature, test => {
expect(elements.length).toBeGreaterThan(0); // At least one element with class 'linkButton'
});
});
test('New Game should go to game configurator', ({ given, when, then }) => {
given('I am on the game menu', async () => {
await page.goto('http://localhost:3000/menu');
await page.waitForSelector('.divMenu');
});
when('I click on New Game', async () => {
await page.click('.linkButton:first-child');
});
then('I should be in the game configurator', async () => {
await expect(page).toMatchElement('.GameConfiguratorDiv');
});
});

});

0 comments on commit 504232b

Please sign in to comment.