From 25e53e269d5c44c82b329dbb1e2489c2c96375b7 Mon Sep 17 00:00:00 2001 From: Kylart Date: Wed, 3 Jul 2019 17:39:38 +0200 Subject: [PATCH] Split downloader modal into its own describe --- test/electron.spec.js | 52 ++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/test/electron.spec.js b/test/electron.spec.js index be73468..a2eb34f 100644 --- a/test/electron.spec.js +++ b/test/electron.spec.js @@ -26,26 +26,38 @@ describe('Launch app', function () { return this.app.stop() }) - it('should open the download modal', async function () { - return this.app.client - .$('#downloader-btn').click() - .pause(500) - .getText('.button-container .button').should.eventually.equal('DOWNLOAD') - .isExisting('.input-container').should.eventually.be.true - .isExisting('.quality-container').should.eventually.be.true - .isExisting('.left').should.eventually.be.true - .isExisting('.right').should.eventually.be.true - .$('.input-container:nth-child(1) input').addValue('Sakura Trick') - .keys([ 'Tab' ]) - .$('.input-container:nth-child(2) input').hasFocus().should.eventually.be.true - .$('.input-container:nth-child(2) input').addValue('4') - .keys([ 'Tab' ]) - .$('.input-container:nth-child(3) input').hasFocus().should.eventually.be.true - .$('.input-container:nth-child(3) input').addValue('8') - .keys([ 'Tab', 'ArrowRight', 'ArrowLeft', 'ArrowLeft', 'ArrowRight', 'ArrowRight' ]) // Should select 1080p quality - .$('.quality-container div[role="radiogroup"] div:nth-child(4) input').hasFocus().should.eventually.be.true - .keys([ 'Tab', 'Enter' ]) - .waitUntil(() => this.app.client.$('#magnet-modal').isVisible()) + describe('Downloader modal', function () { + it('should open the downloader modal', function () { + return this.app.client + .$('#downloader-btn').click() + .pause(500) + .getText('.button-container .button').should.eventually.equal('DOWNLOAD') + .isExisting('.input-container').should.eventually.be.true + .isExisting('.quality-container').should.eventually.be.true + .isExisting('.left').should.eventually.be.true + .isExisting('.right').should.eventually.be.true + }) + + it('should fill in the form and start a download', function () { + return this.app.client + .$('.input-container:nth-child(1) input').addValue('Sakura Trick') + .keys([ 'Tab' ]) + .$('.input-container:nth-child(2) input').hasFocus().should.eventually.be.true + .$('.input-container:nth-child(2) input').addValue('4') + .keys([ 'Tab' ]) + .$('.input-container:nth-child(3) input').hasFocus().should.eventually.be.true + .$('.input-container:nth-child(3) input').addValue('8') + .keys([ 'Tab', 'ArrowRight', 'ArrowLeft', 'ArrowLeft', 'ArrowRight', 'ArrowRight' ]) // Should select 1080p quality + .$('.quality-container div[role="radiogroup"] div:nth-child(4) input').hasFocus().should.eventually.be.true + .keys([ 'Tab', 'Enter' ]) + .waitUntil(() => this.app.client.$('#magnet-modal').isVisible()) + .pause(500) + }) + + // TODO: Check that the magnets and everything is as expected + // it('should open the magnet modal with the correct magnets', function () { + // return this.app.client + // }) }) it('should be visible', async function () {