Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Update autofill webdriver tests to use Country as a dropdown value in…
Browse files Browse the repository at this point in the history
…stead of a text field

Auditors: @dfperry5, @darkdh, @luixxiul

Test Plan: `npm run test -- --grep="Autofill"
  • Loading branch information
bsclifton committed Sep 9, 2017
1 parent 83dbfe9 commit 3351c6d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/contents/autofillTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const postalCode = '94103-1550'
const postalCodeInput = '[data-test-id="postalCode"]'
const country = 'US'
const countryInput = '[data-test-id="country"]'
const countryValue = 'United States'
const phone = '0987654321'
const phoneInput = '[data-test-id="phone"]'
const email = 'press@brave.com'
Expand Down Expand Up @@ -75,8 +76,7 @@ describe('Autofill', function () {
.typeText(stateInput, state)
.click(postalCodeInput)
.typeText(postalCodeInput, postalCode)
.click(countryInput)
.typeText(countryInput, country)
.selectByValue(countryInput, country)
.click(phoneInput)
.typeText(phoneInput, phone)
.click(emailInput)
Expand All @@ -100,7 +100,7 @@ describe('Autofill', function () {
.waitForTextValue(cityInput, city)
.waitForTextValue(stateInput, state)
.waitForTextValue(postalCodeInput, postalCode)
.waitForTextValue(countryInput, country)
.waitForTextValue(countryInput, countryValue)
.waitForTextValue(phoneInput, phone)
.waitForTextValue(emailInput, email)
})
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('Autofill', function () {
.waitForTextValue(cityInput, city)
.waitForTextValue(stateInput, state)
.waitForTextValue(postalCodeInput, postalCode)
.waitForTextValue(countryInput, country)
.waitForTextValue(countryInput, countryValue)
.waitForTextValue(phoneInput, phone + '123')
.waitForTextValue(emailInput, email + 'mm')
// fill out the form
Expand Down Expand Up @@ -346,8 +346,7 @@ describe('Autofill', function () {
.typeText(stateInput, state)
.click(postalCodeInput)
.typeText(postalCodeInput, postalCode)
.click(countryInput)
.typeText(countryInput, country)
.selectByValue(countryInput, country)
.click(phoneInput)
.typeText(phoneInput, phone)
.click(emailInput)
Expand Down Expand Up @@ -388,7 +387,7 @@ describe('Autofill', function () {
.waitForTextValue(cityInput, city)
.waitForTextValue(stateInput, state)
.waitForTextValue(postalCodeInput, postalCode)
.waitForTextValue(countryInput, country)
.waitForTextValue(countryInput, countryValue)
.waitForTextValue(phoneInput, phone)
.waitForTextValue(emailInput, email)
})
Expand Down

0 comments on commit 3351c6d

Please sign in to comment.