test: fix flaky test (#2259)
This commit is contained in:
parent
abc39ef982
commit
098da30f2a
|
@ -1,7 +1,7 @@
|
||||||
import {
|
import {
|
||||||
getActiveElementTagName,
|
getActiveElementTagName,
|
||||||
getUrl,
|
getUrl,
|
||||||
searchButton, searchInput, searchNavButton
|
searchButton, searchInput, searchNavButton, sleep
|
||||||
} from '../utils'
|
} from '../utils'
|
||||||
import { loginAsFoobar } from '../roles'
|
import { loginAsFoobar } from '../roles'
|
||||||
import { Selector as $ } from 'testcafe'
|
import { Selector as $ } from 'testcafe'
|
||||||
|
@ -40,6 +40,8 @@ test('Pressing / without logging in just goes to the search page', async t => {
|
||||||
await t
|
await t
|
||||||
.expect(getUrl()).eql('http://localhost:4002/')
|
.expect(getUrl()).eql('http://localhost:4002/')
|
||||||
.expect($('.main-content h1').innerText).eql('Pinafore')
|
.expect($('.main-content h1').innerText).eql('Pinafore')
|
||||||
|
await sleep(500) // wait for keyboard shortcuts to be active
|
||||||
|
await t
|
||||||
.pressKey('/')
|
.pressKey('/')
|
||||||
.expect(getUrl()).contains('/search')
|
.expect(getUrl()).contains('/search')
|
||||||
.expect(getActiveElementTagName()).notMatch(/input/i)
|
.expect(getActiveElementTagName()).notMatch(/input/i)
|
||||||
|
|
Loading…
Reference in New Issue