Skip to content

Commit

Permalink
Updating Comment for Info
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit3200 committed Oct 25, 2023
1 parent 6c9f693 commit 91011fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/webdriver-utils/src/providers/genericProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ export default class GenericProvider {
const rect = await this.driver.rect(elementId);
const location = { x: rect.x, y: rect.y };
const size = { height: rect.height, width: rect.width };
// Update YFactor Element is not visible in viewport
// In case of iOS if the element is not visible in viewport it gives 0,0 as coordinate.
// Update pageShiftFactor Element is not visible in viewport
// In case of iOS if the element is not visible in viewport it gives 0 for x-y coordinate.
// In case of iOS if the element is partially visible it gives negative x-y coordinate.
// Subtracting ScrollY/ScrollX ensures if the element is visible in viewport or not.
await this.updatePageShiftFactor(location);
const coOrdinates = {
top: Math.floor(location.y * scaleFactor) + this.pageYShiftFactor,
Expand Down

0 comments on commit 91011fb

Please sign in to comment.