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

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

Merge branch 'SOUI-SIMPL-7991_SIMPL-1130' into 'develop'

SOUI-SIMPL-7991: SIMPL-1130

See merge request simpl/pso/pso-test/pso-test-automation!91
parents c6e27bb5 f4746530
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,14 @@ package framework.ui.pages.simplOpen;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.AriaRole;
import framework.ui.helpers.UiSetup;
import java.util.List;
import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
import static framework.common.Assertions.assertElementIsNotVisibleByLocator;
import static framework.common.Assertions.assertElementIsVisibleByLocator;
import static framework.ui.locators.simplOpen.Authority.*;
public class AuthorityPage {
......@@ -78,5 +82,23 @@ public class AuthorityPage {
: "ONBOARDING_DATAPARTICIPANT_REQUEST_INPROGRESS")
: "ONBOARDING_DATAPARTICIPANT_REQUEST_SUBMITTED";
}
/**
* This method checks if the button "" is visible and enabled or not displayed at all.
* @param isTheElementVisible
*/
public void verifyDownloadCredentialsButtonIsVisibleOrNot(String isTheElementVisible) {
Locator downloadButton = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("download"));
switch (isTheElementVisible) {
case "is visible":
assertElementIsVisibleByLocator(downloadButton);
assertThat(downloadButton).isEnabled();
break;
case "is not visible":
assertElementIsNotVisibleByLocator(downloadButton);
break;
}
}
}
......@@ -140,4 +140,12 @@ Feature: Authority
| Application Provider |
| Consumer |
| Data Provider |
| Infrastructure Provider |
\ No newline at end of file
| Infrastructure Provider |
@TCA11 @SIMPL-1130
Scenario: Incomplete onboarding request, the user does not see Download Your Credentials button
Given the applicant with pdf submitted is in the onboarding status page
And the applicant logs in with valid credentials
When the applicant dataspace participant user can open the request status details dialog pressing See request details button
Then the Download Your Credentials button is not visible
......@@ -11,7 +11,6 @@ import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import java.util.ArrayList;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
......@@ -266,13 +265,18 @@ public class AuthoritySteps {
}
@Then("the applicant dataspace participant clicks on the \"Download your Credentials\" button")
public void theApplicantParticipantClicksDownloadYourCredentialsButton() {
public void the_applicant_participant_clicks_or_not_on_the_download_your_credentialsButton() {
Locator downloadYourCredentialsButton = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("download"));
assertElementIsVisibleByLocator(downloadYourCredentialsButton);
assertThat(downloadYourCredentialsButton).isEnabled();
page.waitForDownload(downloadYourCredentialsButton::click);
}
@Then("^the Download Your Credentials button (is visible|is not visible)$")
public void the_user_does_not_see_the_download_your_credentials_btn(String isTheElementVisible) {
authorityPage.verifyDownloadCredentialsButtonIsVisibleOrNot(isTheElementVisible);
}
@Then("then the onboarding requests shown have {string} matching {string}")
public void the_request_table_list_display_the_request_status(String filter, String value) {
assertElementIsVisibleByLocator(page.locator(FILTER_TABLE));
......
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