Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'numericFieldValidator') #7758

Closed
rawat9 opened this issue May 31, 2023 · 9 comments
Closed
Assignees
Labels
FREQUENCY: level 1 Good first issue SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug).

Comments

@rawat9
Copy link

rawat9 commented May 31, 2023

What is your Scenario?

The error on the browser console when form dialog is opened, however the test passes.

Project dependencies:

  • Angular v15.2.9
  • ngx-formly v6.1.7
  • testcafe v2.6.0

Note: The issue didn't occur with ngx-formly v5.12.7. Only with versions > 6.x.x

What is the Current behavior?

The error on the browser console when form dialog is opened.

What is the Expected behavior?

There is no error on the browser console and the test still passes.

What is your public website URL? (or attach your complete example)

We created a test project for testcafe team to reproduce the bug.

Link: https://github.com/rawat9/test

What is your TestCafe test code?

// e2e/tests/general.e2e-spec.ts
...
const numberField = Selector('mat-label').withText('Test number').parent().child('formly-field-mat-input').child('input');
await t.click(button);
await t.typeText(numberField, '3')
...

Your complete configuration file

module.exports = {
  browsers: 'chrome',
  clientScripts: [{ module: 'axe-core/axe.min.js' }],
  src: ['e2e/tests/*.e2e-spec.ts'],
  screenshots: {
    path: 'tmp/screenshots/',
    takeOnFails: true,
    pathPattern: '${DATE}_${TIME}_${TEST}_${QUARANTINE_ATTEMPT}.png',
  },
  concurrency: 1,
  selectorTimeout: 4000,
  quarantineMode: {
    successThreshold: 1,
    attemptLimit: 3,
  },
  compilerOptions: {
    typescript: {
      customCompilerModulePath: '../typescript',
    },
  },
};

Your complete test report

No response

Screenshots

image001

Steps to Reproduce

  1. Start the app locally (npm run start)
  2. In separate session, run the test (npm run test)
  3. Open the TestCafe browser console and see the error

TestCafe version

2.6.0

Node.js version

18.16.0

Command-line arguments

--config-file=e2e/.testcaferc.js

Browser name(s) and version(s)

Chrome 114.0.0.0

Platform(s) and version(s)

macOS Ventura 13

Other

No response

@rawat9 rawat9 added the TYPE: bug The described behavior is considered as wrong (bug). label May 31, 2023
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 31, 2023
@AlexKamaev
Copy link
Contributor

I did not manage to reproduce the issue. I tried to run your tests using the two different machines with the following configurations:

  • Windows 10, Chrome 114, node 18.16.0
  • Ventura 13, Chrome 114, , node 16.19.1

Please try updating the TestCafe version to the latest one. If this does not help, please modify your example so that we can reproduce the issue on our side.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 1, 2023
@AlexKamaev AlexKamaev added the STATE: Need clarification An issue lacks information for further research. label Jun 1, 2023
@rawat9
Copy link
Author

rawat9 commented Jun 1, 2023

Sorry to hear that. I believe it could've been the speed of the test. I've updated testcafe to latest version ie. 2.6.1 and also added t.debug() at the point of test failure making it easier to see the error.

I tried running the tests using following configurations:

  • Ventura 13, Chrome 114, node 16.18.0
  • Ventura 13, Chrome 114, node 18.12.1
  • Ventura 13, Chrome 114, node 18.16.0

As a result, I was able to see the error in the browser console.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 1, 2023
@github-actions github-actions bot removed the STATE: Need clarification An issue lacks information for further research. label Jun 1, 2023
@AlexKamaev
Copy link
Contributor

I managed to reproduce the issue. Thank you for sharing the example. As a workaround, I recommend using the Native Automation mode. Please refer to the following help topic: https://testcafe.io/documentation/404237/guides/intermediate-guides/native-automation-mode

@need-response-app need-response-app bot added STATE: Need response An issue that requires a response or attention from the team. and removed STATE: Need response An issue that requires a response or attention from the team. labels Jun 2, 2023
@AlexKamaev AlexKamaev transferred this issue from DevExpress/testcafe-hammerhead Jun 2, 2023
@AlexKamaev AlexKamaev added FREQUENCY: level 1 STATE: possibly fixed in native automation and removed STATE: Need response An issue that requires a response or attention from the team. labels Jun 2, 2023
@rawat9
Copy link
Author

rawat9 commented Jun 2, 2023

Thanks for your reply. I tried adding nativeAutomation: true in testcafe config as you recommended. It works fine for the example "test" repository however it doesn't work for our main repository.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 2, 2023
@AlexKamaev
Copy link
Contributor

@rawat9
Thank you for sharing this information. The Native Automation mode is one of our prior tasks right now. We would really appreciate it if you share a simple project containing your main repository (if it's possible). We will check it in Native Automation mode.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 5, 2023
@rawat9
Copy link
Author

rawat9 commented Jun 9, 2023

Thanks for your reply. Unfortunately it won't be possible to share our project. We will consider looking into your suggestion i.e with nativeAutomation in-depth.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 9, 2023
@AlexKamaev AlexKamaev removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 12, 2023
@rawat9
Copy link
Author

rawat9 commented Jun 14, 2023

@AlexKamaev
With TestCafe v2.6.2, the error didn't occur with Native Automation mode enabled and the test passes. However, it has introduced a few other failing tests. These tests open new browser tab and from referring to the docs, I think Native Automation doesn't yet support multiple windows/tabs. This issue is already raised I think - #7661. Is TestCafe team already working on this?

Is there a workaround for this too temporarily until fixed?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 14, 2023
@AlexKamaev AlexKamaev self-assigned this Jun 15, 2023
@AlexKamaev
Copy link
Contributor

Hi @rawat9,

We are actively working on the Native Automation mode. However, as you mentioned, this mode does not support testing in multiple windows yet. At present, we cannot give you any precise estimates on when this will be implemented in Native Automation.

I recommend that separate your TestCafe tasks into two:

  • use Native Automation for general purposes, including this issue
  • do not use Native Automation for specific tests that use multiple windows

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 15, 2023
@AlexKamaev
Copy link
Contributor

fixed in #7758

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FREQUENCY: level 1 Good first issue SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

5 participants