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.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
85
gaia/apps/settings/test/marionette/app/regions/display.js
Executable file
85
gaia/apps/settings/test/marionette/app/regions/display.js
Executable file
|
|
@ -0,0 +1,85 @@
|
|||
'use strict';
|
||||
var Base = require('../base');
|
||||
|
||||
/**
|
||||
* Abstraction around settings display panel
|
||||
* @constructor
|
||||
* @param {Marionette.Client} client for operations.
|
||||
*/
|
||||
function DisplayPanel(client) {
|
||||
|
||||
// Call the Base constructor to initiate base class.
|
||||
Base.call(this, client, null, DisplayPanel.Selectors);
|
||||
|
||||
}
|
||||
|
||||
module.exports = DisplayPanel;
|
||||
|
||||
DisplayPanel.Selectors = {
|
||||
'lockOrientationCheckbox':
|
||||
'#display gaia-switch[name="screen.orientation.lock"]',
|
||||
'autoBrightnessItem': '.brightness-auto',
|
||||
'autoBrightnessCheckbox':
|
||||
'#display gaia-checkbox[name="screen.automatic-brightness"]',
|
||||
'manualBrightnessItem': '.brightness-manual',
|
||||
'screenTimeoutSelectorItem': '#screen-timeout',
|
||||
'screenTimeoutSelector': '#screen-timeout select'
|
||||
};
|
||||
|
||||
DisplayPanel.prototype = {
|
||||
|
||||
__proto__: Base.prototype,
|
||||
|
||||
get isLockOrientationChecked() {
|
||||
// Marionette has trouble returning custom properties on shadow roots.
|
||||
// For now query the shadowRoot for checked status.
|
||||
return this.findElement('lockOrientationCheckbox')
|
||||
.scriptWith(function(el) {
|
||||
return el.shadowRoot.querySelector('input[type="checkbox"]').checked;
|
||||
});
|
||||
},
|
||||
|
||||
get isAutoBrightnessChecked() {
|
||||
return !!this.findElement('autoBrightnessCheckbox')
|
||||
.scriptWith(function(el) {
|
||||
return el.wrappedJSObject.checked;
|
||||
});
|
||||
},
|
||||
|
||||
get isAutoBrightnessItemVisible() {
|
||||
return this.findElement('autoBrightnessItem').displayed();
|
||||
},
|
||||
|
||||
get isBrightnessManualItemVisible() {
|
||||
return this.findElement('manualBrightnessItem').displayed();
|
||||
},
|
||||
|
||||
get autoBrightnessSetting() {
|
||||
return this.client.settings.get('screen.automatic-brightness');
|
||||
},
|
||||
|
||||
get screenOrientationSetting() {
|
||||
return this.client.settings.get('screen.orientation.lock');
|
||||
},
|
||||
|
||||
get screenTimeoutSetting() {
|
||||
return this.client.settings.get('screen.timeout');
|
||||
},
|
||||
|
||||
tapLockOrientationCheckbox: function() {
|
||||
this.waitForElement('lockOrientationCheckbox').tap();
|
||||
},
|
||||
|
||||
tapAutoBrightnessCheckbox: function() {
|
||||
this.waitForElement('autoBrightnessCheckbox').tap();
|
||||
},
|
||||
|
||||
tapScreenTimeoutSelector: function() {
|
||||
this.waitForElement('screenTimeoutSelectorItem').tap();
|
||||
},
|
||||
|
||||
tapScreenTimeoutSelectOption: function(optionText) {
|
||||
this.tapSelectOption('screenTimeoutSelector', optionText);
|
||||
}
|
||||
|
||||
};
|
||||
Loading…
Reference in a new issue