Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 63537a6c authored by Jaime Pérez-Lozana's avatar Jaime Pérez-Lozana
Browse files

Merge branch 'SOUI-SIMPL-3106,-@SIMPL-3107,-@SIMPL-3108,-@SIMPL-3109' into 'develop'

SOUI-SIMPL-3106,-@SIMPL-3107,-@SIMPL-3108,-@SIMPL-3109

See merge request simpl/pso/pso-test/pso-test-automation!149
parents 38c9c01c 577d38c9
No related branches found
No related tags found
No related merge requests found
Pipeline #268542 passed with warnings
package framework.ui.locators.simplOpen;
public class Authority {
public static final String ONBOARDING_INFO_REGISTER_BUTTON = ".mdc-button--unelevated.mat-primary";
public static final String ONBOARDING_FORM = "form[id='applicationForm']";
public static final String EMAIL_ADDRESS = "input[id='email']";
public static final String ONBOARDING_INFO_REGISTER_BUTTON_LOCATOR = ".mdc-button--unelevated.mat-primary";
public static final String ONBOARDING_FORM_LOCATOR = "form[id='applicationForm']";
public static final String EMAIL_ADDRESS_LOCATOR = "input[id='email']";
public static final String ORGANISATION_INPUT_LOCATOR = "input[id='organization']";
public static final String PARTICIPANT_TYPE_DROPDOMN_MENU = "#mat-mdc-form-field-label-4";
public static final String PARTICIPANT_TYPE_SELECTED = "//*[@id=\"mat-select-value-1\"]/span/span";
public static final String PARTICIPANT_TYPE_OPTIONS = "[role=option]";
public static final String PARTICIPANT_TYPE_INPUT = "#participantType";
public static final String CREATE_CREDENTIALS_BUTTON = "//button[.//span[text()='Create credentials']]";
public static final String SUCCESSFUL_MESSAGE = "h6";
public static final String PARTICIPANT_TYPE_DROPDOMN_MENU_LOCATOR = "#mat-mdc-form-field-label-4";
public static final String PARTICIPANT_TYPE_SELECTED_LOCATOR = "//*[@id=\"mat-select-value-1\"]/span/span";
public static final String PARTICIPANT_TYPE_OPTIONS_LOCATOR = "[role=option]";
public static final String PARTICIPANT_TYPE_INPUT_LOCATOR = "#participantType";
public static final String CREATE_CREDENTIALS_BUTTON_LOCATOR = "//button[.//span[text()='Create credentials']]";
public static final String SUCCESSFUL_MESSAGE_LOCATOR = "h6";
public static final String SURNAME_INPUT_LOCATOR = "input[id='surname']";
public static final String NAME_INPUT_LOCATOR = "input[id='name']";
public static final String USERNAME_INPUT_LOCATOR = "input[id='username']";
......@@ -18,40 +18,39 @@ public class Authority {
public static final String CONFIRM_PASSWORD_INPUT_LOCATOR = "label[for='confirmPassword']";
public static final String USER_GENEREATED_LOCATOR = "div.lead:nth-child(1)";
public static final String PASSWORD_GENEREATED_LOCATOR = "div.lead:nth-child(2)";
public static final String SUBMISSION_FORM_BUTTON = "//button[.//span[text()='Go to the application submission form →']]";
public static final String SUBMIT_APPLICATION_POPUP = "//*[@id=\"mat-mdc-dialog-title-0\"]";
public static final String KEYCLOAK_USERNAME_INPUT = "input[id='username']";
public static final String KEYCLOAK_PASSWORD_INPUT = "input[id='password']";
public static final String KEYCLOAK_SIGN_IN_BUTTON = "input[id='kc-login']";
public static final String SUBMISSION_FORM_BUTTON_LOCATOR = "//button[.//span[text()='Go to the application submission form →']]";
public static final String SUBMIT_APPLICATION_POPUP_LOCATOR = "//*[@id=\"mat-mdc-dialog-title-0\"]";
public static final String KEYCLOAK_USERNAME_INPUT_LOCATOR = "input[id='username']";
public static final String KEYCLOAK_PASSWORD_INPUT_LOCATOR = "input[id='password']";
public static final String KEYCLOAK_SIGN_IN_BUTTON_LOCATOR = "input[id='kc-login']";
public static final String ERROR_MESSAGE_LOCATOR = "//span[@id='input-error']";
public static final String PARTICIPANT_LIST_TABLE = "table[role='table']";
public static final String REQUEST_LIST_TABLE_CONTENT_PANEL = "//app-requests/div/div/div/div/div[2]/app-request-list/table/tbody";
public static final String REQUEST_STATUS_DETAILS_DIALOG = "//mat-dialog-content[contains(@class, 'mat-mdc-dialog-content')]";
public static final String ONBOARDING_STATUS_PANEL = "//div/app-onboarding-status/div/div";
public static final String ONBOARDING_REQUESTS_PANEL = "//div[contains(text(), 'Request submitted' )]";
public static final String PARTICIPANT_LIST_TABLE_LOCATOR = "table[role='table']";
public static final String REQUEST_LIST_TABLE_CONTENT_PANEL_LOCATOR = "//app-requests/div/div/div/div/div[2]/app-request-list/table/tbody";
public static final String REQUEST_STATUS_DETAILS_DIALOG_LOCATOR = "//mat-dialog-content[contains(@class, 'mat-mdc-dialog-content')]";
public static final String ONBOARDING_STATUS_PANEL_LOCATOR = "//div/app-onboarding-status/div/div";
public static final String ONBOARDING_REQUESTS_PANEL_LOCATOR = "//div[contains(text(), 'Request submitted' )]";
public static final String GREEN_ICON_LOCATOR = ".mat-icon:nth-child(1)";
public static final String GREY_ICON_LOCATOR_2 = "//div[contains(text(), '2' )]";
public static final String GREY_ICON_LOCATOR_3 = "//div[contains(text(), '3' )]";
public static final String SEE_REQUEST_DETAILS_BUTTON_LOCATOR = "//span[contains(text(), 'See request details' )]";
public static final String PARTICIPANT_LIST_FILTER_DROPDOWN_OPTIONS = "mat-option[role='option']";
public static final String PARTICIPANT_LIST_FILTER_INPUT = "input[matinput]";
public static final String PARTICIPANT_LIST_PARTICIPANT_NAME_COLUMN = "//td[contains(@class, " +
public static final String PARTICIPANT_LIST_FILTER_DROPDOWN_OPTIONS_LOCATOR = "mat-option[role='option']";
public static final String PARTICIPANT_LIST_FILTER_INPUT_LOCATOR = "input[matinput]";
public static final String PARTICIPANT_LIST_PARTICIPANT_NAME_COLUMN_LOCATOR = "//td[contains(@class, " +
"'cdk-column-organization')]";
public static final String PARTICIPANT_DETAILS_HEADER = "//h1[contains(text(), 'Participant Details' )]";
public static final String PARTICIPANT_DETAILS_COLUMNS = "div[class='col']";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_HEADER_COLUMNS = "th[role='columnheader']";
public static final String PARTICIPANT_DETAILS_ATTRIBUTES_TABLE = "table[class='mat-mdc-table mdc-data-table__table cdk-table mat-sort ng-star-inserted']";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_NAME_COLUMN = "//td[contains(@class, " +
public static final String PARTICIPANT_DETAILS_HEADER_LOCATOR = "//h1[contains(text(), 'Participant Details' )]";
public static final String PARTICIPANT_DETAILS_COLUMNS_LOCATOR = "div[class='col']";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_HEADER_COLUMNS_LOCATOR = "th[role='columnheader']";
public static final String PARTICIPANT_DETAILS_ATTRIBUTES_TABLE_LOCATOR = "table[class='mat-mdc-table mdc-data-table__table cdk-table mat-sort ng-star-inserted']";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_NAME_COLUMN_LOCATOR = "//td[contains(@class, " +
"'cdk-column-name')]";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_CODE_COLUMN = "//td[contains(@class, " +
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_CODE_COLUMN_LOCATOR = "//td[contains(@class, " +
"'cdk-column-code')]";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_LAST_UPDATE_DATE_COLUMN = "//td[contains" +
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_LAST_UPDATE_DATE_COLUMN_LOCATOR = "//td[contains" +
"(@class, 'cdk-column-updateTimestamp')]";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_TABLE = "tbody[role='rowgroup']";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_TABLE_LOCATOR = "tbody[role='rowgroup']";
public static final String FILTER_FORM_BUTTON_LOCATOR = "span.mdc-button__label";
public static final String
FIRST_FILTER_DROP_DOWN_ARROW_LOCATOR = "#filterColumn > div > " +
public static final String FIRST_FILTER_DROP_DOWN_ARROW_LOCATOR = "#filterColumn > div > " +
"div.mat-mdc-select-arrow-wrapper";
public static final String SECOND_FILTER_DROP_DOWN_ARROW_LOCATOR = "#filterStatusSelection > div > " +
"div.mat-mdc-select-arrow-wrapper";
......@@ -60,41 +59,47 @@ public class Authority {
public static final String FILTER_TABLE = "tbody.mdc-data-table__content";
public static final String REQUEST_STATUS_COLUMN_FROM_REQUEST_LIST_TABLE_LOCATOR = "td.mat-mdc-cell.mdc-data-table__cell." +
"cdk-cell.cdk-column-status.mat-column-status";
public static final String REQUEST_EMAIL_COLUMN__FORM_REQUEST_LIST_TABLE_LOCATOR = "//td[contains(translate(@class, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', " +
public static final String REQUEST_EMAIL_COLUMN_FORM_REQUEST_LIST_TABLE_LOCATOR = "//td[contains(translate(@class, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', " +
"'abcdefghijklmnopqrstuvwxyz'), 'email')]";
public static final String REQUEST_LAST_CHANGE_DATE_COLUMN__FORM_REQUEST_LIST_TABLE_LOCATOR = "td.mat-mdc-cell.mdc-data-table__cell.cdk-cell" +
public static final String REQUEST_LAST_CHANGE_DATE_COLUMN_FORM_REQUEST_LIST_TABLE_LOCATOR = "td.mat-mdc-cell.mdc-data-table__cell.cdk-cell" +
".cdk-column-updateTimestamp.mat-column-updateTimestamp";
public static final String REQUEST_DATE_COLUMN__FORM_REQUEST_LIST_TABLE_LOCATOR = "td.mat-mdc-cell.mdc-data-table__cell.cdk-cell" +
public static final String REQUEST_DATE_COLUMN_FORM_REQUEST_LIST_TABLE_LOCATOR = "td.mat-mdc-cell.mdc-data-table__cell.cdk-cell" +
".cdk-column-updateTimestamp.mat-column-creationTimestamp";
public static final String PARTICIPANT_TYPE_COLUMN__FORM_REQUEST_LIST_TABLE_LOCATOR = "td.mat-mdc-cell.mdc-data-table__cell." +
"cdk-cell.cdk-column-participantType.mat-column-participantType";
public static final String REQUEST_DATE_HEADER__FORM_REQUEST_LIST_LOCATOR = "//div[contains(text(), ' Request date ' )]";
public static final String REQUEST_DATE_HEADER__FORM_LAST_CHANGE_DATE_LOCATOR = "//div[contains(text(), ' Last change date ' )]";
public static final String REQUEST_DATA_HEADER__FORM_REQUEST_LIST_ARROW_LOCATOR = "//th[contains(@class,'mat-sort-header')]";
public static final String REQUEST_DATA_HEADER__FORM_LAST_CHANGE_DATE_ARROW_LOCATOR = "//th[contains(@class,'mat-column-up')]";
public static final String PARTICIPANT_TYPE_COLUMN_FROM_PARTICIPANT_LIST_TABLE_LOCATOR = "td.mat-mdc-cell.mdc-data-table__cell.cdk-cell." +
"cdk-column-participantType.mat-column-participantType";
public static final String ONBOARDING_DATE_COLUMN_FROM_PARTICIPANT_LIST_TABLE_LOCATOR = " td.mat-mdc-cell.mdc-data-table__cell.cdk-cell." +
"cdk-column-updateTimestamp.mat-column-updateTimestamp";
public static final String REQUEST_DATE_HEADER_FORM_REQUEST_LIST_LOCATOR = "//div[contains(text(), ' Request date ' )]";
public static final String REQUEST_DATE_HEADER_FORM_LAST_CHANGE_DATE_LOCATOR = "//div[contains(text(), ' Last change date ' )]";
public static final String REQUEST_DATA_HEADER_FORM_REQUEST_LIST_ARROW_LOCATOR = "//th[contains(@class,'mat-sort-header')]";
public static final String REQUEST_DATA_HEADER_FORM_LAST_CHANGE_DATE_ARROW_LOCATOR = "//th[contains(@class,'mat-column-up')]";
public static final String PARTICIPANT_lIST_HEADER_PARTICIPANT_TYPE_LOCATOR = "//div[contains(text(), ' Participant type')]";
public static final String PARTICIPANT_lIST_HEADER_ONBOARDING_DATE_LOCATOR = "//div[contains(text(), ' Onboarding Date')]";
public static final String PARTICIPANT_lIST_HEADER_PARTICIPANT_TYPE_ARROW_LOCATOR = "//th[contains(@class,' mat-column-participantType')]";
public static final String PARTICIPANT_lIST_HEADER_ONBOARDING_DATE_ARROW_LOCATOR = "//th[contains(@class,'mat-column-up')]";
public static final String APPROVE_REQUEST_BUTTON_LOCATOR = ".col-lg-2.mx-2.mb-1.btn.btn-primary";
public static final String REJECT_REQUEST_BUTTON_LOCATOR = ".col-lg-2.mx-2.mb-1.btn.btn-secondary";
public static final String CONFIRM_DETAILS_DIALOG = ".mdc-dialog__container";
public static final String TITLE_DIALOG_LOCATOR = "//*[contains(@id,'mat-mdc-dialog-title')]";
public static final String MESSAGE_WITHIN_APPROVAL_DIALOGUE_LOCATOR = "p[class='ng-star-inserted']";
public static final String MESSAGE_WITHIN_REJECT_DIALOGUE_LOCATOR = "//app-confirm-dialog/div[1]/p";
public static final String REJECT_REQUEST_TYPE_REASON_FIELD = "//app-confirm-dialog/div[1]/mat-form-field/div[1]/div/div[2]/textarea";
public static final String CHOOSE_FILE_BUTTON = "input[type='file']";
public static final String IDENTITY_ATTRIBUTE_NAME_FIELD = "input[name='name']";
public static final String IDENTITY_ATTRIBUTE_CODE_FIELD = "input[name='code']";
public static final String IDENTITY_ATTRIBUTE_ASSIGNABLE_TO_TIER_1_CHECKBOX = "//label[contains(text(), 'Assignable to Tier 1' )]/preceding-sibling::input";
public static final String IDENTITY_ATTRIBUTE_EDITION_ENABLED_CHECKBOX = "//input[@id=\"input-enabled\"]";
public static final String IDENTITY_ATTRIBUTE_CREATION_SAVE_BUTTON = "//span[text()=' Save']";
public static final String IDENTITY_ATTRIBUTE_CREATION_CANCEL_BUTTON = "//span[text()=' Cancel']";
public static final String IDENTITY_ATTRIBUTE_LIST_ASSIGNABLE_TO_ROLE_COLUMN = ".cdk-column-assignableToRoles [data-testid='text-element']";
public static final String IDENTITY_ATTRIBUTE_LIST_IN_USE_COLUMN = ".cdk-column-used [data-testid='text-element']";
public static final String EMPTY_LIST_MESSAGE = "div.p-5.text-center";
public static final String REJECT_REQUEST_TYPE_REASON_FIELD_LOCATOR = "//app-confirm-dialog/div[1]/mat-form-field/div[1]/div/div[2]/textarea";
public static final String CHOOSE_FILE_BUTTON_LOCATOR = "input[type='file']";
public static final String IDENTITY_ATTRIBUTE_NAME_FIELD_LOCATOR = "input[name='name']";
public static final String IDENTITY_ATTRIBUTE_CODE_FIELD_LOCATOR = "input[name='code']";
public static final String IDENTITY_ATTRIBUTE_ASSIGNABLE_TO_TIER_1_CHECKBOX_LOCATOR = "//label[contains(text(), 'Assignable to Tier 1' )]/preceding-sibling::input";
public static final String IDENTITY_ATTRIBUTE_EDITION_ENABLED_CHECKBOX_LOCATOR = "//input[@id=\"input-enabled\"]";
public static final String IDENTITY_ATTRIBUTE_CREATION_SAVE_BUTTON_LOCATOR = "//span[text()=' Save']";
public static final String IDENTITY_ATTRIBUTE_CREATION_CANCEL_BUTTON_LOCATOR = "//span[text()=' Cancel']";
public static final String IDENTITY_ATTRIBUTE_LIST_ASSIGNABLE_TO_ROLE_COLUMN_LOCATOR = ".cdk-column-assignableToRoles [data-testid='text-element']";
public static final String IDENTITY_ATTRIBUTE_LIST_IN_USE_COLUMN_LOCATOR = ".cdk-column-used [data-testid='text-element']";
public static final String EMPTY_LIST_MESSAGE_LOCATOR = "div.p-5.text-center";
public static final String LIST_IDENTITY_ATTRIBUTE_ID_LOCATOR = "//td[@class='mat-mdc-cell mdc-data-table__cell cdk-cell cdk-column-id mat-column-id']";
public static final String IDENTITY_ATTRIBUTE_EDIT_BUTTON_LOCATOR = "//span[normalize-space()='Edit Attribute']";
public static final String IDENTITY_ATTRIBUTE_DETAILS_COLUMNS = "div[class='col']";
public static final String IDENTITY_ATTRIBUTE_DETAILS_COLUMNS_LOCATOR = "div[class='col']";
public static final String NEW_ATTRIBUTE_BUTTON_LOCATOR = "//span[normalize-space()='New Attribute']";
public static final String ITEMS_PER_PAGE_DROPDOWN = "#mat-select-2 > div > div.mat-mdc-select-arrow-wrapper > div";
public static final String ITEMS_PER_PAGE_TEXT_FIELD = ".mat-mdc-paginator-range-label";
public static final String ITEMS_PER_PAGE_DROPDOWN_LOCATOR = "#mat-select-2 > div > div.mat-mdc-select-arrow-wrapper > div";
public static final String ITEMS_PER_PAGE_TEXT_FIELD_LOCATOR = ".mat-mdc-paginator-range-label";
public static final String NEXT_PAGE_BUTTON_LOCATOR = "button[aria-label='Next page'] span[class='mat-mdc-button-touch-target']";
public static final String PREVIOUS_PAGE_BUTTON_LOCATOR = "button[aria-label='Previous page'] span[class='mat-mdc-button-touch-target']";
public static final String COLUMN_HEADING_LOCATOR = "thead th div.mat-sort-header-content";
......
......@@ -80,7 +80,7 @@ public class AuthorityPage {
*/
public void verifyInRequestTableListDisplayTheFiltersValueSelected(String valueType, String expectedValue, Locator locatorValue) {
itemsPerPageSelectionInTableDropdown(100);
assertElementIsVisibleByLocator(page.locator(REQUEST_LIST_TABLE_CONTENT_PANEL));
assertElementIsVisibleByLocator(page.locator(REQUEST_LIST_TABLE_CONTENT_PANEL_LOCATOR));
String formattedExpectedValue = valueType.equalsIgnoreCase("status")
? expectedValue.toUpperCase()
......@@ -142,10 +142,10 @@ public class AuthorityPage {
* @param assignable whether the identity attribute will be assigned to Tier 1.
*/
public void fillIdentityAttributeForm(String name, String code, boolean assignable) {
page.locator(IDENTITY_ATTRIBUTE_NAME_FIELD).fill(name);
page.locator(IDENTITY_ATTRIBUTE_CODE_FIELD).fill(code);
page.locator(IDENTITY_ATTRIBUTE_NAME_FIELD_LOCATOR).fill(name);
page.locator(IDENTITY_ATTRIBUTE_CODE_FIELD_LOCATOR).fill(code);
Locator assignableCheckbox = UiSetup.page.locator(IDENTITY_ATTRIBUTE_ASSIGNABLE_TO_TIER_1_CHECKBOX);
Locator assignableCheckbox = UiSetup.page.locator(IDENTITY_ATTRIBUTE_ASSIGNABLE_TO_TIER_1_CHECKBOX_LOCATOR);
if (assignableCheckbox.isChecked() != assignable) {
assignableCheckbox.click();
......@@ -199,12 +199,20 @@ public class AuthorityPage {
public void sortsTheValuesOfAColumnTable(String sortDirection, String columnToSort) {
switch (columnToSort) {
case "Request Date":
selectAscendOrDescend(sortDirection, page.locator(REQUEST_DATE_HEADER__FORM_REQUEST_LIST_LOCATOR),
page.locator(REQUEST_DATA_HEADER__FORM_REQUEST_LIST_ARROW_LOCATOR).first());
selectAscendOrDescend(sortDirection, page.locator(REQUEST_DATE_HEADER_FORM_REQUEST_LIST_LOCATOR),
page.locator(REQUEST_DATA_HEADER_FORM_REQUEST_LIST_ARROW_LOCATOR).first());
break;
case "Last change date":
selectAscendOrDescend(sortDirection, page.locator(REQUEST_DATE_HEADER__FORM_LAST_CHANGE_DATE_LOCATOR),
page.locator(REQUEST_DATA_HEADER__FORM_LAST_CHANGE_DATE_ARROW_LOCATOR));
selectAscendOrDescend(sortDirection, page.locator(REQUEST_DATE_HEADER_FORM_LAST_CHANGE_DATE_LOCATOR),
page.locator(REQUEST_DATA_HEADER_FORM_LAST_CHANGE_DATE_ARROW_LOCATOR));
break;
case "Participant Type":
selectAscendOrDescend(sortDirection, page.locator(PARTICIPANT_lIST_HEADER_PARTICIPANT_TYPE_LOCATOR),
page.locator(PARTICIPANT_lIST_HEADER_PARTICIPANT_TYPE_ARROW_LOCATOR));
break;
case "Onboarding Date":
selectAscendOrDescend(sortDirection, page.locator(PARTICIPANT_lIST_HEADER_ONBOARDING_DATE_LOCATOR),
page.locator(PARTICIPANT_lIST_HEADER_ONBOARDING_DATE_ARROW_LOCATOR));
break;
default:
throw new IllegalArgumentException("Unknown column to be sorted: ".concat(columnToSort));
......@@ -237,8 +245,8 @@ public class AuthorityPage {
* This method verifies the elements belonging to the pagination are visible.
*/
public void verifyThePaginationElementsAreVisible() {
assertElementIsVisibleByLocator(page.locator(ITEMS_PER_PAGE_DROPDOWN));
assertElementIsVisibleByLocator(page.locator(ITEMS_PER_PAGE_TEXT_FIELD));
assertElementIsVisibleByLocator(page.locator(ITEMS_PER_PAGE_DROPDOWN_LOCATOR));
assertElementIsVisibleByLocator(page.locator(ITEMS_PER_PAGE_TEXT_FIELD_LOCATOR));
assertElementIsVisibleByLocator(page.locator(NEXT_PAGE_BUTTON_LOCATOR));
assertElementIsVisibleByLocator(page.locator(PREVIOUS_PAGE_BUTTON_LOCATOR));
}
......@@ -248,14 +256,14 @@ public class AuthorityPage {
* @param numberValueByPage
*/
public void itemsPerPageSelectionInTableDropdown(Integer numberValueByPage) {
Locator numberOfResultsLocator = page.locator(ITEMS_PER_PAGE_DROPDOWN);
Locator numberOfResultsLocator = page.locator(ITEMS_PER_PAGE_DROPDOWN_LOCATOR);
assertElementIsVisibleByLocator(numberOfResultsLocator);
numberOfResultsLocator.click();
int countElements = page.locator(PARTICIPANT_TYPE_OPTIONS).count();
int countElements = page.locator(PARTICIPANT_TYPE_OPTIONS_LOCATOR).count();
for (int i = 0; i < countElements; i++) {
String valueElement = page.locator(PARTICIPANT_TYPE_OPTIONS).nth(i).innerText();
String valueElement = page.locator(PARTICIPANT_TYPE_OPTIONS_LOCATOR).nth(i).innerText();
if (valueElement.equals(numberValueByPage.toString())) {
page.locator(PARTICIPANT_TYPE_OPTIONS).nth(i).click();
page.locator(PARTICIPANT_TYPE_OPTIONS_LOCATOR).nth(i).click();
break;
}
}
......@@ -318,10 +326,16 @@ public class AuthorityPage {
public void verifyTheDatesValuesOfTheColumnWereSorted(String columnToSort) {
switch (columnToSort) {
case "Last change date":
compareTwoListsAreEquals(page.locator(REQUEST_LAST_CHANGE_DATE_COLUMN__FORM_REQUEST_LIST_TABLE_LOCATOR));
compareTwoListsAreEquals(page.locator(REQUEST_LAST_CHANGE_DATE_COLUMN_FORM_REQUEST_LIST_TABLE_LOCATOR));
break;
case "Request Date":
compareTwoListsAreEquals(page.locator(REQUEST_DATE_COLUMN__FORM_REQUEST_LIST_TABLE_LOCATOR));
compareTwoListsAreEquals(page.locator(REQUEST_DATE_COLUMN_FORM_REQUEST_LIST_TABLE_LOCATOR));
break;
case "Participant Type":
compareTwoListsAreEquals(page.locator(PARTICIPANT_TYPE_COLUMN_FROM_PARTICIPANT_LIST_TABLE_LOCATOR));
break;
case "Onboarding Date":
compareTwoListsAreEquals(page.locator(ONBOARDING_DATE_COLUMN_FROM_PARTICIPANT_LIST_TABLE_LOCATOR));
break;
default:
throw new IllegalArgumentException("Unknown column to verify: ".concat(columnToSort));
......@@ -360,8 +374,8 @@ public class AuthorityPage {
assertElementIsVisibleByLocator(buttonLocator);
String columnLocator = switch (listToReview) {
case "request list" -> REQUEST_EMAIL_COLUMN__FORM_REQUEST_LIST_TABLE_LOCATOR;
case "participant list" -> PARTICIPANT_LIST_PARTICIPANT_NAME_COLUMN;
case "request list" -> REQUEST_EMAIL_COLUMN_FORM_REQUEST_LIST_TABLE_LOCATOR;
case "participant list" -> PARTICIPANT_LIST_PARTICIPANT_NAME_COLUMN_LOCATOR;
default -> throw new IllegalArgumentException("Invalid list provided value: " + listToReview);
};
page.waitForSelector(columnLocator);
......@@ -413,7 +427,7 @@ public class AuthorityPage {
}
private void processRejection() throws InterruptedException {
Locator reasonField = page.locator(REJECT_REQUEST_TYPE_REASON_FIELD);
Locator reasonField = page.locator(REJECT_REQUEST_TYPE_REASON_FIELD_LOCATOR);
assertElementIsVisibleByLocator(reasonField);
reasonField.fill("Automation reject test");
......
......@@ -433,4 +433,18 @@ Feature: Authority
Examples:
| columnName |
| Assignable to Role |
| In use |
\ No newline at end of file
| In use |
@TCA29 @SIMPL-3106, @SIMPL-3107, @SIMPL-3108, @SIMPL-3109
Scenario Outline: User sorts Participant List requests by <columnToSort> in <sortDirection> order
Given the user navigates to the "Participant Management" page
And the user logs in with a user with "IATTR_M" role
When the user sorts by "<sortDirection>" "<columnToSort>"
Then the Participant List requests is sorted successfully by "<columnToSort>"
Examples:
| sortDirection | columnToSort |
| ascending | Participant Type |
| descending | Participant Type |
| ascending | Onboarding Date |
| descending | Onboarding Date |
\ No newline at end of file
......@@ -54,7 +54,7 @@ public class CommonSteps {
public void theUserClicksOnTheFirstResult(String listName) {
switch (listName) {
case "Participant List":
page.locator(PARTICIPANT_TYPE_COLUMN__FORM_REQUEST_LIST_TABLE_LOCATOR).first().click();
page.locator(PARTICIPANT_TYPE_COLUMN_FROM_PARTICIPANT_LIST_TABLE_LOCATOR).first().click();
break;
case "Request List":
page.locator(REQUEST_STATUS_COLUMN_FROM_REQUEST_LIST_TABLE_LOCATOR).first().click();
......@@ -73,9 +73,9 @@ public class CommonSteps {
}
public void keycloakLogin(Utils.LogInDetails userAndPassword) {
page.locator(KEYCLOAK_USERNAME_INPUT).fill(userAndPassword.getUsername());
page.locator(KEYCLOAK_PASSWORD_INPUT).fill(userAndPassword.getPassword());
Locator signInButton = page.locator(KEYCLOAK_SIGN_IN_BUTTON);
page.locator(KEYCLOAK_USERNAME_INPUT_LOCATOR).fill(userAndPassword.getUsername());
page.locator(KEYCLOAK_PASSWORD_INPUT_LOCATOR).fill(userAndPassword.getPassword());
Locator signInButton = page.locator(KEYCLOAK_SIGN_IN_BUTTON_LOCATOR);
if (signInButton.isEnabled()) {
signInButton.click();
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment