diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/ApiKeyPage.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/ApiKeyPage.java index 84ee206b..39984180 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/ApiKeyPage.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/ApiKeyPage.java @@ -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); } @@ -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); } @@ -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); + } } diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/DashboardPage.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/DashboardPage.java index f63a13e0..39c5873b 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/DashboardPage.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/DashboardPage.java @@ -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']") diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/OidcClientPage.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/OidcClientPage.java index 4eb63192..ae84eea3 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/OidcClientPage.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/OidcClientPage.java @@ -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") @@ -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); } @@ -535,5 +538,7 @@ public boolean isCreateOidcCancelButtonDisplayed() { public boolean isSubTitleHomeButtonDisplayed() { return isElementDisplayed(subTitleHomeButton); } - + public void clickOnOidcClientListPageCreateOidcClientBtn() { + clickOnElement(oidcClientListPageCreateOidcClientBtn); + } } diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/PartnerPolicyMappingPage.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/PartnerPolicyMappingPage.java index 70b69734..07bd6b74 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/PartnerPolicyMappingPage.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/PartnerPolicyMappingPage.java @@ -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); @@ -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); } } diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/PoliciesPage.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/PoliciesPage.java index 1d7aa689..69df9e55 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/PoliciesPage.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/PoliciesPage.java @@ -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; @@ -559,6 +562,10 @@ public boolean isPolicyDetailsPartnerIdLabelDisplayed() { return isElementDisplayed(policyDetailsPartnerIdLabel); } + public boolean isPolicyDetailsPolicyGroupNameLabelDisplayed() { + return isElementDisplayed(policyDetailsPolicyGroupNameLabel); + } + public boolean isPolicyDetailsPolicyGroupNameContextDisplayed() { return isElementDisplayed(policyDetailsPolicyGroupNameContext); } @@ -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() { diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/RegisterPage.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/RegisterPage.java index bce34b8e..1959b58d 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/RegisterPage.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/pages/RegisterPage.java @@ -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 allWindowHandles = driver.getWindowHandles(); System.out.println(allWindowHandles); if (allWindowHandles.size() >= 2) { diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/testcase/AuthPartnerTest.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/testcase/AuthPartnerTest.java index 436b5445..dd055282 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/testcase/AuthPartnerTest.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/testcase/AuthPartnerTest.java @@ -29,12 +29,6 @@ public void registerNewUser() throws InterruptedException { PartnerCertificatePage partnerCertificatePage = new PartnerCertificatePage(driver); RegisterPage registerPage = new RegisterPage(driver); - assertTrue(dashboardpage.isTermsAndConditionsPopUppDisplayed(), GlobalConstants.isTermsAndConditionsPopUppDisplayed); - dashboardpage.clickOnCheckbox(); - - assertTrue(dashboardpage.isProceedButtonDisplayed(), GlobalConstants.isProceedButtonDisplayed); - dashboardpage.clickOnProceedButton(); - dashboardpage.clickOnRootOFTrustCertText(); dashboardpage.clickOnRootCertificateUploadButton(); partnerCertificatePage.clickOnpartnerDomainSelectorDropdown(); @@ -135,7 +129,7 @@ public void registerNewUser() throws InterruptedException { assertTrue(partnerCertificatePage.isSucessMessageDisplayed(), GlobalConstants.isSucessMessageDisplayed); partnerCertificatePage.clickOnRemoveCertificateButton(); - partnerCertificatePage.uploadCertificateInvalidCert(); + partnerCertificatePage.uploadCertificateInvalidCert(); assertTrue(partnerCertificatePage.isInvalidFormatErrorPopupDisplayed(), GlobalConstants.isInvalidCertFormatePopupDisplayed); partnerCertificatePage.clickOnCertificateUploadCancelButton(); @@ -222,18 +216,18 @@ public void VerifyingPolicyCreationAndFilter() { policiesPage.clickOnElipcisButton(); policiesPage.clickOnCardViewButton(); - assertTrue(policiesPage.isPolicyDetailsPartnerIdLabelDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPolicyGroupNameContextDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPolicyGroupNameContextDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPartnerTypeLabelDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPartnerTypeContextDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPolicyGroupNameLabelDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPolicyNameContextDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPolicyGroupDescriptionLabelDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPolicyGroupDescriptionContextDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPolicyNameDescriptionLabelDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsPolicyNameDescriptionContextDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); - assertTrue(policiesPage.isPolicyDetailsCommentsDisplayed(), GlobalConstants.isPendingForApprovalDisplayed); + assertTrue(policiesPage.isPolicyDetailsPartnerIdLabelDisplayed(), GlobalConstants.isPolicyDetailsPartnerIdLabelDisplayed); + assertTrue(policiesPage.isPolicyDetailsPolicyGroupNameLabelDisplayed(), GlobalConstants.isPolicyDetailsPolicyGroupNameLabelDisplayed); + assertTrue(policiesPage.isPolicyDetailsPolicyGroupNameContextDisplayed(), GlobalConstants.isPolicyDetailsPolicyGroupNameContextDisplayed); + assertTrue(policiesPage.isPolicyDetailsPartnerTypeLabelDisplayed(), GlobalConstants.isPolicyDetailsPartnerTypeLabelDisplayed); + assertTrue(policiesPage.isPolicyDetailsPartnerTypeContextDisplayed(), GlobalConstants.isPolicyDetailsPartnerTypeContextDisplayed); + assertTrue(policiesPage.isPolicyDetailsPolicyNameLabelDisplayed(), GlobalConstants.isPolicyDetailsPolicyNameLabelDisplayed); + assertTrue(policiesPage.isPolicyDetailsPolicyNameContextDisplayed(), GlobalConstants.isPolicyDetailsPolicyNameContextDisplayed); + assertTrue(policiesPage.isPolicyDetailsPolicyGroupDescriptionLabelDisplayed(), GlobalConstants.isPolicyDetailsPolicyGroupDescriptionLabelDisplayed); + assertTrue(policiesPage.isPolicyDetailsPolicyGroupDescriptionContextDisplayed(), GlobalConstants.isPolicyDetailsPolicyGroupDescriptionContextDisplayed); + assertTrue(policiesPage.isPolicyDetailsPolicyNameDescriptionLabelDisplayed(), GlobalConstants.isPolicyDetailsPolicyNameDescriptionLabelDisplayed); + assertTrue(policiesPage.isPolicyDetailsPolicyNameDescriptionContextDisplayed(), GlobalConstants.isPolicyDetailsPolicyNameDescriptionContextDisplayed); + assertTrue(policiesPage.isPolicyDetailsCommentsDisplayed(), GlobalConstants.isPolicyDetailsCommentsDisplayed); policiesPage.clickOnBackButton(); @@ -279,9 +273,12 @@ public void createOidecClient() { PartnerPolicyMappingPage.clickOnApplyFilterButton(); PartnerPolicyMappingPage.clickOnPartnerListViewElipsisButton(); - - PartnerPolicyMappingPage.clickOnApproveRejectButton(); - PartnerPolicyMappingPage.clickOnApproveSubmitButton(); + PartnerPolicyMappingPage.clickOnApproveOrRejectButton(); + assertTrue(PartnerPolicyMappingPage.isConfirmationPopupDisplayed(), GlobalConstants.isConfirmationPopupDisplayed); + assertTrue(PartnerPolicyMappingPage.isConfirmationPopupDetailedMessageDisplayed(), GlobalConstants.isConfirmationPopupDetailedMessageDisplayed); + assertTrue(PartnerPolicyMappingPage.isApproveRejectButtonDisplayed(), GlobalConstants.isApproveRejectButtonDisplayed); + assertTrue(PartnerPolicyMappingPage.isApproveSubmitButtonDisplayed(), GlobalConstants.isApproveSubmitButtonDisplayed); + PartnerPolicyMappingPage.clickOnApproveSubmitButton(); dashboardpage.clickOnProfileDropdown(); assertTrue(dashboardpage.isLogoutButtonDisplayed(), GlobalConstants.isLogoutButtonDisplayed); @@ -350,7 +347,7 @@ public void createOidecClient() { assertTrue(oidcClientPage.isPolicyNameAscIconDisplayed(), GlobalConstants.isPolicyNameDescAscIcon); assertTrue(oidcClientPage.isCreatedDateTimeDescISconDisplayed(), GlobalConstants.isCreatedDateTimeDescAscIcon); assertTrue(oidcClientPage.isCreatedDateTimeAscIconDisplayed(), GlobalConstants.isCreatedDateTimeDescAscIcon); - assertTrue(oidcClientPage.isFilterButtonButtonEnabled(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); + assertTrue(oidcClientPage.isFilterButtonButtonEnabled(), GlobalConstants.isFilterButtonButtonEnabled); assertTrue(oidcClientPage.isSubTitleHomeButtonDisplayed(), GlobalConstants.isHomeButtonInAuthenticationDisplayed); oidcClientPage.clickOnFilterButton(); @@ -360,9 +357,26 @@ public void createOidecClient() { oidcClientPage.clickOnOidcSelectClientNameFilter(); oidcClientPage.clickOnOidcSelectStatusFilter(); - assertTrue(oidcClientPage.isfilterResetButtonDisplayed(), GlobalConstants.isResetFiletrButtonDisplayed); - assertTrue(oidcClientPage.isFilterButtonButtonEnabled(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); + assertTrue(oidcClientPage.isfilterResetButtonDisplayed(), GlobalConstants.isfilterResetButtonDisplayed); + oidcClientPage.clickOnFilterResetButton(); + assertTrue(oidcClientPage.isFilterButtonButtonEnabled(), GlobalConstants.isFilterButtonButtonEnabled); + + oidcClientPage.clickOnOidcClientListPageCreateOidcClientBtn(); + + assertTrue(oidcClientPage.isPartnerIdDropdownDisplayed(), GlobalConstants.isPartnerIdDropdownDisplayed); + oidcClientPage.selectPartnerIdDropdown(); + + assertTrue(oidcClientPage.isPolicyNameDropdownDisplayed(), GlobalConstants.isPolicyNameDropdownDisplayed); + oidcClientPage.selectPolicyNameDropdown(data); + + oidcClientPage.enterNameOidcTextBox(" "); + + oidcClientPage.enterPublicKeyTextBox(" "); + oidcClientPage.enterLogoUrTextBox(" "); + oidcClientPage.enterRedirectUriTextBox(" "); + assertTrue(oidcClientPage.isEnterValidUriForLogoUriTextDisplayed(), GlobalConstants.isEnterValidLogoUriTextDisplayed); + assertTrue(oidcClientPage.isEnterValidUriForRedirectUriTextDisplayed(), GlobalConstants.isEnterRedirectUriTextDisplayed); } // @Test(priority = 4) @@ -385,16 +399,15 @@ public void CreateApiKey() { oidcClientPage.clickOnApiKeyTab(); assertTrue(apiKeyPage.isGenerateAPIKeyDisplayed(), GlobalConstants.isGenerateAPIKeyDisplayed); - apiKeyPage.ClickOnAPIKeyDisplayed(); + apiKeyPage.clickOnAPIKeyDisplayed(); assertTrue(apiKeyPage.isPartnerIdDropdownDisplayed(), GlobalConstants.isPartnerIdDropdownDisplayed); apiKeyPage.selectPartnerIdDropdown(); - - - apiKeyPage.selectPolicyNameDropdown(data); + assertTrue(apiKeyPage.isPolicyNameDropdownDisplayed(), GlobalConstants.isPolicyNameDropdownDisplayed); + apiKeyPage.selectPolicyNameDropdown(data); apiKeyPage.enterNameOfApiKeyTextBox("0"+data); - apiKeyPage.ClickOnSubmitButton(); + apiKeyPage.clickOnSubmitButton(); // assertTrue(oidcClientPage.isAuthorizationCodeTextDisplayed(), GlobalConstants.isAutherisationCodeTextDisplayed); apiKeyPage.clickOnCopyIdButton(); @@ -403,6 +416,36 @@ public void CreateApiKey() { apiKeyPage.clickOnConfirmationGoBackButton(); assertTrue(apiKeyPage.isApiListItem1Displayed(), GlobalConstants.isApiListDisplayed); + assertTrue(apiKeyPage.isApiKeyListPageGenerateApiKeyBtnDisplayed(), GlobalConstants.isApiKeyListPageGenerateApiKeyBtnDisplayed); + apiKeyPage.clickOnApiKeyListPageGenerateApiKeyBtnDisplayed(); + assertTrue(apiKeyPage.isPartnerIdHelpTextDisplayed(), GlobalConstants.isPartnerIdHelpTextDisplayed); + assertTrue(apiKeyPage.isPolicyNameHelpTextDisplayed(), GlobalConstants.isPolicyNameHelpTextDisplayed); + apiKeyPage.selectPartnerIdDropdown(); + apiKeyPage.selectPolicyNameDropdown(data); + apiKeyPage.enterNameOfApiKeyTextBox("0"+data); + assertTrue(apiKeyPage.isClearButtonDisplayed(), GlobalConstants.isClearButtonDisplayed); + apiKeyPage.clickOnClearButton(); + assertTrue(apiKeyPage.isCancelButtonDisplayed(), GlobalConstants.isCancelButtonDisplayed); + apiKeyPage.clickOnCancelButton(); + assertTrue(apiKeyPage.isApiListItem1Displayed(), GlobalConstants.isApiListDisplayed); + + apiKeyPage.clickOnApiKeyListPageGenerateApiKeyBtnDisplayed(); + apiKeyPage.selectPartnerIdDropdown(); + apiKeyPage.selectPolicyNameDropdown(data); + apiKeyPage.enterNameOfApiKeyTextBox("#$%#&*"); + apiKeyPage.clickOnSubmitButton(); + apiKeyPage.clickOnCopyIdCloseButton(); + assertTrue(apiKeyPage.isConfirmationGoBackButtonDisplayed(), GlobalConstants.isGoBackButtonDisplayed); + apiKeyPage.clickOnConfirmationGoBackButton(); + + apiKeyPage.clickOnApiKeyListPageGenerateApiKeyBtnDisplayed(); + apiKeyPage.selectPartnerIdDropdown(); + apiKeyPage.selectPolicyNameDropdown(data); + apiKeyPage.enterNameOfApiKeyTextBox("#$%#&*"); + apiKeyPage.clickOnSubmitButton(); + assertTrue(apiKeyPage.isDuplicateApiKeyNameErrorMessageDisplayed(), GlobalConstants.isDuplicateApiKeyNameErrorMessageDisplayed); + apiKeyPage.clickOnDuplicateApiKeyNameErrorMessageCancelButton(); + apiKeyPage.clickOnCancelButton(); assertTrue(apiKeyPage.isPartnerIdDescIconDisplayed(), GlobalConstants.isPartnerIdDescAscIcon); assertTrue(apiKeyPage.isPartnerIdAscIconDisplayed(), GlobalConstants.isPartnerIdDescAscIcon); @@ -414,7 +457,7 @@ public void CreateApiKey() { assertTrue(apiKeyPage.isPolicyNameAscIconDisplayed(), GlobalConstants.isPolicyNameDescAscIcon); assertTrue(apiKeyPage.isCreatedDateTimeDescISconDisplayed(), GlobalConstants.isCreatedDateTimeDescAscIcon); assertTrue(apiKeyPage.isCreatedDateTimeAscIconDisplayed(), GlobalConstants.isCreatedDateTimeDescAscIcon); - assertTrue(apiKeyPage.isFilterButtonButtonEnabled(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); + assertTrue(apiKeyPage.isFilterButtonButtonEnabled(), GlobalConstants.isFilterButtonButtonEnabled); apiKeyPage.clickOnFilterButton(); apiKeyPage.clickOnApiKeyPartnerIdFilter(); @@ -424,28 +467,26 @@ public void CreateApiKey() { apiKeyPage.clickOnApiKeySelectStatusFilter(); apiKeyPage.clickOnFilterResetButton(); - assertTrue(apiKeyPage.isFilterButtonButtonEnabled(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); + assertTrue(apiKeyPage.isFilterButtonButtonEnabled(), GlobalConstants.isFilterButtonButtonEnabled); apiKeyPage.clickOnapiListElipsisButton(); apiKeyPage.clickOnApiKeyViewButton(); - assertTrue(apiKeyPage.isApiKeyDetailsPartnerIdLabelDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPartnerIdContextDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPolicyGroupLabelDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPolicyGroupNameContextDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPolicyNameLabelDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPolicyNameContextDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPolicyGoupDescriptionLabelDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPolicyGroupDescriptionContextDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPolicyNameDescriptionLabelDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsPolicyDescriptionContextDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsApiKeyNameLabelDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isApiKeyDetailsApiKeyLabelContextDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); - assertTrue(apiKeyPage.isViewApiKeyBackButtonDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); + assertTrue(apiKeyPage.isApiKeyDetailsPartnerIdLabelDisplayed(), GlobalConstants.isApiKeyDetailsPartnerIdLabelDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPartnerIdContextDisplayed(), GlobalConstants.isApiKeyDetailsPartnerIdContextDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPolicyGroupLabelDisplayed(), GlobalConstants.isApiKeyDetailsPolicyGroupLabelDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPolicyGroupNameContextDisplayed(), GlobalConstants.isApiKeyDetailsPolicyGroupNameContextDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPolicyNameLabelDisplayed(), GlobalConstants.isApiKeyDetailsPolicyNameLabelDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPolicyNameContextDisplayed(), GlobalConstants.isApiKeyDetailsPolicyNameContextDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPolicyGoupDescriptionLabelDisplayed(), GlobalConstants.isApiKeyDetailsPolicyGoupDescriptionLabelDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPolicyGroupDescriptionContextDisplayed(), GlobalConstants.isApiKeyDetailsPolicyGroupDescriptionContextDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPolicyNameDescriptionLabelDisplayed(), GlobalConstants.isApiKeyDetailsPolicyNameDescriptionLabelDisplayed); + assertTrue(apiKeyPage.isApiKeyDetailsPolicyDescriptionContextDisplayed(), GlobalConstants.isApiKeyDetailsPolicyDescriptionContextDisplayed); + assertTrue(apiKeyPage.isViewApiKeyBackButtonDisplayed(), GlobalConstants.isViewApiKeyBackButtonDisplayed); + assertTrue(apiKeyPage.isBackiconDisplayed(), GlobalConstants.isBackiconDisplayed); apiKeyPage.clickOnViewApiKeyBackButton(); - assertTrue(apiKeyPage.isBackiconDisplayed(), GlobalConstants.isFiletrButtonDisplayedOrEnabled); } @Test(priority = 5) @@ -631,7 +672,7 @@ public void CreateApiKeyWithouUploadingCertificates() { oidcClientPage.clickOnApiKeyTab(); assertTrue(apiKeyPage.isGenerateAPIKeyDisplayed(), GlobalConstants.isGenerateAPIKeyDisplayed); - apiKeyPage.ClickOnAPIKeyDisplayed(); + apiKeyPage.clickOnAPIKeyDisplayed(); assertTrue(apiKeyPage.isPartnerIdDropdownDisplayed(), GlobalConstants.isPartnerIdDropdownDisplayed); apiKeyPage.ClickOnPartnerIdDropdown(); assertTrue(apiKeyPage.isnoDataAvailableTextDisplayed(), GlobalConstants.isNoDataTextDisplaed); diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/testcase/CreateOidecClient.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/testcase/CreateOidecClient.java index f464f52c..6a2827b3 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/testcase/CreateOidecClient.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/testcase/CreateOidecClient.java @@ -19,84 +19,4 @@ import io.mosip.testrig.pmprevampui.utility.GlobalConstants; import io.mosip.testrig.pmprevampui.utility.TestRunner; -public class CreateOidecClient extends BaseClass { - - @Test - public void CreateOidecClientcWithSpaceValu() { - - DashboardPage dashboardpage = new DashboardPage(driver); - - assertTrue(dashboardpage.isAuthenticationServicesTitleDisplayed(), GlobalConstants.isAuthenticationServicesDisplayed); - OidcClientPage oidcClientPage=dashboardpage.clickOnAuthenticationServicesTitle(); - - assertTrue(oidcClientPage.isCreateOidcClientDisplayed(), GlobalConstants.isCreateOIDCClientDisplayed); - oidcClientPage.clickOnCreateOidcClientButton(); - - assertTrue(oidcClientPage.isPartnerIdDropdownDisplayed(), GlobalConstants.isPartnerIdDropdownDisplayed); - oidcClientPage.selectPartnerIdDropdown(); - - assertTrue(oidcClientPage.isPolicyNameDropdownDisplayed(), GlobalConstants.isPolicyNameDropdownDisplayed); - oidcClientPage.selectPolicyNameDropdown(data+"ad"); - - oidcClientPage.enterNameOidcTextBox(" "); - - oidcClientPage.enterPublicKeyTextBox(" "); - oidcClientPage.enterLogoUrTextBox(" "); - oidcClientPage.enterRedirectUriTextBox(" "); - - assertTrue(oidcClientPage.isEnterValidUriForLogoUriTextDisplayed(), GlobalConstants.isEnterValidLogoUriTextDisplayed); - assertTrue(oidcClientPage.isEnterValidUriForRedirectUriTextDisplayed(), GlobalConstants.isEnterRedirectUriTextDisplayed); - - } - - @Test - public void CreateOidecClientWithouUploadingCertificates() { - - DashboardPage dashboardpage = new DashboardPage(driver); - ApiKeyPage apiKeyPage = new ApiKeyPage(driver); - dashboardpage.clickOnProfileDropdown(); - assertTrue(dashboardpage.isLogoutButtonDisplayed(), GlobalConstants.isLogoutButtonDisplayed); - - LoginPage loginpage = dashboardpage.clickOnLogoutButton(); - - loginpage.enterUserName("0"+ data+"n"); - loginpage.enterPassword(password); - loginpage.ClickOnLoginButton(); - - assertTrue(dashboardpage.isAuthenticationServicesTitleDisplayed(), GlobalConstants.isAuthenticationServicesDisplayed); - OidcClientPage oidcClientPage=dashboardpage.clickOnAuthenticationServicesTitle(); - - assertTrue(oidcClientPage.isCreateOidcClientDisplayed(), GlobalConstants.isCreateOIDCClientDisplayed); - assertTrue(oidcClientPage.isPolicyGroupHeaderTextDisplayed(), GlobalConstants.isPolicyGroupHeaderTextDisplayed); - assertTrue(oidcClientPage.isPolicyNameHeaderTextDisplayed(), GlobalConstants.isPolicyNameHeaderTextDisplayed); - assertTrue(oidcClientPage.isOIDCClientNameHeaderTextDisplayed(), GlobalConstants.isOIDCClientNameHeaderTextDisplayed); - assertTrue(oidcClientPage.isCreatedDateHeaderTextDisplayed(), GlobalConstants.isCreatedDateHeaderTextDisplayed); - assertTrue(oidcClientPage.isStatusHeaderTextDisplayed(), GlobalConstants.isStatusHeaderTextDisplayed); - assertTrue(oidcClientPage.isOIDCClientIDHeaderTextDisplayed(), GlobalConstants.isOIDCClientIDHeaderTextDisplayed); - assertTrue(oidcClientPage.isActionHeaderTextDisplayed(), GlobalConstants.isActionHeaderTextDisplayed); - oidcClientPage.clickOnCreateOidcClientButton(); - - assertTrue(oidcClientPage.isPartnerIdDropdownDisplayed(), GlobalConstants.isPartnerIdDropdownDisplayed); -// assertTrue(oidcClientPage.isUserIdDoesNotExistsPopupDisplayed(), GlobalConstants.isPartnerIdDropdownDisplayed); - oidcClientPage.clickOnPartnerIdDropdown(); - - assertTrue(oidcClientPage.isNoDataAvailableTextDisplayed(), GlobalConstants.isNoDataAvailableTextDisplayed); - - String publicKey = KeycloakUserManager.readJsonData(TestRunner.getResourcePath() + "/" + "config/"+"/publicKey.json").toString(); - oidcClientPage.enterPublicKeyTextBox(publicKey); - oidcClientPage.enterLogoUrTextBox(ConfigManager.getLogouri()); - oidcClientPage.enterRedirectUriTextBox(ConfigManager.getRedirectUri()); - oidcClientPage.clickOnAddNewRedirectUrlButton(); - oidcClientPage.EntercreateOidcRedirectUrl2(ConfigManager.getRedirectUri()+"a"); - oidcClientPage.clickOnAddNewRedirectUrlButton(); - oidcClientPage.EntercreateOidcRedirectUrl3(ConfigManager.getRedirectUri()+"b"); - oidcClientPage.clickOnAddNewRedirectUrlButton(); - oidcClientPage.EntercreateOidcRedirectUrl4(ConfigManager.getRedirectUri()+"c"); - oidcClientPage.clickOnAddNewRedirectUrlButton(); - oidcClientPage.EntercreateOidcRedirectUrl5(ConfigManager.getRedirectUri()+"d"); - - oidcClientPage.clickOnCreateOidcClearForm(); - - assertFalse(oidcClientPage.isCreateOidcRedirectUrl5Displayed(), GlobalConstants.isNoDataAvailableTextDisplayed); - } -} +public class CreateOidecClient extends BaseClass {} diff --git a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/utility/GlobalConstants.java b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/utility/GlobalConstants.java index 4364b4fb..86775c0a 100644 --- a/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/utility/GlobalConstants.java +++ b/uitest-pmprevamp/src/main/java/io/mosip/testrig/pmprevampui/utility/GlobalConstants.java @@ -98,8 +98,8 @@ public class GlobalConstants { public static final String SERVICE_NOT_DEPLOYED = "Service not deployed"; public static final String SERVICE_NOT_DEPLOYED_MESSAGE = "Service not deployed. Hence skipping the testcase"; public static final String KNOWN_ISSUES = "known issue. Hence skipping the testcase"; - public static final String isResetFiletrButtonDisplayed = "Verify if rest filter button displayed"; - public static final String isFiletrButtonDisplayedOrEnabled = "Verify if filter button displayed"; + public static final String isfilterResetButtonDisplayed = "Verify if rest filter button displayed"; + public static final String isFilterButtonButtonEnabled = "Verify if filter button displayed"; public static final String isGoBackButtonDisplayed = "Verify if go back button displayed"; public static final String isApiListDisplayed = "Verify if api list is displayed"; public static final String isUserIdDoesNotExietDisplayed = "Verify if api list is displayed"; @@ -119,6 +119,43 @@ public class GlobalConstants { public static final String RELOAD_MESSAGE = "Changes you made may not be saved."; public static final String INITIAL_SBI_VERSION = "Enter version of SBI"; public static final String INITIAL_SBI_BINARY_HASH = "Enter binary hash of SBI"; + public static final String isApiKeyListPageGenerateApiKeyBtnDisplayed = "Verify if api key list page generate api key button displayed"; + public static final String isPartnerIdHelpTextDisplayed = "Verify if partner ID help text displayed"; + public static final String isPolicyNameHelpTextDisplayed = "Verify if policy name help text displayed"; + public static final String isClearButtonDisplayed = "Verify if clear button displayed"; + public static final String isCancelButtonDisplayed = "Verify if cancel button displayed"; + public static final String isApiKeyDetailsPartnerIdLabelDisplayed = "Verify if api key details partner ID label displayed"; + public static final String isApiKeyDetailsPartnerIdContextDisplayed = "Verify if api key details partner ID context displayed"; + public static final String isApiKeyDetailsPolicyGroupLabelDisplayed = "Verify if api key details policy group label displayed"; + public static final String isApiKeyDetailsPolicyGroupNameContextDisplayed = "Verify if api key details policy group name context displayed"; + public static final String isApiKeyDetailsPolicyNameLabelDisplayed = "Verify if api key details policy name label displayed"; + public static final String isApiKeyDetailsPolicyNameContextDisplayed = "Verify if api key details policy name context displayed"; + public static final String isApiKeyDetailsPolicyGoupDescriptionLabelDisplayed = "Verify if api key details policy group description label displayed"; + public static final String isApiKeyDetailsPolicyGroupDescriptionContextDisplayed = "Verify if api key details policy group description context displayed"; + public static final String isApiKeyDetailsPolicyNameDescriptionLabelDisplayed = "Verify if api key details policy name description label displayed"; + public static final String isApiKeyDetailsPolicyDescriptionContextDisplayed = "Verify if api key details policy description context displayed"; + public static final String isApiKeyDetailsApiKeyNameLabelDisplayed = "Verify if api key details api key name label displayed"; + public static final String isApiKeyDetailsApiKeyLabelContextDisplayed = "Verify if api key details api key label context displayed"; + public static final String isViewApiKeyBackButtonDisplayed = "Verify if view api key button displayed"; + public static final String isBackiconDisplayed = "Verify if back icon displayed"; + public static final String isConfirmationPopupDisplayed = "Verify if confirmation popup displayed"; + public static final String isConfirmationPopupDetailedMessageDisplayed = "Verify if confirmation popup detailed message displayed"; + public static final String isApproveRejectButtonDisplayed = "Verify if approve reject button displayed"; + public static final String isApproveSubmitButtonDisplayed = "Verify if approve submit button displayed"; + public static final String isPolicyDetailsPartnerIdLabelDisplayed = "Verify if policy details partner id label displayed"; + public static final String isPolicyDetailsPolicyGroupNameLabelDisplayed = "Verify if policy details policy group name label displayed"; + public static final String isPolicyDetailsPolicyGroupNameContextDisplayed = "Verify if policy details policy group name context displayed"; + public static final String isPolicyDetailsPartnerTypeLabelDisplayed = "Verify if policy details partner type label displayed"; + public static final String isPolicyDetailsPartnerTypeContextDisplayed = "Verify if policy details partner type context displayed"; + public static final String isPolicyDetailsPolicyNameLabelDisplayed = "Verify if policy details policy name label displayed"; + public static final String isPolicyDetailsPolicyNameContextDisplayed = "Verify if policy details policy name context displayed"; + public static final String isPolicyDetailsPolicyGroupDescriptionLabelDisplayed = "Verify if policy details policy group description label displayed"; + public static final String isPolicyDetailsPolicyGroupDescriptionContextDisplayed = "Verify if policy details policy group description context displayed"; + public static final String isPolicyDetailsPolicyNameDescriptionLabelDisplayed = "Verify if policy details policy name description label displayed"; + public static final String isPolicyDetailsPolicyNameDescriptionContextDisplayed = "Verify if policy details policy name description context displayed"; + public static final String isPolicyDetailsCommentsDisplayed = "Verify if policy details comments displayed"; + public static final String isDuplicateApiKeyNameErrorMessageDisplayed = "Verify if duplicate api key name error message displayed"; + public static final String isDeviceProviderSuccessMessageDisplayed = "Verify if device provider success message displayed"; public static final String APPID = "appId"; public static final String PASSWORD = "password";