-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
steps to new test scenario @TMslinK=SORDEV-12303
- Loading branch information
Showing
6 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...as-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/users/UserRolesPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.sormas.e2etests.pages.application.users; | ||
|
||
import org.openqa.selenium.By; | ||
|
||
public class UserRolesPage { | ||
public static By USER_RIGHTS_INPUT = By.cssSelector("#userRights input"); | ||
public static By NEW_USER_ROLE_BUTTON = By.cssSelector("div #userRoleNewUserRole"); | ||
public static By USER_ROLE_TEMPLATE_COMBOBOX = | ||
By.cssSelector(".popupContent #templateUserRole div"); | ||
public static By CAPTION_INPUT = By.cssSelector(".popupContent #caption"); | ||
public static By JURISDICTION_LEVEL_COMBOBOX = By.cssSelector(".popupContent #jurisdictionLevel"); | ||
public static By POPUP_SAVE_BUTTON = By.cssSelector(".popupContent #commit"); | ||
public static By POPUP_DISCARD_BUTTON = By.cssSelector(".popupContent #discard"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...e-tests/src/test/java/org/sormas/e2etests/steps/web/application/users/UserRolesSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2022 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.sormas.e2etests.steps.web.application.users; | ||
|
||
import static org.sormas.e2etests.pages.application.users.UserRolesPage.NEW_USER_ROLE_BUTTON; | ||
import static org.sormas.e2etests.pages.application.users.UserRolesPage.USER_ROLE_TEMPLATE_COMBOBOX; | ||
|
||
import cucumber.api.java8.En; | ||
import javax.inject.Inject; | ||
import org.sormas.e2etests.helpers.WebDriverHelpers; | ||
|
||
public class UserRolesSteps implements En { | ||
private final WebDriverHelpers webDriverHelpers; | ||
|
||
@Inject | ||
public UserRolesSteps(final WebDriverHelpers webDriverHelpers) { | ||
this.webDriverHelpers = webDriverHelpers; | ||
|
||
When( | ||
"I click on New user role button on User Roles Page", | ||
() -> { | ||
webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable(NEW_USER_ROLE_BUTTON); | ||
webDriverHelpers.clickOnWebElementBySelector(NEW_USER_ROLE_BUTTON); | ||
webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable( | ||
USER_ROLE_TEMPLATE_COMBOBOX); | ||
}); | ||
|
||
And( | ||
"^I choose \"([^\"]*)\" as the user role template$", | ||
(String userTemplate) -> { | ||
webDriverHelpers.selectFromCombobox(USER_ROLE_TEMPLATE_COMBOBOX, userTemplate); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters