KawAnime/test/app/feed.spec.js

36 lines
1.3 KiB
JavaScript
Raw Normal View History

module.exports = function () {
describe('Release page', function () {
it('should be loading at first', function () {
return this.app.client
.isVisible('.loader-container').should.eventually.be.true
})
it('should have some entries', function () {
return this.app.client
.saveScreenshot('test/screenshots/feed_loader.png')
2019-07-08 21:21:02 +00:00
.waitUntil(async () => (await this.app.client.isVisible('.loader-container')) === false, 30000)
.pause(500)
.isVisible('.container > .pag-container').should.eventually.be.true
.$$('div > .container > .layout > div').should.eventually.have.length(13)
.getText('.time').should.eventually.equal('Updated a few seconds ago')
})
it('should show buttons on card hover', function () {
for (let i = 2; i < 14; ++i) {
this.app.client
.moveToObject(`div > .container > .layout > div:nth-child(${i})`)
.pause(500)
.$(`div > .container > .layout > div:nth-child(${i}) > div > div`).getText()
.should.eventually.include('play_arrow')
.and.include('file_download')
.and.include('cloud_download')
.and.include('more_horiz')
}
})
it('should take a final screenshot', function () {
return this.app.client.saveScreenshot('test/screenshots/feed.png')
})
})
}