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

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

SOUI-SIMPL-746

parent f538b170
No related branches found
No related tags found
No related merge requests found
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
...@@ -21,6 +21,7 @@ public class Authority { ...@@ -21,6 +21,7 @@ public class Authority {
public static final String ONBOARDING_DATAPARTICIPANT_REQUEST_SUBMITTED_USER = "dataparticipant_req_submitted@automation.com"; public static final String ONBOARDING_DATAPARTICIPANT_REQUEST_SUBMITTED_USER = "dataparticipant_req_submitted@automation.com";
public static final String ONBOARDING_DATAPARTICIPANT_REQUEST_INPROGRESS_USER = "dataparticipant_req_inprogress@automation.com"; public static final String ONBOARDING_DATAPARTICIPANT_REQUEST_INPROGRESS_USER = "dataparticipant_req_inprogress@automation.com";
public static final String ONBOARDING_DATAPARTICIPANT_PASSWORD = "Test20!4"; public static final String ONBOARDING_DATAPARTICIPANT_PASSWORD = "Test20!4";
public static final String INVALID_DATA = "InvalidUserPassword";
public static final String[] PARTICIPANT_TYPES = { public static final String[] PARTICIPANT_TYPES = {
"Consumer", "Consumer",
...@@ -29,7 +30,6 @@ public class Authority { ...@@ -29,7 +30,6 @@ public class Authority {
"Infrastructure Provider" "Infrastructure Provider"
}; };
public Authority() { public Authority() {
} }
} }
...@@ -124,6 +124,10 @@ public final class Utils { ...@@ -124,6 +124,10 @@ public final class Utils {
username = ONBOARDING_DATAPARTICIPANT_REQUEST_SUBMITTED_USER; username = ONBOARDING_DATAPARTICIPANT_REQUEST_SUBMITTED_USER;
password = ONBOARDING_DATAPARTICIPANT_PASSWORD; password = ONBOARDING_DATAPARTICIPANT_PASSWORD;
break; break;
case "INVALID":
username = "invalid_username";
password = "invalid_password";
break;
default: default:
throw new IllegalArgumentException("Unknown user: " + user); throw new IllegalArgumentException("Unknown user: " + user);
} }
......
...@@ -21,6 +21,7 @@ public class Authority { ...@@ -21,6 +21,7 @@ public class Authority {
public static final String KEYCLOAK_USERNAME_INPUT = "input[id='username']"; 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_PASSWORD_INPUT = "input[id='password']";
public static final String KEYCLOAK_SIGN_IN_BUTTON = "input[id='kc-login']"; public static final String KEYCLOAK_SIGN_IN_BUTTON = "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 PARTICIPANT_LIST_TABLE = "table[role='table']";
public static final String HOST_APPLICATION_ONBOARDING_STATUS = "application/onboarding-status"; public static final String HOST_APPLICATION_ONBOARDING_STATUS = "application/onboarding-status";
public static final String REQUEST_STATUS_DETAILS_DIALOG = "//mat-dialog-content[contains(@class, 'mat-mdc-dialog-content')]"; public static final String REQUEST_STATUS_DETAILS_DIALOG = "//mat-dialog-content[contains(@class, 'mat-mdc-dialog-content')]";
...@@ -33,6 +34,3 @@ public class Authority { ...@@ -33,6 +34,3 @@ public class Authority {
public Authority() { public Authority() {
} }
} }
...@@ -51,3 +51,9 @@ Feature: Authority ...@@ -51,3 +51,9 @@ Feature: Authority
And the application status summary page does not show the status request is "In Progress" with a "green" icon And the application status summary page does not show the status request is "In Progress" with a "green" icon
And the application status summary page does not show the status request is "Request accepted" with a "grey" icon And the application status summary page does not show the status request is "Request accepted" with a "grey" icon
And the applicant dataspace participant user can open the request status details dialog pressing See request details button And the applicant dataspace participant user can open the request status details dialog pressing See request details button
@TCA05 @SIMPL-746
Scenario: Access Denied With Invalid Authentication
Given the user navigates to the "Participant Management" page
And the user tries to logs in with invalid login credentials
Then the user sees an error message should be displayed
...@@ -4,6 +4,7 @@ import com.microsoft.playwright.Locator; ...@@ -4,6 +4,7 @@ import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page; import com.microsoft.playwright.Page;
import framework.ui.helpers.UiSetup; import framework.ui.helpers.UiSetup;
import framework.ui.helpers.Utils; import framework.ui.helpers.Utils;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given; import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then; import io.cucumber.java.en.Then;
import io.cucumber.java.en.When; import io.cucumber.java.en.When;
...@@ -26,6 +27,7 @@ public class AuthoritySteps { ...@@ -26,6 +27,7 @@ public class AuthoritySteps {
private final String PARTICIPANT_PAGE_PARTICIPANT_TYPE_COLUMN = "Participant type"; private final String PARTICIPANT_PAGE_PARTICIPANT_TYPE_COLUMN = "Participant type";
private final String PARTICIPANT_PAGE_REQUESTER_EMAIL_COLUMN = "Requester email"; private final String PARTICIPANT_PAGE_REQUESTER_EMAIL_COLUMN = "Requester email";
private final String PARTICIPANT_PAGE_ONBOARDING_DATE_COLUMN = "Onboarding Date"; private final String PARTICIPANT_PAGE_ONBOARDING_DATE_COLUMN = "Onboarding Date";
private final String ERROR_MESSAGE = "Invalid username or password.";
public static String NEW_USER = ""; public static String NEW_USER = "";
public static Boolean IS_PDF_SUBMITTED = false; public static Boolean IS_PDF_SUBMITTED = false;
...@@ -224,6 +226,15 @@ public class AuthoritySteps { ...@@ -224,6 +226,15 @@ public class AuthoritySteps {
page.locator(REQUEST_STATUS_DETAILS_DIALOG).click(); page.locator(REQUEST_STATUS_DETAILS_DIALOG).click();
} }
} @And("the user tries to logs in with invalid login credentials")
public void theUserTriesToLogsInWithInvalidLoginCredentials() {
Utils.LogInDetails invalidCredentials = Utils.getUserNameAndPassword("INVALID");
keycloakLogin(invalidCredentials);
}
@Then("the user sees an error message should be displayed")
public void theUserSeesAnErrorMessageShouldBeDisplayed() {
assert (page.locator(ERROR_MESSAGE_LOCATOR).textContent()).contains(ERROR_MESSAGE);
}
}
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