Skip to content

Commit

Permalink
Fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Apr 27, 2024
1 parent 8b3a1e2 commit a168aac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/test/java/com/uniovi/Wiq_UnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ public void testGetPlayersWithScores() {
Player player2 = playerRepository.save(createDiferentPlayer("bb"));
Player player3 = playerRepository.save(createDiferentPlayer("cc"));

MultiplayerSession session = new MultiplayerSession("123",player3, new ArrayList<>());
MultiplayerSession session = new MultiplayerSession("123",player3);
Map<Player, Integer> playerScores = new HashMap<>();
playerScores.put(player1, 10);
playerScores.put(player2, 5);
Expand All @@ -1623,7 +1623,8 @@ public void testGetPlayersWithScores() {

@Test
@Order(98)
public void testMultiCreate() {
public void testMultiCreate() throws IOException, InterruptedException {
insertSomeQuestions();
// Given
Long playerId = 1L;
Player player = createPlayer();
Expand Down
4 changes: 1 addition & 3 deletions src/test/java/com/uniovi/steps/GameStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ public void iFillInTheSavedCode() {

@And("I see the multiplayer results")
public void iSeeTheMultiplayerResults() {
List<WebElement> elems = SeleniumUtils.waitLoadElementsBy(driver, "id", "createBtn", 5);
Assertions.assertEquals(1, elems.size());
elems.get(0).click();
SeleniumUtils.waitLoadElementsBy(driver, "text", p.getString("multi.info", PropertiesExtractor.getSPANISH()), 5);
SeleniumUtils.waitSeconds(driver, 5);
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/features/MultiplayerGame.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: I play a multiplayer game
When I press Play With Friends
And I create a code
And I press start
Then I should start playing until I see message "multi.finished"
Then I should start playing until I see message "multi.info"
And I see the multiplayer results

Scenario: I start a multiplayer game
Expand All @@ -30,5 +30,5 @@ Feature: I play a multiplayer game
And I fill in the saved code
And I press start
And I reload the page
Then I should start playing until I see message "multi.finished"
Then I should start playing until I see message "multi.info"
And I see the multiplayer results

0 comments on commit a168aac

Please sign in to comment.