Skip to content

Commit

Permalink
Merge pull request #354 from appium/isaac-scroll-web
Browse files Browse the repository at this point in the history
Make sure scroll/swipe works in web context
  • Loading branch information
imurchie authored Jan 27, 2017
2 parents d728cf3 + 0fcd48f commit 065d28f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/commands/gesture.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ helpers.handlePinchOrZoom = async function (actions) {

helpers.mobileScroll = async function (opts={}, swipe=false) {
if (!opts.element) {
opts.element = await this.findElement(`class name`, `XCUIElementTypeApplication`);
opts.element = await this.findNativeElementOrElements(`class name`, `XCUIElementTypeApplication`, false);
}
// WDA supports four scrolling strategies: predication based on name, direction,
// predicateString, and toVisible, in that order. Swiping requires direction.
Expand Down
6 changes: 6 additions & 0 deletions test/functional/web/safari-execute-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ describe('safari - execute', function () {
await deleteSession();
});

describe('mobile: x methods', function () {
it('should run in native context', async () => {
await driver.execute('mobile: scroll', {direction: 'down'}).should.not.be.rejected;
});
});

describe('synchronous', function () {
it('should bubble up javascript errors', async () => {
await driver.execute(`'nan'--`).should.eventually.be.rejected;
Expand Down

0 comments on commit 065d28f

Please sign in to comment.