VulpesOS/gaia/apps/keyboard/test/marionette/lib/keyboard_settings.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

50 lines
1.1 KiB
JavaScript
Executable file

'use strict';
var Base = require('./base.js');
function KeyboardSettings(client) {
this.client = client.scope({ searchTimeout: 500 });
Base.call(this, client, KeyboardSettings.ORIGIN);
}
module.exports = KeyboardSettings;
KeyboardSettings.ORIGIN = 'app://keyboard.gaiamobile.org';
KeyboardSettings.Selectors = Object.freeze({
autoCorrectCheckBox: '#cb-autoCorrect'
});
KeyboardSettings.prototype = {
__proto__: Base.prototype,
get autoCorrectCheckBox() {
return this.client.findElement(
KeyboardSettings.Selectors.autoCorrectCheckBox);
},
get autoCorrect() {
return this.autoCorrectCheckBox.scriptWith(function(ele) {
return ele.wrappedJSObject.checked;
});
},
clickAutoCorrectOption: function() {
var currentSwitch = this.client.settings.get('keyboard.autocorrect');
this.autoCorrectCheckBox.click();
this.client.waitFor(() => {
return (this.autoCorrect !== currentSwitch);
});
},
waitForReady: function() {
this.client.waitFor(() => {
return this.autoCorrectCheckBox.displayed();
});
}
};