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

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

Merge branch 'SOUI-SIMPL-7985_SIMPL-655' into 'develop'

SOUI-SIMPL-7985_ SIMPL-655

See merge request simpl/pso/pso-test/pso-test-automation!100
parents 1709bd95 0240c712
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,7 @@ public class Authority {
public static final String IDENTITY_ATTRIBUTE_MANAGER_ASSIGNABLE_COLUMN = "div.row:has(div.fw-semibold:has-text('Assignable to Tier 1')) + div.row div.col";
public static final String IDENTITY_ATTRIBUTE_MANAGER_CREATION_DATE_COLUMN = "div.row:has(div.fw-semibold:has-text('Creation date')) + div.row div.col";
public static final String IDENTITY_ATTRIBUTE_MANAGER_LAST_CHANGE_DATE_COLUMN = "div.row:has(div.fw-semibold:has-text('Last change date')) + div.row div.col";
public static final String EMPTY_LIST_MESSAGE = "div.p-5.text-center";
public Authority() {
......
......@@ -23,14 +23,14 @@ public class AuthorityPage {
* The status to be selected is sending in the step
* @param statusReq There are 4 options: In progress|Approved|Rejected|Inserted
*/
public void verifyUserSelectOptionFromSecondFilter(String statusReq) {
public void verifyUserSelectOptionFromSecondFilter(String statusReq, Locator locatorvalue) {
page.locator(SECOND_FILTER_DROP_DOWN_ARROW_LOCATOR).click();
int countElements = page.locator(PARTICIPANT_TYPE_OPTIONS).count();
int countElements = locatorvalue.count();
for (int i = 1; i <= countElements; i++ ) {
String valueElement = page.locator(PARTICIPANT_TYPE_OPTIONS).nth(i).innerText();
String valueElement = locatorvalue.nth(i).innerText();
if (valueElement != null && !valueElement.equals("")) {
if (valueElement.equals(statusReq)) {
page.locator(PARTICIPANT_TYPE_OPTIONS).nth(i).click();
locatorvalue.nth(i).click();
break;
}
} else {
......@@ -45,18 +45,20 @@ public class AuthorityPage {
* The status to be selected is sending in the step
* @param statusReq There are two options: status|email
*/
public void verifyUserSelectOptionFromFirstFilter(String statusReq) {
public void verifyUserSelectOptionFromFirstFilter(String statusReq, Locator locatorvalue) {
assertElementIsVisibleByLocator(page.locator(FIRST_FILTER_DROP_DOWN_ARROW_LOCATOR));
page.locator(FIRST_FILTER_DROP_DOWN_ARROW_LOCATOR).click();
int countElements = page.locator(PARTICIPANT_TYPE_OPTIONS).count();
for (int i = 1; i <= countElements; i++ ) {
String valueElement = page.locator(PARTICIPANT_TYPE_OPTIONS).nth(i).getAttribute("value");
int countElements = locatorvalue.count();
for (int i = 0; i < countElements; i++ ) {
String valueElement = locatorvalue.nth(i).getAttribute("value");
if (valueElement.equals(statusReq)) {
page.locator(PARTICIPANT_TYPE_OPTIONS).nth(i).click();
locatorvalue.nth(i).click();
break;
}
}
}
/**
* This method verifies that all requests with status "In progress" are displayed in the "Dashboard Requests List" table
* The status to be selected is sending in the step
......
......@@ -131,7 +131,7 @@ Feature: Authority
Scenario Outline: Confirm filtering by Status in Progress and <button> the request
Given the user navigates to the "Dashboard Requests List" page
And the user logs in with a user with "NOTARY" role
When the user filters by "status" with value "In progress"
And the user filters by "status" with value "In progress"
And the user sorts by descending Request Date
And the user clicks on the first result from "Request List"
When the dataspace governance user clicks on the "<button>" button
......@@ -182,4 +182,13 @@ Feature: Authority
Examples:
| name | code | assignable |
| Assignable Test Identity Attribute | assignable_test_identity_attribute | true |
| Non-Assignable Test Identity Attribute | non_assignable_test_identity_attribute | false |
\ No newline at end of file
| Non-Assignable Test Identity Attribute | non_assignable_test_identity_attribute | false |
@TCA14 @SIMPL-655
Scenario: No matching results for filters applied
Given the user navigates to the "Dashboard Requests List" page
And the user logs in with a user with "NOTARY" role
When the user filters by "status" with value "Rejected"
And the user filters by "email" with value "nonexistentuser@example.com"
Then the onboarding requests table list shows a message "There are currently no onboarding requests."
......@@ -233,7 +233,7 @@ public class AuthoritySteps {
page.getByText(PARTICIPANT_PAGE_FILTER_SELECT_COLUMN).click();
dropdownOptions = page.locator(PARTICIPANT_LIST_FILTER_DROPDOWN_OPTIONS).all();
dropdownOptions.get(1).click();
authorityPage.verifyUserSelectOptionFromSecondFilter(value);
authorityPage.verifyUserSelectOptionFromSecondFilter(value, page.locator(PARTICIPANT_TYPE_OPTIONS));
break;
case "Code":
page.getByText(PARTICIPANT_PAGE_FILTER_SELECT_COLUMN).click();
......@@ -257,11 +257,12 @@ public class AuthoritySteps {
CalendarWidget.selectDateRange(page, startDate, endDate);
break;
case "status":
authorityPage.verifyUserSelectOptionFromFirstFilter(filter);
authorityPage.verifyUserSelectOptionFromSecondFilter(value);
authorityPage.verifyUserSelectOptionFromFirstFilter(filter, page.locator(PARTICIPANT_TYPE_OPTIONS));
authorityPage.verifyUserSelectOptionFromSecondFilter(value, page.locator(PARTICIPANT_TYPE_OPTIONS));
break;
case "email":
authorityPage.verifyUserSelectOptionFromFirstFilter(filter);
authorityPage.verifyUserSelectOptionFromFirstFilter(filter, page.locator(PARTICIPANT_TYPE_OPTIONS));
page.locator(PARTICIPANT_LIST_FILTER_INPUT).fill(value);
break;
default:
throw new IllegalArgumentException("Unknown filter: " + filter);
......@@ -288,6 +289,10 @@ public class AuthoritySteps {
}
}
@When("the user submits the form")
public void theUserSubmitsTheForm() {
clickButtonByLocator(IDENTITY_ATTRIBUTE_CREATION_SAVE_BUTTON);
}
@Then("the list of onboarded participants for the data space is displayed")
public void theListOfOnboardedParticipantsForTheDataSpaceIsDisplayed() {
......@@ -468,6 +473,23 @@ public class AuthoritySteps {
}
}
@Then("the success message is displayed")
public void theSuccessMessageIsDisplayed() {
String expectedMessage = "You successfully created an attribute";
assertElementIsVisibleByLocator(page.getByRole(AriaRole.ALERT));
assertThat(page.getByRole(AriaRole.ALERT)).hasText(expectedMessage);
}
@Then("the onboarding requests table list shows a message {string}")
public void the_request_table_list_shows_a_message(String messageValue) {
assertElementIsVisibleByLocator(page.locator(EMPTY_LIST_MESSAGE));
String msgValueShown = (page.locator(EMPTY_LIST_MESSAGE)).innerText();
if (!messageValue.contains(msgValueShown.trim())) {
throw new RuntimeException("the message did not match");
}
}
@And("the user is in the Identity Attributes Creation page")
public void theUserIsInTheIdentityAttributesCreationPage() {
assertElementIsVisibleByLocator(page.getByRole(AriaRole.HEADING));
......@@ -496,19 +518,6 @@ public class AuthoritySteps {
expectedLastChangeDate = today.format(formatter);
}
@When("the user submits the form")
public void theUserSubmitsTheForm() {
clickButtonByLocator(IDENTITY_ATTRIBUTE_CREATION_SAVE_BUTTON);
}
@Then("the success message is displayed")
public void theSuccessMessageIsDisplayed() {
String expectedMessage = "You successfully created an attribute";
assertElementIsVisibleByLocator(page.getByRole(AriaRole.ALERT));
assertThat(page.getByRole(AriaRole.ALERT)).hasText(expectedMessage);
}
@And("the user is redirected to the Identity Attributes Management page")
public void theUserIsRedirectedToTheIdentityAttributesManagementPage() {
assertElementIsVisibleByLocator(page.getByText(IDENTITY_ATTRIBUTE_MANAGEMENT_HEADER));
......@@ -532,4 +541,5 @@ public class AuthoritySteps {
assertEquals("Creation date does not match", expectedCreationDate, formattedActualCreationDate);
assertEquals("Last change date does not match", expectedLastChangeDate, formattedActualLastChangeDate);
}
}
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