Skip to content

Commit

Permalink
Merge branch 'master' into typetext-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bayheck authored Nov 25, 2024
2 parents 974ed2e + 817e3a4 commit b4b65d1
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 23 deletions.
38 changes: 19 additions & 19 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 @@ -144,7 +144,7 @@
"source-map-support": "^0.5.16",
"strip-bom": "^2.0.0",
"testcafe-browser-tools": "2.0.26",
"testcafe-hammerhead": "31.7.3",
"testcafe-hammerhead": "31.7.4",
"testcafe-legacy-api": "5.1.8",
"testcafe-reporter-json": "^2.1.0",
"testcafe-reporter-list": "^2.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ export function buildChromeArgs ({ config, cdpPort, platformArgs, tempProfileDir
const defaultArgs = [
'--disable-search-engine-choice-screen',
'--disable-component-extensions-with-background-pages',
'--allow-pre-commit-input',
'--disable-background-networking',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-default-apps',
'--disable-extensions',
'--disable-hang-monitor',
'--disable-infobars',
'--disable-ipc-flooding-protection',
'--disable-popup-blocking',
'--disable-prompt-on-repost',
'--disable-renderer-backgrounding',
'--disable-sync',
'--enable-automation',
'--export-tagged-pdf',
'--generate-pdf-document-outline',
'--force-color-profile=srgb',
'--metrics-recording-only',
'--no-first-run',
'--password-store=basic',
'--use-mock-keychain',
];

let chromeArgs = []
Expand Down
6 changes: 3 additions & 3 deletions src/client/automation/playback/drag/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class DragAutomationBase extends VisibleElementAutomation {
});
}

_mouseup () {
_mouseup (draggedElement) {
return cursor
.buttonUp()
.then(() => {
Expand Down Expand Up @@ -126,7 +126,7 @@ export default class DragAutomationBase extends VisibleElementAutomation {
})
.then(element => {
//B231323
if (topElement && element === topElement && !this.dragAndDropState.enabled)
if (topElement && element === topElement && !this.dragAndDropState.enabled && element === draggedElement)
eventSimulator.click(topElement, options);
});
});
Expand All @@ -152,6 +152,6 @@ export default class DragAutomationBase extends VisibleElementAutomation {
return Promise.all([delay(this.automationSettings.mouseActionStepDelay), this._mousedown(eventArgs)]);
})
.then(() => this._drag())
.then(() => this._mouseup());
.then(() => this._mouseup(eventArgs.element));
}
}
11 changes: 11 additions & 0 deletions test/functional/fixtures/regression/gh-8250/pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>gh-8250</title>
</head>
<body>
<h1>Example</h1>
<input id="example" type="radio" />
</body>
</html>
5 changes: 5 additions & 0 deletions test/functional/fixtures/regression/gh-8250/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('[Regression](GH-8250)', function () {
it('Click should not be called after dragToElement', function () {
return runTests('testcafe-fixtures/index.js', 'Click should not be called', { only: 'chrome' });
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Selector } from 'testcafe';

fixture('GH-8250- Click should not be called after dragToElement')
.page`http://localhost:3000/fixtures/regression/gh-8250/pages/index.html`;

test('Click should not be called', async t => {
const h1Label = Selector('h1').withText('Example');
const radioInput = Selector('#example');

await t.dragToElement(h1Label, radioInput);
await t.expect(radioInput.checked).eql(false);
});

0 comments on commit b4b65d1

Please sign in to comment.