2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] Bug 1814082 - New verifyStateFieldUpdatesInAccordanceWithCountryFieldTest UI test

This commit is contained in:
AndiAJ 2023-02-01 14:02:46 +02:00 committed by mergify[bot]
parent 2ec11455fa
commit b22e3922d3
2 changed files with 37 additions and 0 deletions

View File

@ -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")
}
}
}

View File

@ -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)