Skip to content

Commit

Permalink
Addressed comment on PR
Browse files Browse the repository at this point in the history
PM-27
  • Loading branch information
SyedaGinii committed Sep 24, 2024
1 parent 0546575 commit ff585d7
Showing 1 changed file with 14 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ class DigitalInvoiceEditButtonTests {
IdlingRegistry.getInstance().register(idlingResource)
}

@Test
fun test1_verifyNameIsUpdatedAfterEditing() {
private fun clickPhotoPaymentAndUploadFile() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
}

@Test
fun test1_verifyNameIsUpdatedAfterEditing() {
clickPhotoPaymentAndUploadFile()
val isOnboardingScreenTextVisible = digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
assertEquals(true, isOnboardingScreenTextVisible)
val isOnboardingScreenButtonVisible = digitalInvoiceScreen.checkDigitalInvoiceButtonOnOnboardingScreenIsDisplayed()
Expand Down Expand Up @@ -84,12 +87,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test2_verifyUnitPriceIsUpdatedAfterEditing() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()
val isOnboardingScreenTextVisible = digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
assertEquals(true, isOnboardingScreenTextVisible)
val isOnboardingScreenButtonVisible = digitalInvoiceScreen.checkDigitalInvoiceButtonOnOnboardingScreenIsDisplayed()
Expand Down Expand Up @@ -117,12 +115,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test3_verifyQuantityIsUpdatedAfterEditing() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()
val isOnboardingScreenTextVisible = digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
assertEquals(true, isOnboardingScreenTextVisible)
val isOnboardingScreenButtonVisible = digitalInvoiceScreen.checkDigitalInvoiceButtonOnOnboardingScreenIsDisplayed()
Expand Down Expand Up @@ -150,12 +143,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test4_increaseQuantityByTappingPlus() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()
val isOnboardingScreenTextVisible = digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
assertEquals(true, isOnboardingScreenTextVisible)
val isOnboardingScreenButtonVisible = digitalInvoiceScreen.checkDigitalInvoiceButtonOnOnboardingScreenIsDisplayed()
Expand Down Expand Up @@ -183,12 +171,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test5_decreaseQuantityByTappingMinus() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()
val isOnboardingScreenTextVisible = digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
assertEquals(true, isOnboardingScreenTextVisible)
val isOnboardingScreenButtonVisible = digitalInvoiceScreen.checkDigitalInvoiceButtonOnOnboardingScreenIsDisplayed()
Expand Down Expand Up @@ -221,12 +204,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test6_verifyThatMinimumQuantityIs1() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()
val isOnboardingScreenTextVisible = digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
assertEquals(true, isOnboardingScreenTextVisible)
val isOnboardingScreenButtonVisible = digitalInvoiceScreen.checkDigitalInvoiceButtonOnOnboardingScreenIsDisplayed()
Expand Down Expand Up @@ -254,12 +232,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test7_checkCurrencyForUnitPrice() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()

val isOnboardingScreenTextVisible = digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
assertEquals(true, isOnboardingScreenTextVisible)
Expand All @@ -283,12 +256,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test8_clickCancelButtonAndVerifyItemDetailsRemainUnchanged() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()

val isOnboardingScreenTextVisible =
digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
Expand Down Expand Up @@ -326,12 +294,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test9_verifyInlineErrorWhenNameFieldIsEmpty() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()

val isOnboardingScreenTextVisible =
digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
Expand Down Expand Up @@ -363,12 +326,7 @@ class DigitalInvoiceEditButtonTests {

@Test
fun test10_verifyInlineErrorWhenUnitPriceFieldIsEmpty() {
mainScreen.clickPhotoPaymentButton()
onboardingScreen.clickSkipButton()
captureScreen.clickFilesButton()
captureScreen.clickFiles()
pdfUploader.uploadPdfFromFiles("Testrechnung-RA-1.pdf")
idlingResource.waitForIdle()
clickPhotoPaymentAndUploadFile()

val isOnboardingScreenTextVisible =
digitalInvoiceScreen.checkDigitalInvoiceTextOnOnboardingScreenIsDisplayed()
Expand Down

0 comments on commit ff585d7

Please sign in to comment.