Skip to content

Commit

Permalink
Bug 1814082 - New verifyStateFieldUpdatesInAccordanceWithCountryField…
Browse files Browse the repository at this point in the history
…Test UI test
  • Loading branch information
AndiAJ authored and mergify[bot] committed Feb 8, 2023
1 parent 52ae468 commit fc54bd0
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -313,4 +313,20 @@ class AddressAutofillTest {
verifyManageAddressesToolbarTitle()
}
}

@Test
fun verifyStateFieldUpdatesInAccordanceWithCountryFieldTest() {
homeScreen {
}.openThreeDotMenu {
}.openSettings {
}.openAutofillSubMenu {
verifyAddressAutofillSection(true, false)
clickAddAddressButton()
verifyCountryOption("United States")
verifyStateOption("Alabama")
verifyCountryOptions("Canada", "United States")
clickCountryOption("Canada")
verifyStateOption("Alberta")
}
}
}
Original file line number Diff line number Diff line change
@@ -116,6 +116,27 @@ class SettingsSubMenuAutofillRobot {
)
}

fun verifyCountryOption(country: String) {
scrollToElementByText(getStringResource(R.string.addresses_country))
mDevice.pressBack()
assertItemContainingTextExists(itemContainingText(country))
}

fun verifyStateOption(state: String) =
assertItemContainingTextExists(itemContainingText(state))

fun verifyCountryOptions(vararg countries: String) {
countryDropDown.click()
for (country in countries) {
assertItemContainingTextExists(itemContainingText(country))
}
}

fun selectCountry(country: String) {
countryDropDown.click()
countryOption(country).click()
}

fun verifyEditAddressView() {
assertItemContainingTextExists(editAddressToolbarTitle)
assertItemWithDescriptionExists(navigateBackButton)

0 comments on commit fc54bd0

Please sign in to comment.