Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-37946 : create few automation scenarios for OIDC Client #972

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public boolean isPoliciesTitleDisplayed() {
public boolean isAuthenticationServicesTitleDisplayed() {
return isElementDisplayed(AuthenticationServices);
}


public PoliciesPage clickOnPoliciesTitle() {
clickOnElement(policiesTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ public class OidcClientPage extends BasePage {

@FindBy(id = "create_oid_client")
private WebElement createOidcClient;

@FindBy(id = "add_new_redirect_url")
private WebElement redirectUriAddNew;

@FindBy(id = "delete_redirect_url2")
private WebElement RedirectUri2Delete;

@FindBy(id = "create_oidc_redirect_url2")
private WebElement RedirectUri2;

@FindBy(xpath = "//*[contains(text(), 'Partner ID')]")
private WebElement partnerIDHeaderText;
Expand Down Expand Up @@ -57,13 +66,22 @@ public class OidcClientPage extends BasePage {

@FindBy(id = "create_oidc_logo_url")
private WebElement enterLogoUriTextBox;

@FindBy(xpath = "//*[@placeholder='Enter Logo URI']")
private WebElement enterLogoUriTextBoxEmpty;

@FindBy(xpath = "//*[@class='text-sm text-crimson-red font-semibold' and text()='Enter a valid URI']")
private WebElement InvalidLogoUriError;

@FindBy(id = "create_oidc_redirect_url1")
private WebElement enterRedirectUriTextBox;

@FindBy(id = "create_oidc_submit_btn")
private WebElement submitButton;

@FindBy(id = "create_oidc_clear_form")
private WebElement clearForm;

@FindBy(id = "oidc_edit_submit_btn")
private WebElement oidcEditSubmitButton;

Expand Down Expand Up @@ -243,10 +261,18 @@ public boolean isCreateOidcClientDisplayed() {
public void clickOnCreateOidcClientButton() {
clickOnElement(createOidcClient);
}

public void clickOnRedirectUriAddNew() {
clickOnElement(redirectUriAddNew);
}

public void clickOnRedirectUri2Delete() {
clickOnElement(RedirectUri2Delete);
}

public void selectPartnerIdDropdown() {
public void selectPartnerIdDropdown(String value) {
clickOnElement(SelectPartneridForOidc);
clickOnElement(createOidcPartnerIdOption1);
clickOnElement(driver.findElement(By.xpath("(//*[contains(text(),'" + value + "')])[2]")));
}

public boolean isPartnerIdDropdownDisplayed() {
Expand All @@ -256,7 +282,17 @@ public boolean isPartnerIdDropdownDisplayed() {
public boolean isPolicyNameDropdownDisplayed() {
return isElementDisplayed(SelectPolicyNameForOidc);
}

public boolean isLogoUriempty() {

return isElementDisplayed(enterLogoUriTextBoxEmpty);
}

public boolean isInvalidLogoUriErrorVissible() {

return isElementDisplayed(InvalidLogoUriError);
}

public void selectPolicyNameDropdown(String value) {
clickOnElement(SelectPolicyNameForOidc);
enter(createOidcPolicyNameSearchInput, value);
Expand Down Expand Up @@ -286,6 +322,10 @@ public void enterRedirectUriTextBox(String value) {
public void clickOnSubmitButton() {
clickOnElement(submitButton);
}

public void clickOnClearFormButton() {
clickOnElement(clearForm);
}

public boolean isEnterValidUriForLogoUriTextDisplayed() {
return isElementDisplayed(enterValidUriForLogoUriText);
Expand Down Expand Up @@ -334,6 +374,10 @@ public boolean isActionHeaderTextDisplayed() {
public void clickOnApiKeyTab() {
clickOnElement(ApiKeyTab);
}

public boolean isRedirectUri2TextBoxDisplayed() {
return isElementDisplayed(RedirectUri2);
}

public void enterCreateOidcPolicyNameSearchInput(String value) {
enter(createOidcPolicyNameSearchInput, value);
Expand Down
Loading