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

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

Merge branch 'SOUI-SIMPL-3453' into 'develop'

SOUI-SIMPL-3453

See merge request simpl/pso/pso-test/pso-test-automation!165
parents a5bc7bb7 ea247ac9
No related branches found
No related tags found
No related merge requests found
Pipeline #275731 passed with warnings
......@@ -46,6 +46,7 @@ public class Authority {
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_TABLE_LAST_CHANGE_DATE_COLUMN = "Last change date";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_TABLE_ACTIONS = "Actions";
public static final String IDENTITY_ATTRIBUTES_DETAILS_HEADER = "Identity attributes details";
public static final String IDENTITY_ATTRIBUTES_LIST_HEADER = "Attributes list";
public static final String PARTICIPANT_PAGE_PARTICIPANT_LIST_HEADER = "Participant List";
public static final String PARTICIPANT_PAGE_FILTER_BUTTON = "Filter";
public static final String PARTICIPANT_PAGE_RESET_FILTER_BUTTON = "Reset";
......@@ -60,6 +61,7 @@ public class Authority {
public static final String NEW_ATTRIBUTE_HEADER = "New attribute";
public static final String SUCCESSFUL_IDENTITY_ATTRIBUTE_CREATION_ALERT_MESSAGE = "You successfully created an attribute";
public static final String SUCCESSFUL_IDENTITY_ATTRIBUTE_EDITION_ALERT_MESSAGE = "You successfully edited an attribute";
public static final String SUCCESSFUL_IDENTITY_ATTRIBUTE_DELETION_ALERT_MESSAGE = "identityAttributesManagementPage.deleteIdentityAttribueSuccess";
public static final String SUCCESSFUL_REQUEST_SENT_ALERT_MESSAGE = "Request sent successfully.";
public static final String ROLE_RESTRICTED = "Role Restricted Access";
public static final String ACCESS_DENIED = "Access denied. Your role does not grant permission to view this content.";
......
......@@ -55,5 +55,4 @@ public class CalendarWidget {
page.getByLabel(date.format(MONTH_FORMAT)).click();
page.getByLabel(date.format(DAY_FORMAT)).click();
}
}
......@@ -242,5 +242,4 @@ public final class Utils {
assertElementIsVisibleByLocator(rejectButton);
rejectButton.click();
}
}
......@@ -48,8 +48,7 @@ public class Authority {
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_LOCATOR = "//td[contains(@class, " +
"'cdk-column-code')]";
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_LOCATOR = "//td[contains" +
"(@class, 'cdk-column-updateTimestamp')]";
public static final String PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_TABLE_LOCATOR = "tbody[role='rowgroup']";
......@@ -123,6 +122,9 @@ public class Authority {
public static final String IDENTITY_ATTRIBUTE_LIST_DELETE_DIALOG_LOCATOR = "[role=dialog]";
public static final String IDENTITY_ATTRIBUTE_LIST_DELETE_DIALOG_TITLE_LOCATOR = "h2[mat-dialog-title]";
public static final String IDENTITY_ATTRIBUTE_LIST_DELETE_DIALOG_MESSAGE_LOCATOR = "mat-dialog-content p";
public static final String IDENTITY_ATTRIBUTE_REMOVE_BUTTON_LOCATOR = "//mat-icon[normalize-space()='delete']";
public static final String IDENTITY_ATTRIBUTE_DELETE_BUTTON_LOCATOR = "//span[normalize-space()='Delete']";
public static final String IDENTITY_ATTRIBUTE_DELETE_CANCEL_BUTTON_LOCATOR = "//span[normalize-space()='Cancel']";
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 ng-star-inserted']";
public static final String IDENTITY_ATTRIBUTE_EDIT_BUTTON_LOCATOR = "//span[normalize-space()='Edit Attribute']";
......
......@@ -501,6 +501,25 @@ Feature: Authority
| the user is filtering by Onboarding date | Onboarding Date | |
#| the user is filtering by Email | Email | complete |
@TCA33 @SIMPL-3453
Scenario: Cancellation of the Identity Attribute Deletion Process
Given the user navigates to the "Identity Attributes" page
And the user logs in with a user with "IATTR_M" role
And the user filters by "Name" with value "PSO SIMPL-3453 IDENTITY ATTRIBUTE"
And the users clicks on the remove button under the Action column
And the system prompts the user to confirm the removal action
Then the user cancels the removal action
And the page displays a table with the following column headings:
| Identifier |
| Code |
| Assignable to Role |
| Enabled |
| In use |
| Creation date |
| Last change date |
| Actions |
And the list of Identity Attributes is displayed
@TCA34 @SIMPL-4917
Scenario: Confirm Participant Detail Information Page displays correct details.
Given the user navigates to the "Participant Management" page
......@@ -529,4 +548,4 @@ Feature: Authority
Examples:
| caseName | filter1 | filterValue1 | filter2 | filterValue2 |
| the user filtering by status and by email, then reset the filter | status | Approved | email | dataparticipant_request_accepted@automation.com |
| the user filtering by status and by email, then reset the filter | status | Approved | email | dataparticipant_request_accepted@automation.com |
\ No newline at end of file
......@@ -43,6 +43,7 @@ public class AuthoritySteps {
private static String participantDetailTypeValue = null;
private static String participantDetailOnboardingValue = null;
private static String datePasedToString = null;
private static String getCodeValueToDelete = null;
@Given("the user clicks the register for this dataspace button")
......@@ -368,6 +369,34 @@ public class AuthoritySteps {
participantDetailOnboardingValue = authorityPage.parseDate(participantDetailOnboardingValue);
}
@When("the users clicks on the remove button under the Action column")
public void theUsersClicksOnTheRemoveButtonUnderTheActionColumn() {
getCodeValueToDelete = "Confirm deletion of " + page.locator((PARTICIPANT_DETAILS_IDENTITY_ATTRIBUTES_CODE_COLUMN_LOCATOR)).innerText();
page.locator(IDENTITY_ATTRIBUTE_REMOVE_BUTTON_LOCATOR).click();
}
@When("the system prompts the user to confirm the removal action")
public void theSystemPromptsTheUserToConfirmTheRemovalAction() {
String getCodeValueToDelete = "Confirm deletion of " + page.locator(IDENTITY_ATTRIBUTE_LIST_DELETE_DIALOG_MESSAGE_LOCATOR).innerText();
assertEquals(getCodeValueToDelete, getCodeValueToDelete);
}
@When("^the user (confirms|cancels) the removal action$")
public void theUserConfirmsTheRemovalAction(String action) {
String locator = action.equals("confirms")
? IDENTITY_ATTRIBUTE_DELETE_BUTTON_LOCATOR
: IDENTITY_ATTRIBUTE_DELETE_CANCEL_BUTTON_LOCATOR;
clickButtonByLocator(locator);
}
@When("a success message is displayed")
public void aSuccessMessageIsDisplayed() {
Locator successMessage = page.getByRole(AriaRole.ALERT);
assertElementIsVisibleByLocator(successMessage);
assertThat(successMessage).hasText(SUCCESSFUL_IDENTITY_ATTRIBUTE_DELETION_ALERT_MESSAGE);
}
@Then("the {string} is updated with a maximum of {int} results")
public void theRequestListIsUpdatedShowingAMaximumNumberOfResultsPerPage(String listType, Integer numberValueByPage) {
assertElementIsVisibleByLocator(page.locator(FILTER_TABLE));
......@@ -636,11 +665,18 @@ public class AuthoritySteps {
Locator identityAttributeDetailsColumns = page.locator(IDENTITY_ATTRIBUTE_DETAILS_COLUMNS_LOCATOR);
assertElementIsVisibleByLocator(identityAttributeDetailsColumns.first());
List<String> expectedValues = new ArrayList<>(details.values());
List<String> realValues = identityAttributeDetailsColumns.allTextContents();
realValues.replaceAll(String::strip);
for (String expectedValue : expectedValues) {
assertElementIsPresentInCollection(expectedValue, realValues);
for (Map.Entry<String, String> entry : details.entrySet()) {
String key = entry.getKey();
String expectedValue = entry.getValue();
if (key.equals("Code")) {
assertTrue(String.format("Expected %s to contain %s, but was %s", key, expectedValue, realValues),
realValues.stream().anyMatch(value -> value.contains(expectedValue)));
} else {
assertElementIsPresentInCollection(expectedValue, realValues);
}
}
}
......@@ -811,4 +847,9 @@ public class AuthoritySteps {
public void theUserVerifiesTheElementsInParticipantDetailsPage(DataTable dataTable) {
authorityPage.verifyTheValuesObtainedMatchWithValueDisplayed(dataTable, participantDetailNameValue, participantDetailTypeValue, participantDetailOnboardingValue);
}
@Then("the system removes the Identity Attribute from the list")
public void theSystemRemovesTheIdentityAttributeFromTheList() {
assertElementIsVisibleByLocator(page.locator(EMPTY_LIST_MESSAGE_LOCATOR));
}
}
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