Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
47 lines
1 KiB
JavaScript
Executable file
47 lines
1 KiB
JavaScript
Executable file
'use strict';
|
|
var Base = require('../base');
|
|
|
|
/**
|
|
* Abstraction around settings bluetooth panel
|
|
* @constructor
|
|
* @param {Marionette.Client} client for operations.
|
|
*/
|
|
function BluetoothPanel(client) {
|
|
|
|
// Call the Base constructor to initiate base class.
|
|
Base.call(this, client, null, BluetoothPanel.Selectors);
|
|
|
|
}
|
|
|
|
module.exports = BluetoothPanel;
|
|
|
|
BluetoothPanel.Selectors = {
|
|
'bluetoothEnabledCheckbox': '.bluetooth-status gaia-switch'
|
|
};
|
|
|
|
BluetoothPanel.prototype = {
|
|
|
|
__proto__: Base.prototype,
|
|
|
|
get isBluetoothEnabled() {
|
|
return this.findElement('bluetoothEnabledCheckbox')
|
|
.scriptWith(function(el) {
|
|
return el.wrappedJSObject.checked;
|
|
});
|
|
},
|
|
|
|
enableBluetooth: function() {
|
|
this.waitForElement('bluetoothEnabledCheckbox').tap();
|
|
this.client.waitFor(function() {
|
|
return this.isBluetoothEnabled;
|
|
}.bind(this));
|
|
},
|
|
|
|
disableBluetooth: function() {
|
|
this.waitForElement('bluetoothEnabledCheckbox').tap();
|
|
this.client.waitFor(function() {
|
|
return !this.isBluetoothEnabled;
|
|
}.bind(this));
|
|
}
|
|
|
|
};
|