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

[fenix] Bug 1814082 - New verifyFormFieldCanBeFilledManuallyTest UI test

This commit is contained in:
AndiAJ 2023-02-01 16:49:47 +02:00 committed by mergify[bot]
parent b22e3922d3
commit ee81a71701
3 changed files with 56 additions and 7 deletions

View File

@ -5,12 +5,13 @@
</head>
<body>
<form>
<p>Street Address: <input id="streetAddress" type="text"></p>
<p>City: <input id="city" type="text"></p>
<p>Zip Code: <input id="zipCode" type="text"></p>
<p>Country: <input id="country" type="text"></p>
<p>Telephone: <input id="telephone" type="text"></p>
<p>Email: <input id="email" type="text"></p>
<p>Street Address: <input id="streetAddress" type="text"></p>
<p>City: <input id="city" type="text"></p>
<p>Zip Code: <input id="zipCode" type="text"></p>
<p>Country: <input id="country" type="text"></p>
<p>Telephone: <input id="telephone" type="text"></p>
<p>Email: <input id="email" type="text"></p>
<p>Apartment, suite, etc. <input id="apartment" type="text"></p>
</form>
</body>
</html>
</html>

View File

@ -329,4 +329,41 @@ class AddressAutofillTest {
verifyStateOption("Alberta")
}
}
@Test
fun verifyFormFieldCanBeFilledManuallyTest() {
val addressFormPage =
TestAssetHelper.getAddressFormAsset(mockWebServer)
homeScreen {
}.openThreeDotMenu {
}.openSettings {
}.openAutofillSubMenu {
clickAddAddressButton()
fillAndSaveAddress(
"Mozilla",
"Fenix",
"Firefox",
"Harrison Street",
"San Francisco",
"Alaska",
"94105",
"United States",
"555-5555",
"foo@bar.com",
)
}
exitMenu()
navigationToolbar {
}.enterURLAndEnterToBrowser(addressFormPage.url) {
clickStreetAddressTextBox()
clickSelectAddressButton()
clickAddressSuggestion("Harrison Street")
verifyAutofilledAddress("Harrison Street")
setTextForApartmentTextBox("Ap. 07")
verifyManuallyFilledAddress("Ap. 07")
}
}
}

View File

@ -524,6 +524,9 @@ class BrowserRobot {
fun clickStreetAddressTextBox() = clickPageObject(webPageItemWithResourceId("streetAddress"))
fun setTextForApartmentTextBox(apartment: String) =
webPageItemWithResourceId("apartment").setText(apartment)
fun clearAddressForm() {
webPageItemWithResourceId("streetAddress").clearTextField()
webPageItemWithResourceId("city").clearTextField()
@ -624,6 +627,14 @@ class BrowserRobot {
)
}
fun verifyManuallyFilledAddress(apartment: String) {
mDevice.waitForObjects(webPageItemContainingTextAndResourceId("apartment", apartment))
assertTrue(
webPageItemContainingTextAndResourceId("apartment", apartment)
.waitForExists(waitingTime),
)
}
fun verifyAutofilledCreditCard(creditCardNumber: String) {
mDevice.waitForObjects(webPageItemContainingTextAndResourceId("cardNumber", creditCardNumber))
assertTrue(