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

Getting "Uncaught TypeError: Cannot define property hammerhead|processed-context, object is not extensible" error after upgrade to 0.17.2 version #1767

Closed
thecodejack opened this issue Sep 7, 2017 · 7 comments
Assignees
Labels
!IMPORTANT! STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@thecodejack
Copy link

thecodejack commented Sep 7, 2017

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

Unable to run tests. These tests run successfully till testcafe@0.16.2 version. Today when I tried to upgrade, getting following error.

bash.exe"-3.1$ npm i testcafe@0.17.0

> testcafe-browser-tools@1.2.4 postinstall C:\grid\node_modules\testcafe-browser-tools
> node ./bin/fix-permissions.js

grid-example@1.0.0 C:\grid
`-- testcafe@0.17.0  invalid
  +-- testcafe-browser-tools@1.2.4
  | `-- linux-platform-info@0.0.2
  +-- testcafe-hammerhead@11.0.3
  `-- testcafe-legacy-api@3.1.0

npm WARN grid-example@1.0.0 No description
npm WARN grid-example@1.0.0 No repository field.
npm WARN grid-example@1.0.0 No license field.
bash.exe"-3.1$ testcafe chrome tests/test-specs/bugs/1649.test.js
Using locally installed version of TestCafe.
 Running tests in:
 - Chrome 60.0.3112 / Windows 7 0.0.0

1649 bug
 × Select multiple checkboxes using shift key selection

   1) Error on page "http://url.com/grid/":

      Uncaught TypeError: Cannot define property hammerhead|processed-context, object is not extensible

      Browser: Chrome 60.0.3112 / Windows 7 0.0.0

         18 |
         19 |fixture `1649 bug`
         20 |    .page `${url}`;
         21 |
         22 |test('Select multiple checkboxes using shift key selection', async t => {
       > 23 |    await t.click(gridPage.firstGrid.getNthRowCheckBox(0));
         24 |    await gridPage.firstGrid.scrollByPercentage(50)();
         25 |    //timeout needed to wait for rows rendering after scroll due to DOM Virtualisation
         26 |    await timeout(100);
         27 |    await t.click(gridPage.firstGrid.getNthRowCheckBox(8), {
         28 |        modifiers: {

         at <anonymous> (C:\grid\tests\test-specs\bugs\1649.test.js:23:13)
         at test (C:\grid\tests\test-specs\bugs\1649.test.js:22:1)



 1/1 failed (8s)

Tests have failed in all 0.17.* versions. They are running fine in 0.16.2 version.

Update: Looks like issue may be with Chrome( version 60). Other browsers are able to run the tests.

What is the expected behavior?

Tests should run successfully.

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

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

Tested page URL: Internal URL

Test code

Specify your

  • operating system: Windows 7
  • testcafe version: 0.17.*
  • node.js version: v6.9.1
@AlexanderMoskovkin AlexanderMoskovkin added !IMPORTANT! TYPE: bug The described behavior is considered as wrong (bug). SYSTEM: hammerhead labels Sep 7, 2017
@thecodejack
Copy link
Author

More Information.

Failed in firefox as well.

bash.exe"-3.1$ testcafe firefox tests/test-specs/bugs/1649.test.js
Using locally installed version of TestCafe.
 Running tests in:
 - Firefox 55.0.0 / Windows 7 0.0.0

 UIUX-1649 bug
 × Select multiple checkboxes using shift key selection

   1) Error on page "http://test/grid/":

      TypeError: can't define property "hammerhead|processed-context": HTMLElement is not extensible

      Browser: Firefox 55.0.0 / Windows 7 0.0.0

         18 |
         19 |fixture `1649 bug`
         20 |    .page `${url}`;
         21 |
         22 |test('Select multiple checkboxes using shift key selection', async t => {
       > 23 |    await t.click(gridPage.firstGrid.getNthRowCheckBox(0));
         24 |    await gridPage.firstGrid.scrollByPercentage(50)();
         25 |    //timeout needed to wait for rows rendering after scroll due to DOM Virtualisation
         26 |    await timeout(100);
         27 |    await t.click(gridPage.firstGrid.getNthRowCheckBox(8), {
         28 |        modifiers: {

         at <anonymous> (C:\tests\test-specs\bugs\1649.test.js:23:13)
         at test (C:\tests\test-specs\bugs\1649.test.js:22:1)



 1/1 failed (24s)

@thecodejack thecodejack changed the title Getting "Unexpected end of JSON input" error after upgrade to >=0.17.0 version Getting "Uncaught TypeError: Cannot define property hammerhead|processed-context, object is not extensible" error after upgrade to 0.17.2 version Sep 7, 2017
@miherlosev
Copy link
Collaborator

We found a piece of code that generates the error you described.
But to fix it completely, we need to understand what your client script does.
Can you provide a page on which I could reproduce the problem?
If information on the page contains sensitive data, you can send me the source to mikhail.losev@devexpress.com

@thecodejack
Copy link
Author

I got the issue that caused the error. We are using webcomponents which run Object.freeze on every component and probably HTMLElement as well. Somewhere in testcafe, you are trying to extend the HTMLElement in newer version. I nullified Object.freeze by overriding which resolved that issue.

But now I am getting following error (which I observed with testcafe@0.17.0 as well). Meanwhile I will ask my team and try to share the code to reproduce the issue.

bash.exe"-3.1$ testcafe chrome tests/1649.test.js
Using locally installed version of TestCafe.
 Running tests in:
 - Chrome 60.0.3112 / Windows 7 0.0.0

 UIUX-1649 bug
 × Select multiple checkboxes using shift key selection

   1) Error on page "http://test.com/grid/":

      Unexpected end of JSON input

      Browser: Chrome 60.0.3112 / Windows 7 0.0.0

         18 |
         19 |fixture `1649 bug`
         20 |    .page `${url}`;
         21 |
         22 |test('Select multiple checkboxes using shift key selection', async t => {
       > 23 |    await t.click(gridPage.firstGrid.getNthRowCheckBox(0));
         24 |    await gridPage.firstGrid.scrollByPercentage(50)();
         25 |    //timeout needed to wait for rows rendering after scroll due to DOM Virtualisation
         26 |    await timeout(100);
         27 |    await t.click(gridPage.firstGrid.getNthRowCheckBox(8), {
         28 |        modifiers: {

         at <anonymous> (C:\code\tests\1649.test.js:23:13)
         at test (C:\code\tests\1649.test.js:22:1)

 1/1 failed (14s)

@thecodejack
Copy link
Author

BTW is there a way I can mock Object.freeze in browser before application load starts through testcafe? Coz my current implementation disables Object.freeze in application. I would rather prefer it to be disabled only during tests.

@AlexanderMoskovkin
Copy link
Contributor

BTW is there a way I can mock Object.freeze in browser before application load starts through testcafe?

Unfortunately, no. But we have a proposal for this: #1739

@AlexanderMoskovkin
Copy link
Contributor

The fix will be included in the next major release. Meanwhile it's already available in the latest dev version (testcafe@0.18.0-dev20170921).

@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…v) (DevExpress#1800)

* Update testcafe-hammerhead (closes DevExpress#1767). Bump version (dev)

* Update package.json
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
!IMPORTANT! STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

3 participants