pinafore/tests/spec/008-status-media.js
Nolan Lawson efdb0bc534
Remove testcafe roles and run in parallel x4 (#334)
* more attempts to fix test flakiness

* remove testcafe roles entirely

* really remove testcafe roles

* run testcafe in parallel x2

* run testcafe in parallel x4

* fix online/offline forcing in tests

* fix pin test
2018-05-26 13:51:41 -07:00

35 lines
1.4 KiB
JavaScript

import { closeDialogButton, getNthStatus, modalDialogContents, scrollToStatus } from '../utils'
import { loginAsFoobar } from '../roles'
fixture`008-status-media.js`
.page`http://localhost:4002`
test('shows sensitive images and videos', async t => {
await loginAsFoobar(t)
await scrollToStatus(t, 7)
await t.expect(getNthStatus(7).find('.status-media img').exists).notOk()
.click(getNthStatus(7).find('.status-sensitive-media-button'))
.expect(getNthStatus(7).find('.status-media img').getAttribute('alt')).eql('kitten')
.expect(getNthStatus(7).find('.status-media img').hasAttribute('src')).ok()
.hover(getNthStatus(8))
.expect(getNthStatus(8).find('.status-media .play-video-button').exists).notOk()
.click(getNthStatus(8).find('.status-sensitive-media-button'))
.expect(getNthStatus(8).find('.status-media .play-video-button').exists).ok()
})
test('click and close image and video modals', async t => {
await loginAsFoobar(t)
await scrollToStatus(t, 9)
await t.expect(modalDialogContents.exists).notOk()
.click(getNthStatus(9).find('.play-video-button'))
.expect(modalDialogContents.exists).ok()
.click(closeDialogButton)
.expect(modalDialogContents.exists).notOk()
.hover(getNthStatus(11))
.hover(getNthStatus(12))
.click(getNthStatus(12).find('.show-image-button'))
.expect(modalDialogContents.exists).ok()
.click(closeDialogButton)
.expect(modalDialogContents.exists).notOk()
})