Skip to content

Commit

Permalink
fix: use some default param in scroll (#232)
Browse files Browse the repository at this point in the history
* fix: use some default param in scroll

* fix: update param description
  • Loading branch information
yuyutaotao authored Jan 2, 2025
1 parent 8d83deb commit 3c9418c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/web-integration/src/common/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ export class PageTaskExecutor {
await this.page.scrollUntilRight(startingPoint);
} else if (scrollToEventName === 'untilLeft') {
await this.page.scrollUntilLeft(startingPoint);
} else if (scrollToEventName === 'once') {
if (taskParam.direction === 'down') {
} else if (scrollToEventName === 'once' || !scrollToEventName) {
if (taskParam.direction === 'down' || !taskParam.direction) {
await this.page.scrollDown(
taskParam.distance || undefined,
startingPoint,
Expand Down
4 changes: 3 additions & 1 deletion packages/web-integration/src/common/ui-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export function paramStr(task: ExecutionTask) {
ExecutionTaskActionApply<PlanningActionParamScroll>
>
)?.param?.distance;
value = `${scrollDirection}, ${scrollType}, ${scrollDistance || 'distance-not-set'}`;
value = `${scrollDirection || 'down'}, ${scrollType || 'once'}, ${
scrollDistance || 'distance-not-set'
}`;
} else {
value =
(task as ExecutionTaskAction)?.param?.value ||
Expand Down

0 comments on commit 3c9418c

Please sign in to comment.