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
43
gaia/apps/system/test/marionette/lib/confirm_dialog.js
Executable file
43
gaia/apps/system/test/marionette/lib/confirm_dialog.js
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* A helper module to interact with the confirm dialog in system app.
|
||||
*/
|
||||
|
||||
function ConfirmDialog(client) {
|
||||
this.client = client.scope({ searchTimeout: 20000 });
|
||||
}
|
||||
|
||||
module.exports = ConfirmDialog;
|
||||
|
||||
ConfirmDialog.prototype = {
|
||||
/**
|
||||
Fetch a particular type of a gaia-confirm dialog.
|
||||
|
||||
@param {String} type of dialog.
|
||||
*/
|
||||
getElement: function(type) {
|
||||
var selector = this.getDialogSelector(type);
|
||||
return this.client.helper.waitForElement(selector);
|
||||
},
|
||||
|
||||
getDialogSelector: function(type) {
|
||||
return 'gaia-confirm[data-type="' + type + '"]';
|
||||
},
|
||||
|
||||
/**
|
||||
Click confirm on a particular type of confirmation dialog.
|
||||
|
||||
@param {String} type of dialog.
|
||||
@param {String} selector of the button. Defaults to .confirm.
|
||||
*/
|
||||
confirm: function(type, button) {
|
||||
var dialogSelector = this.getDialogSelector(type);
|
||||
var confirmSelector = dialogSelector + ' .confirm';
|
||||
var confirmButton = this.client.helper.waitForElement(confirmSelector);
|
||||
this.client.waitFor(function() {
|
||||
return confirmButton.displayed();
|
||||
});
|
||||
confirmButton.click();
|
||||
}
|
||||
};
|
||||
Loading…
Reference in a new issue