Skip to content

Commit

Permalink
fix: Fix Programs Overview Listing - MEED-2871 - Meeds-io/MIPs#100
Browse files Browse the repository at this point in the history
Prior to this change, the Test case 'Programs Overview Widget sorted by modified date' has failed on CI.
This is due to changes made on MIP#100 to let programs with Open Space audience listed even not member.
This change will adapt the test case to consider Spaces with Validation registration type.
  • Loading branch information
boubaker authored and exo-swf committed Nov 9, 2023
1 parent 23e7718 commit 0698761
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/test/java/io/meeds/qa/ui/steps/ManageSpaceSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ public void addSpaceWithInviteUser(String spaceName, String user) {
manageSpacesPage.saveSpace();
}

public void addSpaceWithRegistrationAndInviteUser(String spaceName, String registration, String user) {
manageSpacesPage.openSpaceFormDrawer();
manageSpacesPage.setSpaceName(spaceName);
manageSpacesPage.setSpaceDescription(spaceName);
manageSpacesPage.clickFirstProcessButton();
manageSpacesPage.checkSpaceRegistration(registration);
manageSpacesPage.clickSecondProcessButton();
manageSpacesPage.inviteUserToSpace(user);
manageSpacesPage.saveSpace();
}

public void addSpaceWithRegistration(String spaceName, String registration) {
manageSpacesPage.openSpaceFormDrawer();
manageSpacesPage.setSpaceName(spaceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,23 @@ public void addARandomSpaceWithRandomUserInvited(String userPrefix) {
setSessionVariable(RANDOM_SPACE_NAME).to(randomSpaceName);
}

@Given("^I create the '(.*)' random space with the '(.*)' random user as member and registration '(.*)'$")
public void addARandomSpaceWithRegistrationAndRandomUserInvited(String spacePrefix, String userPrefix, String registration) {
String randomSpaceName = RANDOM_SPACE_NAME + getRandomNumber();
String userFirstName = Serenity.sessionVariableCalled(userPrefix + "UserFirstName");
homeSteps.goToManageSpacesPage();
manageSpaceSteps.addSpaceWithRegistrationAndInviteUser(randomSpaceName, registration, userFirstName);
setSessionVariable(spacePrefix + "RandomSpaceName").to(randomSpaceName);
}

@Given("^I create the '(.*)' random space with registration '(.*)'$")
public void addARandomSpaceWithRegistration(String spacePrefix, String registration) {
String randomSpaceName = RANDOM_SPACE_NAME + getRandomNumber();
homeSteps.goToManageSpacesPage();
manageSpaceSteps.addSpaceWithRegistration(randomSpaceName, registration);
TestInitHook.spaceWithPrefixCreated(spacePrefix + "RandomSpaceName", randomSpaceName, Serenity.getDriver().getCurrentUrl());
}

@Given("I open space invitation drawer")
public void openSpaceInvitationDrawer() {
manageSpaceSteps.openSpaceInvitationDrawer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Feature: Programs should be displayed in Top Programs in sorted way
Given I am authenticated as 'admin' random user

When I create the thirtyone random user
And I create the thirtyone random space with the thirtyone random user as member
And I create the thirtytwo random space with the thirtyone random user as member
And I create the thirtythree random space
And I create the 'thirtyone' random space with the 'thirtyone' random user as member and registration 'Validation'
And I create the 'thirtytwo' random space with the 'thirtyone' random user as member and registration 'Validation'
And I create the 'thirtythree' random space with registration 'Validation'

When I go to 'Contributions' application
And I create the 'thirtytwo' random program with
Expand Down

0 comments on commit 0698761

Please sign in to comment.