Testcafe: touchstart event does not contain proper values in changedTouches property on android devices

Created on 13 Sep 2018  路  11Comments  路  Source: DevExpress/testcafe

Are you requesting a feature or reporting a bug?

bug

What is the current behavior?

It is not adding touches into event.changedTouches array. it is always empty

What is the expected behavior?

Should contain touches in event.changedTouches array as i does in non-testcafe environment

How would you reproduce the current behavior (if this is a bug)?

call t.click method on element with onTouchStart handler and check the changedTouches property

Provide the test code and the tested page URL (if applicable)

Tested page URL:

it is an Angular code to simplify the example:

Test code

```TS:

onTouchStart(e:TouchEvent) {
this.xyz = e.changedTouches.length; //In real application it is 1, in testcafe it is 0
}


```HTML:
<button id="test" (touchstart)="onTouchStart($event)">test</button>
{{xyz}}

Specify your

  • operating system: Android (Chrome)
  • testcafe version: 0.22.0
  • node.js version: 8.9.4
client Auto-locked automations bug

Most helpful comment

The issue occurs in a core testcafe-hammerhead module. It is fixed, but it will be available after a new version of testcafe-hammerhead is published and used in testcafe. If you want to test the fix, you can pull the latest testcafe-hammerhead branch and add it to your project manually.

All 11 comments

Hi @Bamyan, sorry for the delayed response! The changedTouches property must be emulated on Android devices, we have a unit test for it: testcafe-hammerhead/test/client/fixtures/sandbox/event/event-simulator-test.js. Could you please provide an example page where the problem can be reproduced?

I will close the issue because no activity has been encountered for a long time.
Feel free to reopen the issue if the problem persists and you can provide an example to reproduce it.

Hi. @miherlosev @AndreyBelym , Sorry for the Late Reply, you can see the problem with the following test on example page.

fixture `click on checkbox`
    .page(`https://v6.material.angular.io/components/checkbox/overview`);

test('Should click on checkbox', async () => {
    await t.click(Selector('mat-checkbox'));
});

ERROR:
Uncaught TypeError: Cannot read property 'clientX' of undefined

I've tried to reproduce the problem with [email protected] and TestCafe works fine.
Try to run tests with the latest TestCafe version ([email protected]).
If the problem persists, please specify the Google Chrome version in which you run your tests.

image

Hi, @miherlosev As it is mentioned on issue, the problem is just for Android devices and works well on Windows. and also i have tried to run the test with the latest TestCafe version [email protected] on Android, but it is display the same error as before.
bug

Thank for your detailed report. I've reproduced the problem using TestCafe's device emulation.

testcafe "chrome:emulation:device=iphone x" test.js

It can be reproduced with our Drag functional tests & Chrome 70. The latest Chrome version on BrowserStack is 68, that's why we haven't discovered this before.

Hi, any updates on this? @AndreyBelym

The issue occurs in a core testcafe-hammerhead module. It is fixed, but it will be available after a new version of testcafe-hammerhead is published and used in testcafe. If you want to test the fix, you can pull the latest testcafe-hammerhead branch and add it to your project manually.

Fixed in the [email protected].

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xalvarez picture xalvarez  路  3Comments

madroneropaulo picture madroneropaulo  路  3Comments

calisven picture calisven  路  3Comments

Turkirafaa picture Turkirafaa  路  3Comments

KaneMorgan picture KaneMorgan  路  3Comments