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
72
gaia/apps/sms/test/marionette/lib/views/shared/composer_accessors.js
Executable file
72
gaia/apps/sms/test/marionette/lib/views/shared/composer_accessors.js
Executable file
|
|
@ -0,0 +1,72 @@
|
|||
'use strict';
|
||||
|
||||
/* global module */
|
||||
|
||||
var SELECTORS = Object.freeze({
|
||||
messageInput: '#messages-input',
|
||||
subjectInput: '.subject-composer-input',
|
||||
sendButton: '#messages-send-button',
|
||||
attachButton: '#messages-attach-button',
|
||||
charCounter: '.message-counter',
|
||||
mmsLabel: '.mms-label',
|
||||
attachment: '#messages-input .attachment-container'
|
||||
});
|
||||
|
||||
function ComposerAccessor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
ComposerAccessor.prototype = {
|
||||
get messageInput() {
|
||||
return this.client.helper.waitForElement(SELECTORS.messageInput);
|
||||
},
|
||||
|
||||
get subjectInput() {
|
||||
return this.client.findElement(SELECTORS.subjectInput);
|
||||
},
|
||||
|
||||
get sendButton() {
|
||||
return this.client.helper.waitForElement(SELECTORS.sendButton);
|
||||
},
|
||||
|
||||
get attachButton() {
|
||||
return this.client.helper.waitForElement(SELECTORS.attachButton);
|
||||
},
|
||||
|
||||
get charCounter() {
|
||||
return this.client.findElement(SELECTORS.charCounter);
|
||||
},
|
||||
|
||||
get mmsLabel() {
|
||||
return this.client.findElement(SELECTORS.mmsLabel);
|
||||
},
|
||||
|
||||
get attachments() {
|
||||
return this.client.findElements(SELECTORS.attachment);
|
||||
},
|
||||
|
||||
addAttachment: function() {
|
||||
this.client.waitFor(function() {
|
||||
return this.attachButton.enabled();
|
||||
}.bind(this));
|
||||
|
||||
this.attachButton.tap();
|
||||
|
||||
var ActivityChooserView = require('../activity-chooser/view');
|
||||
return new ActivityChooserView(this.client);
|
||||
},
|
||||
|
||||
takeAttachmentScreenshot(index) {
|
||||
return this.client.screenshot({ element: this.attachments[index] });
|
||||
},
|
||||
|
||||
send: function() {
|
||||
this.client.waitFor(function() {
|
||||
return this.sendButton.enabled();
|
||||
}.bind(this));
|
||||
|
||||
this.sendButton.tap();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = ComposerAccessor;
|
||||
57
gaia/apps/sms/test/marionette/lib/views/shared/menu_accessors.js
Executable file
57
gaia/apps/sms/test/marionette/lib/views/shared/menu_accessors.js
Executable file
|
|
@ -0,0 +1,57 @@
|
|||
'use strict';
|
||||
|
||||
/* global module */
|
||||
|
||||
var SELECTORS = Object.freeze({
|
||||
optionMenu: 'body > form[data-type=action] menu',
|
||||
systemMenu: 'form[data-z-index-level="action-menu"]',
|
||||
contactPromptMenu: '.contact-prompt menu'
|
||||
});
|
||||
|
||||
function MenuAccessor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
MenuAccessor.prototype = {
|
||||
get systemMenu() {
|
||||
// Switch to the system app first.
|
||||
this.client.switchToFrame();
|
||||
return this.client.helper.waitForElement(SELECTORS.systemMenu);
|
||||
},
|
||||
|
||||
get optionMenu() {
|
||||
return this.client.helper.waitForElement(SELECTORS.optionMenu);
|
||||
},
|
||||
|
||||
get contactPromptMenu() {
|
||||
return this.client.helper.waitForElement(SELECTORS.contactPromptMenu);
|
||||
},
|
||||
|
||||
selectAppMenuOption: function(text) {
|
||||
this.selectMenuOption(this.optionMenu, text);
|
||||
},
|
||||
|
||||
selectSystemMenuOption: function(text) {
|
||||
this.selectMenuOption(this.systemMenu, text);
|
||||
},
|
||||
|
||||
selectContactPromptMenuOption: function(text) {
|
||||
this.selectMenuOption(this.contactPromptMenu, text);
|
||||
},
|
||||
|
||||
selectMenuOption: function(menuElement, text) {
|
||||
var menuOptions = menuElement.findElements('button');
|
||||
for (var i = 0; i < menuOptions.length; i++) {
|
||||
var menuOption = menuOptions[i];
|
||||
if (menuOption.text().toLowerCase() === text.toLowerCase()) {
|
||||
// XXX: Workaround until http://bugzil.la/912873 is fixed.
|
||||
// Wait for 750ms to let the element be clickable
|
||||
this.client.helper.wait(750);
|
||||
menuOption.tap();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = MenuAccessor;
|
||||
26
gaia/apps/sms/test/marionette/lib/views/shared/tools.js
Executable file
26
gaia/apps/sms/test/marionette/lib/views/shared/tools.js
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
/* global module, require */
|
||||
'use strict';
|
||||
|
||||
var assert = require('chai').assert;
|
||||
|
||||
var ASSETS_DIR = './apps/sms/test/marionette/assets/';
|
||||
|
||||
module.exports = {
|
||||
assertElementFocused: function(element, message) {
|
||||
assert.isTrue(
|
||||
element.scriptWith(function(el) {
|
||||
return document.activeElement === el;
|
||||
}),
|
||||
message
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} assertName The file name, relative to the asset directory.
|
||||
* @returns {String} The file content in base64 form.
|
||||
*/
|
||||
loadAsset: function(assetName) {
|
||||
var fileName = ASSETS_DIR + assetName;
|
||||
return require('fs').readFileSync(fileName, { encoding: 'base64' });
|
||||
}
|
||||
};
|
||||
Loading…
Reference in a new issue