Skip to content

Commit 77acc55

Browse files
committed
fix: Accept also top/left offset as parameters for the scroll instruction
1 parent 2df4191 commit 77acc55

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Gruntfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ module.exports = function (grunt) {
205205
},
206206
{
207207
scroll: {
208-
selector: 'input',
209208
offset: {
210209
top: 0,
211210
left: 0

tasks/instructions/scroll.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ module.exports = {
1010
if (typeof scroll === 'string') {
1111
scroll = {selector: scroll}
1212
}
13-
const selector = scroll.selector
14-
if (selector) {
15-
grunt.verbose.writeln('Move cursor to "' + selector + '".')
16-
return client.scroll(selector)
13+
const offset = scroll.offset
14+
if (offset) {
15+
grunt.verbose.writeln('Move cursor to ' + JSON.stringify(offset) + '.')
16+
return client.scroll(offset.left, offset.top)
1717
}
18-
const offset = scroll.offset || {}
19-
grunt.verbose.writeln('Move cursor to ' + JSON.stringify(offset) + '.')
20-
return client.scroll(offset.left, offset.top)
18+
const selector = scroll.selector
19+
grunt.verbose.writeln('Move cursor to "' + selector + '".')
20+
return client.scroll(selector)
2121
}
2222
}

0 commit comments

Comments
 (0)