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

INJIVER-706 enhancement for inji verify #180

Merged
merged 1 commit into from
Oct 3, 2024
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
1 change: 0 additions & 1 deletion ui-test/src/main/java/base/BasePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,4 @@ protected void sendKeysToTextBox(WebElement element, String text) {
this.waitForElementToBeVisible(element);
element.sendKeys(text);
}

}
1 change: 1 addition & 0 deletions ui-test/src/main/java/pages/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,5 @@ public Boolean isErrorMessageVisible() {
return isElementIsVisible(driver, errorMeassage);
}


}
1 change: 1 addition & 0 deletions ui-test/src/main/java/pages/ScanQRCodePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,5 @@ public void clickOnCloseIconTimeoutMessage() {
clickOnElement(driver, CloseIconTimeoutMessage);
}


}
5 changes: 5 additions & 0 deletions ui-test/src/main/java/pages/UploadQRCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ public void ClickonUploadQRCodeInvalid() {
uploadFileForInvalid(driver, UploadQRCodeButton, "Invalid.png");
}

public void ClickonUploadQRCodeDownloadedFromPhone() {
uploadFileForInvalid(driver, UploadQRCodeButton, "VcDownloadedFromMobileApp.png");
}

public void ClickonUploadExpiredQRCodepngExpired() {
uploadFileForInvalid(driver, UploadQRCodeButton, "Expired_QRCode.png");

Expand Down Expand Up @@ -207,4 +211,5 @@ public void clickOnPleaseTryAgain() {
clickOnElement(driver, PleaseTryAgain);
}


}
26 changes: 18 additions & 8 deletions ui-test/src/test/java/stepdefinitions/StepDef.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ public void verify_qr_code_file_invalid() {

}

@Given("Upload QR code file PDF downloaded from mobile")
public void upload_qr_code_file_pdf_downloaded_from_mobile() {
uploadqrcode.ClickonUploadQRCodeDownloadedFromPhone();
Assert.assertTrue(true);
}

@Then("Verify Error logo for invalid QR code")
public void verify_error_logo_for_invalid_qr_code() {
Assert.assertTrue(uploadqrcode.isVisibleErrorIcon());
Expand Down Expand Up @@ -505,6 +511,11 @@ public void upload_qr_code_file_expired_pdf() {
Assert.assertTrue(true);
}

@Then("Verify message for valid QR code")
public void verify_message_for_valid_qr_code() {
Assert.assertEquals(uploadqrcode.getErrorMessageForExpiredQRCode(), UiConstants.CONGRATULATIONS_MESSAGE);
}

@Then("Verify message for expired QR code")
public void verify_message_for_expired_qr_code() {
Assert.assertEquals(uploadqrcode.getErrorMessageForExpiredQRCode(), UiConstants.ERROR_MESSAGE_EXPIRED_QR);
Expand Down Expand Up @@ -533,7 +544,6 @@ public void user_search_the_issuers_with(String string) {
public void user_click_on_download_veridonia_button() {
homePage.clickOnDownloadMosipCredentials();
}

@Then("User verify mosip national id by e-signet displayed")
public void user_verify_mosip_national_id_by_e_signet_displayed() {
Assert.assertTrue(homePage.isMosipNationalIdDisplayed());
Expand Down Expand Up @@ -567,7 +577,7 @@ public void user_click_on_verify_button() {
@Then("User verify Download Success text displayed")
public void user_verify_download_success_text_displayed() {
try {
Thread.sleep(3000);
Thread.sleep(6000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -620,12 +630,12 @@ public void verify_that_user_convert_pdf_into_png() throws IOException {
PDPage page = document.getPage(i);
BufferedImage image = renderer.renderImage(i);

String outputFileNamePNG = outputPath +(i) + ".png";
String outputFileNameJPG = outputPath +(i) + ".jpg";
String outputFileNameJPEG = outputPath +(i) + ".jpeg";
ImageIO.write(image, "png", new File(outputFileNamePNG));
ImageIO.write(image, "jpg", new File(outputFileNameJPG));
ImageIO.write(image, "jpeg", new File(outputFileNameJPEG));
String outputFileNamepng = outputPath +(i) + ".png";
String outputFileNamejpg = outputPath +(i) + ".jpg";
String outputFileNamejpeg = outputPath +(i) + ".jpeg";
ImageIO.write(image, "png", new File(outputFileNamepng));
ImageIO.write(image, "jpg", new File(outputFileNamejpg));
ImageIO.write(image, "jpeg", new File(outputFileNamejpeg));
}

document.close();
Expand Down
1 change: 1 addition & 0 deletions ui-test/src/test/java/utils/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public void setDriver(WebDriver driver) {
String userName = getKeyValueFromYaml("/browserstack.yml","userName");
public final String URL = "https://" + userName + ":" + accessKey + "@hub-cloud.browserstack.com/wd/hub";


@Before
public void beforeAll() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
177 changes: 151 additions & 26 deletions ui-test/src/test/resources/featurefiles/UploadQRCodepage.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
Feature: Inji Verify upload qr code testing

@smoke @verifyuploadInValidqrcode
Scenario: Verify upload qr code for invalid
And Verify browser refresh
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Upload QR code file PDF
And Upload QR code file Expired png
And Verify message for expired QR code
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code file Expired jpg
And Verify message for expired QR code
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code file Expired jpeg
And Verify message for expired QR code
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code file Expired pdf
And Verify message for expired QR code
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code unsupported file HTML
And Verify Error message

@smoke @verifyuploadqrcode
Scenario Outline: Verify upload qr code
Scenario Outline: Verify upload qr code with png
And Open inji web in new tab
And User search the issuers with "veridonia"
When User click on veridonia credentials button
Expand All @@ -10,6 +36,7 @@ Feature: Inji Verify upload qr code testing
And User enter the full name "<full name>"
And User enter the date of birth "<date of birth>"
And User click on login button
Then User verify Download Success text displayed
And User verify pdf is downloaded
And User verify go back button
And Open inji verify in new tab
Expand All @@ -30,61 +57,159 @@ Feature: Inji Verify upload qr code testing
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Upload QR code file PDF
And Upload QR code file png
And verify upload QR code step2 description after
And verify upload QR code step3 description after
And verify tick icon is visible on successful verification
And verify congratulations message on successful verification
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code file png
And verify alert message
Examples:
| policy number | full name | date of birth |
| 120786786 | PolicyTestAutomation | 01-01-2024 |

And Open inji web in tab
And verify click on home button

@smoke @verifyuploadqrcode
Scenario Outline: Verify upload qr code with PDF
And Open inji web in new tab
And User search the issuers with "veridonia"
When User click on veridonia credentials button
When User click on health insurance by e-signet button
And User enter the policy number "<policy number>"
And User enter the full name "<full name>"
And User enter the date of birth "<date of birth>"
And User click on login button

Then User verify Download Success text displayed
And User verify pdf is downloaded
And User verify go back button
And Open inji verify in new tab
And Upload QR code file JPG
# And verify toast message
Given User gets the title of the page
Then Validate the title of the page
And Verify that upload QR Code tab is visible
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Verify that user convert pdf into png
And Upload QR code file PDF
And verify upload QR code step2 description after
And verify upload QR code step3 description after
And verify tick icon is visible on successful verification
And verify congratulations message on successful verification
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Upload QR code file PDF
And verify upload QR code step2 description after
And verify upload QR code step3 description after
And verify tick icon is visible on successful verification
And verify congratulations message on successful verification
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code file PDF
And verify alert message

Examples:
| policy number | full name | date of birth |
| 120786786 | PolicyTestAutomation | 01-01-2024 |

| 3455432102 | TestAutomationVerifyUI3 | 01-01-2024 |


@smoke @verifyuploadInValidqrcode
Scenario: Verify upload qr code for invalid
And Verify browser refresh
@smoke @verifyuploadqrcode
Scenario Outline: Verify upload qr code with jpg
And Open inji web in new tab
And User search the issuers with "veridonia"
When User click on veridonia credentials button
When User click on health insurance by e-signet button
And User enter the policy number "<policy number>"
And User enter the full name "<full name>"
And User enter the date of birth "<date of birth>"
And User click on login button
Then User verify Download Success text displayed
And User verify pdf is downloaded
And User verify go back button
And Open inji verify in new tab
Given User gets the title of the page
Then Validate the title of the page
And Verify that upload QR Code tab is visible
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Upload QR code file PDF
And Upload QR code file Expired png
And Verify message for expired QR code
And Verify that user convert pdf into png
And Upload QR code file JPG
And verify upload QR code step2 description after
And verify upload QR code step3 description after
And verify tick icon is visible on successful verification
And verify congratulations message on successful verification
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code file Expired jpg
And Verify message for expired QR code
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Upload QR code file JPG
And verify upload QR code step2 description after
And verify upload QR code step3 description after
And verify tick icon is visible on successful verification
And verify congratulations message on successful verification
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code file Expired jpeg
And Verify message for expired QR code
And Upload QR code file JPG
And verify alert message
Examples:
| policy number | full name | date of birth |
| 3455432101 | TestAutomationVerifyUI2 | 01-01-2024 |


@smoke @verifyuploadqrcode
Scenario Outline: Verify upload qr code with jpeg
And Open inji web in new tab
And User search the issuers with "veridonia"
When User click on veridonia credentials button
When User click on health insurance by e-signet button
And User enter the policy number "<policy number>"
And User enter the full name "<full name>"
And User enter the date of birth "<date of birth>"
And User click on login button
Then User verify Download Success text displayed
And User verify pdf is downloaded
And User verify go back button
And Open inji verify in new tab
Given User gets the title of the page
Then Validate the title of the page
And Verify that upload QR Code tab is visible
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Verify that user convert pdf into png
And Upload QR code file JPEG
And verify upload QR code step2 description after
And verify upload QR code step3 description after
And verify tick icon is visible on successful verification
And verify congratulations message on successful verification
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code file Expired pdf
And Verify message for expired QR code
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Upload QR code file JPEG
And verify upload QR code step2 description after
And verify upload QR code step3 description after
And verify tick icon is visible on successful verification
And verify congratulations message on successful verification
And Verify verify another qr code button on successful verification
And Verify click on another qr code button
And Upload QR code unsupported file HTML
And Verify Error message

And Upload QR code file JPEG
And verify alert message
Examples:
| policy number | full name | date of birth |
| 3455432100 | TestAutomationVerifyUI1 | 01-01-2024 |


@smoke @verifyuploadValidqrcodeDownloadedByMobileApp
Scenario: Verify upload qr code for Valid
And Verify browser refresh
And Verify upload QR code step2 label
And Verify upload QR code step3 label
And Verify that Upload button visible
And Upload QR code file PDF downloaded from mobile
And Verify message for valid QR code
3 changes: 1 addition & 2 deletions ui-test/src/test/resources/featurefiles/scanQRcode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ Feature: Inji Verify scan qr code testing
And verify click on scan qr code button
And Verify scan qr code step2 label after
And verify click on okay button
# And verify click on back button
And verify scan qr code button
And Click on Home button
And Verify that Upload button visible
And verify click on scan the qr tab
And Click on Verify Credential button
And Verify that Upload button visible
And verify click on scan the qr tab
And verify click on scan qr code button
And verify click on scan qr code button
Loading