From 11b5bc16c2898620b44cb7ef5ab7e837b33efc4b Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Wed, 23 May 2018 00:55:09 +0900 Subject: [PATCH] Manually calculate scroll offset in test --- test/specs/browser/settings_test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/specs/browser/settings_test.js b/test/specs/browser/settings_test.js index 70e360f1..e9c5565a 100644 --- a/test/specs/browser/settings_test.js +++ b/test/specs/browser/settings_test.js @@ -275,7 +275,14 @@ describe('browser/settings.html', function desc() { const selected = await this.app.client.isSelected('#inputSpellChecker'); selected.should.equal(true); - await this.app.client.click('#inputSpellChecker').pause(700); + const windowBounds = await this.app.browserWindow.getBounds(); + const inputLocation = await this.app.client.getLocation('#inputSpellChecker'); + const offset = (inputLocation.y - windowBounds.height) + 100; + + await this.app.client. + scroll(0, offset). + click('#inputSpellChecker'). + pause(5000); const config1 = JSON.parse(fs.readFileSync(env.configFilePath, 'utf-8')); config1.useSpellChecker.should.equal(false); });