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
44
gaia/apps/sms/test/marionette/lib/views/dialog/accessors.js
Executable file
44
gaia/apps/sms/test/marionette/lib/views/dialog/accessors.js
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
'use strict';
|
||||
|
||||
/* global module */
|
||||
|
||||
var SELECTORS = Object.freeze({
|
||||
container: 'form[data-type=confirm][data-subtype=menu][role=dialog]',
|
||||
// The following rules should be scoped by the container.
|
||||
header: 'form h1',
|
||||
body: 'form p',
|
||||
button: 'form button'
|
||||
});
|
||||
|
||||
function DialogAccessor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
DialogAccessor.prototype = {
|
||||
get container() {
|
||||
return this.client.helper.waitForElement(SELECTORS.container);
|
||||
},
|
||||
|
||||
get buttons() {
|
||||
return this.container.findElements(SELECTORS.button);
|
||||
},
|
||||
|
||||
get header() {
|
||||
return this.container.findElement(SELECTORS.header);
|
||||
},
|
||||
|
||||
get body() {
|
||||
return this.container.findElement(SELECTORS.body);
|
||||
},
|
||||
|
||||
waitToAppear: function() {
|
||||
this.client.waitFor(function() {
|
||||
var body = this.client.findElement('body');
|
||||
|
||||
return this.container.getAttribute('class').indexOf('visible') >= 0 &&
|
||||
body.getAttribute('class').indexOf('dialog-animating') < 0;
|
||||
}.bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = DialogAccessor;
|
||||
35
gaia/apps/sms/test/marionette/lib/views/dialog/view.js
Executable file
35
gaia/apps/sms/test/marionette/lib/views/dialog/view.js
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
/* global module */
|
||||
|
||||
var DialogAccessor = require('./accessors');
|
||||
|
||||
function DialogView(client) {
|
||||
this.client = client;
|
||||
this.accessors = new DialogAccessor(client);
|
||||
|
||||
this.accessors.waitToAppear();
|
||||
}
|
||||
|
||||
DialogView.prototype = {
|
||||
get header() {
|
||||
return this.accessors.header.text();
|
||||
},
|
||||
|
||||
get body() {
|
||||
return this.accessors.body.text();
|
||||
},
|
||||
|
||||
chooseAction: function(actionName) {
|
||||
var actionButtons = this.accessors.buttons;
|
||||
for (var i = 0; i < actionButtons.length; i++) {
|
||||
var actionButton = actionButtons[i];
|
||||
if (actionButton.text().toLowerCase() === actionName.toLowerCase()) {
|
||||
actionButton.tap();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = DialogView;
|
||||
Loading…
Reference in a new issue