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

Automating pmp-revamp ui application #1062

Merged
merged 1 commit into from
Jan 2, 2025
Merged
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 @@ -196,6 +196,27 @@ public class ApiKeyPage extends BasePage {
@FindBy(xpath = "//*[text()='No Data Available.']")
private WebElement noDataAvailableText;

@FindBy(id = "generate_api_key_btn")
private WebElement apiKeyListPageGenerateApiKeyBtn;

@FindBy(xpath = "//*[contains(text(), 'Select Partner ID')]")
private WebElement partnerIdHelpText;

@FindBy(xpath = "//*[contains(text(), 'Select policy for which API Key is required')]")
private WebElement policyNameHelpText;

@FindBy(id = "generate_clear_form")
private WebElement clearButton;

@FindBy(id = "generate_cancel_btn")
private WebElement cancelButton;

@FindBy(xpath = "//*[contains(text(), 'Entered API Key name already exists. Provide a unique API Key name and submit.')]")
private WebElement duplicateApiKeyNameErrorMessage;

@FindBy(id = "error_close_btn")
private WebElement duplicateApiKeyNameErrorMessageCancelButton;

public ApiKeyPage(WebDriver driver) {
super(driver);
}
Expand Down Expand Up @@ -231,11 +252,11 @@ public boolean isGenerateAPIKeyDisplayed() {
return isElementDisplayed(generateAPIKey);
}

public void ClickOnAPIKeyDisplayed() {
public void clickOnAPIKeyDisplayed() {
clickOnElement(generateAPIKey);
}

public void ClickOnSubmitButton() {
public void clickOnSubmitButton() {
clickOnElement(submitButton);
}

Expand Down Expand Up @@ -452,4 +473,51 @@ public boolean isnoDataAvailableTextDisplayed() {
return isElementDisplayed(noDataAvailableText);
}

public boolean isApiKeyListPageGenerateApiKeyBtnDisplayed() {
return isElementDisplayed(apiKeyListPageGenerateApiKeyBtn);
}

public void clickOnApiKeyListPageGenerateApiKeyBtnDisplayed() {
clickOnElement(apiKeyListPageGenerateApiKeyBtn);
}

public boolean isPartnerIdHelpTextDisplayed() {
return isElementDisplayed(partnerIdHelpText);
}

public boolean isPolicyNameHelpTextDisplayed() {
return isElementDisplayed(policyNameHelpText);
}

public boolean isClearButtonDisplayed() {
return isElementDisplayed(clearButton);
}

public void clickOnClearButton() {
clickOnElement(clearButton);
}

public boolean isCancelButtonDisplayed() {
return isElementDisplayed(cancelButton);
}

public void clickOnCancelButton() {
clickOnElement(cancelButton);
}

public void navigateBackDefaultButton() {
driver.navigate().back();
}

public void navigateRefreshDefaultButton() {
driver.navigate().refresh();
}

public boolean isDuplicateApiKeyNameErrorMessageDisplayed() {
return isElementDisplayed(duplicateApiKeyNameErrorMessage);
}

public void clickOnDuplicateApiKeyNameErrorMessageCancelButton() {
clickOnElement(duplicateApiKeyNameErrorMessageCancelButton);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ public class DashboardPage extends BasePage {
@FindBy(xpath = "//*[text()='Root of Trust Certificate']")
private WebElement RootOFTrustCertText;

//@FindBy(id = "root_certificate_upload_btn")
//@FindBy(id = "upload_root_trust_certificate_btn")
@FindBy(id = "upload_certificate_btn")
@FindBy(id = "rootCertificateList.uploadRootCaCertificate")
private WebElement rootCertificateUploadButton;

@FindBy(xpath = "//*[text()='Policies']")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ public class OidcClientPage extends BasePage {
@FindBy(id = "partnerId_asc_icon")
private WebElement partnerId_asc_icon;

@FindBy(id = "oidcClientName_desc_icon")
@FindBy(id = "clientNameEng_desc_icon")
private WebElement oidcClientName_desc_icon;

@FindBy(id = "oidcClientName_asc_icon")
@FindBy(id = "clientNameEng_asc_icon")
private WebElement oidcClientName_asc_icon;

@FindBy(id = "policyGroupName_desc_icon")
Expand Down Expand Up @@ -232,6 +232,9 @@ public class OidcClientPage extends BasePage {
@FindBy(id = "sub_title_home_btn")
private WebElement subTitleHomeButton;

@FindBy(id = "create_oidc_btn")
private WebElement oidcClientListPageCreateOidcClientBtn;

public OidcClientPage(WebDriver driver) {
super(driver);
}
Expand Down Expand Up @@ -535,5 +538,7 @@ public boolean isCreateOidcCancelButtonDisplayed() {
public boolean isSubTitleHomeButtonDisplayed() {
return isElementDisplayed(subTitleHomeButton);
}

public void clickOnOidcClientListPageCreateOidcClientBtn() {
clickOnElement(oidcClientListPageCreateOidcClientBtn);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,20 @@ public class PartnerPolicyMappingPage extends BasePage {
@FindBy(id = "partner_list_view1")
private WebElement partnerListViewElipsisButton;

@FindBy(xpath = "//*[contains(text(), 'Approve / Reject')]")
private WebElement approveOrRejectButton;

@FindBy(xpath = "//*[contains(text(), 'Do you want to Approve/Reject the Policy')]")
private WebElement confirmationPopup;

@FindBy(xpath = "//*[contains(text(), 'Please review the policy details carefully before taking appropriate action.')]")
private WebElement confirmationPopupDetailedMessage;

@FindBy(xpath = "(//*[@id='partner_details_view_btn'])[1]")
private WebElement approveRejectButton;

@FindBy(id = "approve_reject_request_submit_btn")
private WebElement approveSubmitButton;
@FindBy(xpath = "(//*[contains(text(), 'Approve')])[3]")
private WebElement approveButton;

public PartnerPolicyMappingPage(WebDriver driver) {
super(driver);
Expand Down Expand Up @@ -57,12 +66,32 @@ public void clickOnPartnerListViewElipsisButton() {
clickOnElement(partnerListViewElipsisButton);
}

public void clickOnApproveOrRejectButton() {
clickOnElement(approveOrRejectButton);
}

public boolean isConfirmationPopupDisplayed() {
return isElementEnabled(confirmationPopup);
}

public boolean isConfirmationPopupDetailedMessageDisplayed() {
return isElementEnabled(confirmationPopupDetailedMessage);
}

public boolean isApproveRejectButtonDisplayed() {
return isElementEnabled(approveRejectButton);
}

public boolean isApproveSubmitButtonDisplayed() {
return isElementEnabled(approveButton);
}

public void clickOnApproveRejectButton() {
clickOnElement(approveRejectButton);
}

public void clickOnApproveSubmitButton() {
clickOnElement(approveSubmitButton);
clickOnElement(approveButton);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ public class PoliciesPage extends BasePage {
@FindBy(id = "policy_details_policy_group_name_label")
private WebElement policyDetailsPolicyGroupNameLabel;

@FindBy(id = "policy_details_policy_name_label")
private WebElement policyDetailsPolicyNameLabel;

@FindBy(id = "policy_details_policy_name_context")
private WebElement policyDetailsPolicyNameContext;

Expand Down Expand Up @@ -559,6 +562,10 @@ public boolean isPolicyDetailsPartnerIdLabelDisplayed() {
return isElementDisplayed(policyDetailsPartnerIdLabel);
}

public boolean isPolicyDetailsPolicyGroupNameLabelDisplayed() {
return isElementDisplayed(policyDetailsPolicyGroupNameLabel);
}

public boolean isPolicyDetailsPolicyGroupNameContextDisplayed() {
return isElementDisplayed(policyDetailsPolicyGroupNameContext);
}
Expand All @@ -571,8 +578,8 @@ public boolean isPolicyDetailsPartnerTypeContextDisplayed() {
return isElementDisplayed(policyDetailsPartnerTypeContext);
}

public boolean isPolicyDetailsPolicyGroupNameLabelDisplayed() {
return isElementDisplayed(policyDetailsPolicyGroupNameLabel);
public boolean isPolicyDetailsPolicyNameLabelDisplayed() {
return isElementDisplayed(policyDetailsPolicyNameLabel);
}

public boolean isPolicyDetailsPolicyNameContextDisplayed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void openPreviousTab() {
}

public void openRevampInNewTab() {
((JavascriptExecutor) driver).executeScript("window.open('https://pmp-new.dev1.mosip.net/ ')");
((JavascriptExecutor) driver).executeScript("window.open('https://pmp-revamp.dev1.mosip.net/ ')");
Set<String> allWindowHandles = driver.getWindowHandles();
System.out.println(allWindowHandles);
if (allWindowHandles.size() >= 2) {
Expand Down
Loading
Loading