zalmoxisus / crossbuilder

Building web, Electron, Cordova and Chrome apps, and cross-browser extensions with React, Redux and Webpack. "Write once, deploy everywhere" concept in practice.
MIT License
484 stars 50 forks source link

React 15 breaks test #39

Closed chetmurphy closed 8 years ago

chetmurphy commented 8 years ago

I created a new crossbuilder project and ran test successfully. Then I upgraded to react 15.0.2 and reran test again. This time most the tests of the form "should contain text "Clicked:" failed. I also upgraded redux, react-addons-test-utils, and selenium-webdriver to their latest versions and still get the same failures.

Interestingly the apps still work correctly. It appears that the function checkValue in tests.js is aborting for the failure cases.

Any suggestions?

zalmoxisus commented 8 years ago

Yes, React 0.15 doesn't split Clicked: {0} times into 3 separate spans anymore, so conditions like this will not be true. If you have time to fix the tests and do an update to React 0.15, such a contribution would be welcome. It's just a simple example, which you'll have to extend for your app, so it would be useful for you to figure out.

chetmurphy commented 8 years ago

OK I fixed the xpath query using '//div/button[' + idx + ']', but I am still getting 3 failures in inject page tests:

inject page
  √ should open Github (1661ms)
  √ should render inject app
  √ should contain text "Clicked: 2 times"
   -> 3
    √ should click button with idx=1 (61ms)
    **1) should contain text "Clicked: 3 times"**
   -> 4
    √ should click button with idx=4 (49ms)
    **2) should contain text "Clicked: 4 times"**
   -> 3
    √ should click button with idx=2 (68ms)
    **3) should contain text "Clicked: 3 times"**

As best that I can tell these are not related to the xpath query (it succeeds). So far I have not been able to find the reasons for these failures. Console log is painful with async chained code and so far I have not found a way to attach a debugger to gulp mocha co-mocha tasks. Any other suggestions?

BTW: I am developing on Windows 10 using the Git Bash shell.

zalmoxisus commented 8 years ago

Fixed in https://github.com/zalmoxisus/crossbuilder/commit/c5e3ed6ae802dfb72ae19a17fb65c6287e5188fc.

You can check XPath expressions on the console by using

document.evaluate( '//div/button[1]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null );

where //div/button[1] is your XPath expression.