test: improve flakiness of report ui test (#1117)

This commit is contained in:
Nolan Lawson 2019-03-23 18:16:20 -07:00 committed by GitHub
parent 059b455451
commit 5a9d047019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import { import {
accountProfileMoreOptionsButton, accountProfileMoreOptionsButton,
confirmationDialogCancelButton, confirmationDialogCancelButton, getNthStatus,
getNthStatusOptionsButton, getNthStatusOptionsButton,
modalDialog modalDialog
} from '../utils' } from '../utils'
@ -13,10 +13,13 @@ fixture`028-report-ui.js`
test('Can open a report UI from a status', async t => { test('Can open a report UI from a status', async t => {
await loginAsFoobar(t) await loginAsFoobar(t)
await t await t
.hover(getNthStatus(1))
.click(getNthStatusOptionsButton(1)) .click(getNthStatusOptionsButton(1))
.click($('.modal-dialog button').withText('Report')) .click($('.modal-dialog button').withText('Report'))
.expect(modalDialog.innerText).contains('You are reporting @quux') .expect(modalDialog.innerText).contains('You are reporting @quux')
.expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2') .expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2', {
timeout: 30000
})
.click(confirmationDialogCancelButton) .click(confirmationDialogCancelButton)
.expect(modalDialog.exists).notOk() .expect(modalDialog.exists).notOk()
}) })
@ -28,7 +31,9 @@ test('Can open a report UI from an account', async t => {
.click(accountProfileMoreOptionsButton) .click(accountProfileMoreOptionsButton)
.click($('.modal-dialog button').withText('Report')) .click($('.modal-dialog button').withText('Report'))
.expect(modalDialog.innerText).contains('You are reporting @quux') .expect(modalDialog.innerText).contains('You are reporting @quux')
.expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2') .expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2', {
timeout: 30000
})
.click(confirmationDialogCancelButton) .click(confirmationDialogCancelButton)
.expect(modalDialog.exists).notOk() .expect(modalDialog.exists).notOk()
}) })