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

Commit

Permalink
Add fist entry focus test
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed May 3, 2017
1 parent a800fdb commit d1f502a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions app/renderer/components/autofill/autofillCreditCardPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class AutofillCreditCardPanel extends ImmutableComponent {
commonFormStyles.input__box,
styles.input
)}
data-test-id='creditCardName'
spellCheck='false'
onKeyDown={this.onKeyDown}
onChange={this.onNameChange}
Expand All @@ -126,6 +127,7 @@ class AutofillCreditCardPanel extends ImmutableComponent {
className={css(commonFormStyles.input__marginRow)
}>
<CommonFormTextbox
data-test-id='creditCardNumber'
spellCheck='false'
onKeyDown={this.onKeyDown}
onChange={this.onCardChange}
Expand Down
16 changes: 8 additions & 8 deletions test/contents/autofillTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Autofill', function () {
.click(addAddressButton)
.windowByUrl(Brave.browserWindowUrl)
.waitForVisible(autofillAddressPanel)
.click('[data-test-id="nameOnAddress"]')
.waitForElementFocus('[data-test-id="nameOnAddress"]')
.keys(name)
.click('[data-test-id="organization"]')
.keys(organization)
Expand Down Expand Up @@ -189,9 +189,9 @@ describe('Autofill', function () {
.click(addCreditCardButton)
.windowByUrl(Brave.browserWindowUrl)
.waitForVisible(autofillCreditCardPanel)
.click('[data-test-id="creditCardNameWrapper"]')
.waitForElementFocus('[data-test-id="creditCardName"]')
.keys(cardName)
.click('[data-test-id="creditCardNumberWrapper"]')
.click('[data-test-id="creditCardNumber"]')
.keys(cardNumber)
.selectByValue('[data-test-id="expMonthSelect"]', expMonth < 10 ? '0' + expMonth.toString() : expMonth.toString())
.selectByValue('[data-test-id="expYearSelect"]', expYear.toString())
Expand Down Expand Up @@ -252,10 +252,10 @@ describe('Autofill', function () {
.click('[data-test-id="EditCreditCard"]')
.windowByUrl(Brave.browserWindowUrl)
.waitForVisible(autofillCreditCardPanel)
.click('[data-test-id="creditCardNameWrapper"]')
.waitForElementFocus('[data-test-id="creditCardName"]')
.keys(Brave.keys.END)
.keys('123')
.click('[data-test-id="creditCardNumberWrapper"]')
.click('[data-test-id="creditCardNumber"]')
.keys(Brave.keys.END)
.keys('123')
.selectByValue('[data-test-id="expMonthSelect"]', (expMonth + 1).toString())
Expand Down Expand Up @@ -311,7 +311,7 @@ describe('Autofill', function () {
.click(addAddressButton)
.windowByUrl(Brave.browserWindowUrl)
.waitForVisible(autofillAddressPanel)
.click('[data-test-id="nameOnAddress"]')
.waitForElementFocus('[data-test-id="nameOnAddress"]')
.keys(name)
.click('[data-test-id="organization"]')
.keys(organization)
Expand Down Expand Up @@ -341,9 +341,9 @@ describe('Autofill', function () {
.click(addCreditCardButton)
.windowByUrl(Brave.browserWindowUrl)
.waitForVisible(autofillCreditCardPanel)
.click('[data-test-id="creditCardNameWrapper"]')
.waitForElementFocus('[data-test-id="creditCardName"]')
.keys(cardName)
.click('[data-test-id="creditCardNumberWrapper"]')
.click('[data-test-id="creditCardNumber"]')
.keys(cardNumber)
.selectByValue('[data-test-id="expMonthSelect"]', expMonth < 10 ? '0' + expMonth.toString() : expMonth.toString())
.selectByValue('[data-test-id="expYearSelect"]', expYear.toString())
Expand Down

0 comments on commit d1f502a

Please sign in to comment.