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

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

Feature/SOUI-SIMPL-3467

parent b31f4d80
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ import com.microsoft.playwright.Page;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.temporal.ChronoField;
import java.util.Locale;
public class CalendarWidget {
......@@ -37,6 +39,16 @@ public class CalendarWidget {
selectFromYear(page, endDate);
}
public static DateTimeFormatter getDateFormat() {
return new DateTimeFormatterBuilder()
.appendValue(ChronoField.MONTH_OF_YEAR)
.appendLiteral('/')
.appendValue(ChronoField.DAY_OF_MONTH)
.appendLiteral('/')
.appendValue(ChronoField.YEAR)
.toFormatter();
}
private static void selectFromYear(Page page, LocalDate date) {
page.getByLabel(CHOOSE_MONTH_AND_YEAR_LABEL).click();
page.getByLabel(date.format(YEAR_FORMAT)).click();
......
......@@ -72,6 +72,7 @@ public class Authority {
public static final String IDENTITY_ATTRIBUTE_CREATION_CODE = "input[name='code']";
public static final String IDENTITY_ATTRIBUTE_CREATION_ASSIGNABLE = "//label[text()='Assignable to Tier 1']";
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_MANAGER_CODE_COLUMN = "div.row:has(div.fw-semibold:has-text('Code')) + div.row div.col";
public static final String IDENTITY_ATTRIBUTE_MANAGER_NAME_COLUMN = "div.row:has(div.fw-semibold:has-text('Name')) + div.row div.col";
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";
......
......@@ -212,7 +212,7 @@ Feature: Authority
| Data Provider |
| Infrastructure Provider |
@TCA17 @SIMPL-3601
@TCA17 @SIMPL-3601 @SIMPL-3061
Scenario Outline: Successful Creation of an Identity Attribute: <caseName>
Given the user navigates to the "Identity Attributes Creation" page
And the user logs in with a user with "IATTR_M" role
......@@ -235,7 +235,7 @@ Feature: Authority
| Assignable Identity Attribute | Assignable Test Identity Attribute | assignable_test_identity_attribute | true |
| Non-Assignable Identity Attribute | Non-Assignable Test Identity Attribute | non_assignable_test_identity_attribute | false |
@TCA18 @SIMPL-3466 @SIMPL-3139 @SIMPL-3140
@TCA18 @SIMPL-3466 @SIMPL-3139 @SIMPL-3140 @SIMPL-4127
Scenario: Successful Update of an Identity Attribute
Given the user navigates to the "Identity Attributes" page
And the user logs in with a user with "IATTR_M" role
......@@ -261,7 +261,31 @@ Feature: Authority
| Last change date | TODAY |
And the user reverts the changes done to the Identity Attribute
@TCA19 @SIMPL-848 @SIMPL-849 @SIMPL-850 @SIMPL-851 @SIMPL-852
@TCA19 @SIMPL-3467
Scenario: Cancellation of the Identity Attribute Editing 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-3467 IDENTITY ATTRIBUTE"
And the user clicks on the first result from "Identity Attributes List"
And the Identity Attributes Details page is displayed
And the following identity attribute details are displayed:
| Code | PSO_SIMPL-3467_IDENTITY_ATTRIBUTE |
| Name | PSO SIMPL-3467 IDENTITY ATTRIBUTE |
| Assignable to Tier 1 | true |
When the user clicks on the Edit button
And the user is redirected to the "Identity Attribute Edition" page
And the user updates the Identity Attribute with the following data:
| Name | PSO SIMPL-3467 IDENTITY ATTRIBUTE EDITED |
| Code | PSO_SIMPL-3467_IDENTITY_ATTRIBUTE_EDITED |
| Assignable to Tier 1 | false |
Then the user cancels the form
And the Identity Attributes Details page is displayed
And the following identity attribute details are displayed:
| Code | PSO_SIMPL-3467_IDENTITY_ATTRIBUTE |
| Name | PSO SIMPL-3467 IDENTITY ATTRIBUTE |
| Assignable to Tier 1 | true |
@TCA20 @SIMPL-848 @SIMPL-849 @SIMPL-850 @SIMPL-851 @SIMPL-852
Scenario Outline: User sorts onboarding requests by <columnToSort> in <sortDirection> order
Given the user navigates to the "Dashboard Requests List" page
And the user logs in with a user with "NOTARY" role
......
......@@ -244,9 +244,12 @@ public class AuthoritySteps {
}
}
@When("the user submits the form")
public void theUserSubmitsTheForm() {
clickButtonByLocator(IDENTITY_ATTRIBUTE_CREATION_SAVE_BUTTON);
@When("^the user (submits|cancels) the form$")
public void theUserHandlesTheForm(String action) {
String locator = action.equals("submits")
? IDENTITY_ATTRIBUTE_CREATION_SAVE_BUTTON
: IDENTITY_ATTRIBUTE_CREATION_CANCEL_BUTTON;
clickButtonByLocator(locator);
}
@When("the user is in the Identity Attributes Creation page")
......@@ -516,12 +519,14 @@ public class AuthoritySteps {
if ("TODAY".equals(details.get("Creation date"))) {
LocalDate today = LocalDate.now();
details.put("Creation date", today.format(DateTimeFormatter.ofPattern("MM/dd/yyyy")));
DateTimeFormatter formatter = CalendarWidget.getDateFormat();
details.put("Creation date", today.format(formatter));
}
if ("TODAY".equals(details.get("Last change date"))) {
LocalDate today = LocalDate.now();
details.put("Last change date", today.format(DateTimeFormatter.ofPattern("MM/dd/yyyy")));
DateTimeFormatter formatter = CalendarWidget.getDateFormat();
details.put("Last change date", today.format(formatter));
}
if ("Assignable Test Identity Attribute".equals(details.get("Name")) ||
......
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