VulpesOS/gaia/tests/jsmarionette/client/marionette-client/test/integration/actions-test.js
OverSu b38dea0597 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.
2026-09-30 23:13:03 +02:00

71 lines
1.8 KiB
JavaScript
Executable file

/* global DeviceInteraction, exampleCmds, helper */
'use strict';
require('../helper');
suite('scope', function() {
var client = marionette.client(),
Actions,
device,
subject;
helper.require('actions', function(obj) {
Actions = obj;
});
device = new DeviceInteraction(exampleCmds, function() {
return subject;
});
suite('actions', function() {
setup(function() {
subject = new Actions(client);
});
test('can move the page', function() {
var bodyElement;
client.goUrl('http://yahoo.com');
client.waitFor(function() {
client.findElement('body', function(error, element) {
if (error) {
console.log('cannot find');
return;
}
bodyElement = element;
});
if (bodyElement !== undefined) {
return true;
}
});
subject.
press(bodyElement, 100, 100).
moveByOffset(0, 10).
perform();
// TODO: Bug 965385 - Use `Actions#wait` in integration tests
// Model this pause with an invocation of `Actions#wait` once "Bug 962645
// - Action chains only handle one press->release chain" is resolved.
client.executeAsyncScript(function() {
setTimeout(marionetteScriptFinished, 50);
});
subject.
release().
perform();
// TODO: Bug 965385 - Use `Actions#wait` in integration tests
// Model this pause with an invocation of `Actions#wait` once "Bug 962645
// - Action chains only handle one press->release chain" is resolved.
client.executeAsyncScript(function() {
setTimeout(marionetteScriptFinished, 50);
});
subject.
flick(bodyElement, 0, 0, 0, 200).
perform();
});
});
});