Skip to content

Commit

Permalink
testing with update hammerhead build
Browse files Browse the repository at this point in the history
  • Loading branch information
Bayheck committed May 7, 2024
1 parent 15c7572 commit 5d8f449
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"source-map-support": "^0.5.16",
"strip-bom": "^2.0.0",
"testcafe-browser-tools": "2.0.26",
"testcafe-hammerhead": "31.7.1",
"testcafe-hammerhead": "https://github.com/Bayheck/Builds/raw/main/testcafe-hammerhead-31.7.1.tgz",
"testcafe-legacy-api": "5.1.8",
"testcafe-reporter-json": "^2.1.0",
"testcafe-reporter-list": "^2.2.0",
Expand Down
25 changes: 6 additions & 19 deletions src/native-automation/client/event-descriptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,14 @@ export default class CDPEventDescriptor {
};
}

public static async createMouseEventOptions (type: string, eventOptions: any): Promise<any> {
const { x, y } = await calculateIFrameTopLeftPoint();
const { element, options } = eventOptions;
let multilineClientX;
let multilineClientY;

if (element) {
const clientRects = element.getClientRects();
const computedStyle = window.getComputedStyle(element);

if (clientRects && computedStyle.display === 'inline') {
multilineClientX = clientRects[0].x + clientRects[0].width / 2;
multilineClientY = clientRects[0].y + clientRects[0].height / 2;
}
}
public static async createMouseEventOptions (type: string, options: any): Promise<any> {
const { x, y } = await calculateIFrameTopLeftPoint();

return utils.extend({
x: (multilineClientX ?? options.clientX) + x,
y: (multilineClientY ?? options.clientY) + y,
modifiers: calculateKeyModifiersValue(options),
button: calculateMouseButtonValue(options),
x: options.options.clientX + x,
y: options.options.clientY + y,
modifiers: calculateKeyModifiersValue(options.options),
button: calculateMouseButtonValue(options.options),
type,
}, MOUSE_EVENT_OPTIONS);
}
Expand Down

0 comments on commit 5d8f449

Please sign in to comment.