Skip to content

Commit

Permalink
Fix failing integration tests (#362)
Browse files Browse the repository at this point in the history
Fix failing integration tests
  • Loading branch information
NickColley committed Sep 19, 2019
2 parents 39c6176 + f0adce0 commit ad9b291
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions test/integration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const isIE = browserName === 'internet explorer'
// const isIE9 = isIE && version === '9'
// const isIE10 = isIE && version === '10'
// const isIE11 = isIE && version === '11.103'
const liveRegionWaitTimeMillis = 2000
const liveRegionWaitTimeMillis = 10000

const basicExample = () => {
describe('basic example', function () {
Expand Down Expand Up @@ -39,31 +39,35 @@ const basicExample = () => {
expect(browser.isVisible(menu)).to.equal(true)
})

it('should announce status changes using two alternately updated aria live regions', () => {
const flip = browser.$('div#ariaLiveA')
const flop = browser.$('div#ariaLiveB')
// These tests are flakey when run through Saucelabs so we only run them
// in Chrome
if (isChrome) {
it('should announce status changes using two alternately updated aria live regions', () => {
const flip = browser.$('div#ariaLiveA')
const flop = browser.$('div#ariaLiveB')

browser.click(input)
browser.setValue(input, 'a')
expect(flip.getText()).to.equal('')
expect(flop.getText()).to.equal('')
browser.waitUntil(() => { return flip.getText() !== '' },
liveRegionWaitTimeMillis,
'expected the first aria live region to be populated within ' + liveRegionWaitTimeMillis + ' milliseconds'
)
browser.addValue(input, 's')
browser.waitUntil(() => { return (flip.getText() === '' && flop.getText() !== '') },
liveRegionWaitTimeMillis,
'expected the first aria live region to be cleared, and the second to be populated within ' +
liveRegionWaitTimeMillis + ' milliseconds'
)
browser.addValue(input, 'h')
browser.waitUntil(() => { return (flip.getText() !== '' && flop.getText() === '') },
liveRegionWaitTimeMillis,
'expected the first aria live region to be populated, and the second to be cleared within ' +
liveRegionWaitTimeMillis + ' milliseconds'
)
})
browser.click(input)
browser.setValue(input, 'a')
expect(flip.getText()).to.equal('')
expect(flop.getText()).to.equal('')
browser.waitUntil(() => { return flip.getText() !== '' },
liveRegionWaitTimeMillis,
'expected the first aria live region to be populated within ' + liveRegionWaitTimeMillis + ' milliseconds'
)
browser.addValue(input, 's')
browser.waitUntil(() => { return (flip.getText() === '' && flop.getText() !== '') },
liveRegionWaitTimeMillis,
'expected the first aria live region to be cleared, and the second to be populated within ' +
liveRegionWaitTimeMillis + ' milliseconds'
)
browser.addValue(input, 'h')
browser.waitUntil(() => { return (flip.getText() !== '' && flop.getText() === '') },
liveRegionWaitTimeMillis,
'expected the first aria live region to be populated, and the second to be cleared within ' +
liveRegionWaitTimeMillis + ' milliseconds'
)
})
}

describe('keyboard use', () => {
it('should allow typing', () => {
Expand Down

0 comments on commit ad9b291

Please sign in to comment.