Manually calculate scroll offset in test

This commit is contained in:
Yuya Ochiai
2018-05-23 00:55:09 +09:00
parent fd801b0f25
commit 11b5bc16c2

View File

@@ -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);
});