Git Product home page Git Product logo

Comments (10)

alexisabril avatar alexisabril commented on August 21, 2024

@geekytime Which version of PhantomJS are you using? Originally, PhantomJS did not support window.open, however latest version do(as such the latest version of FuncUnit doesn't use the Phantom specific conditions).

Also, which version of FuncUnit are you using?

from funcunit.

geekytime avatar geekytime commented on August 21, 2024

I'm using FuncUnit 2.0.3, and PhantomJS 1.9.1.

I've been digging through the FuncUnit code trying to track this down. It does indeed make the call to window.open, so it's not an iframe issue.

The call to window.open succeeds, and a document exists, but FuncUnit.win.location.href for that window starts as about:blank, where I'd expect it to start with my supplied url. Then, after a few rounds of polling, FuncUnit.win.location.href abruptly changes to undefined, and the document also gets set to undefined.

The polling just keeps going after that, I'm guessing until something times out.

I tried forcibly re-setting FuncUnit.win.location.href = url; after the call to window.open but that didn't help.

from funcunit.

alexisabril avatar alexisabril commented on August 21, 2024

Do you have an isolated test case by chance?

from funcunit.

geekytime avatar geekytime commented on August 21, 2024

Meh. No. Not handy. I'd have to send you my whole grunt project and everything, which I'm not sure I've got time to do.

Are these versions of FuncUnit and PhantomJS expected to work properly together? If I create a Jasmine test harness page that runs in Chrome and Firefox, should I be able to simply open the same page in PhantomJS and have it run there, too?

Is there any other configuration or shimming/polyfilling that I should be doing to make FuncUnit more Phantom-friendly?

from funcunit.

geekytime avatar geekytime commented on August 21, 2024

For what it's worth, I've run the same basic tests in CasperJS, so I know my app works in PhantomJS okay...

from funcunit.

alexisabril avatar alexisabril commented on August 21, 2024

FuncUnit is geared to be Phantom compliant at this point, without any modification to your tests. However, I don't doubt that there could be a bug with specific setups. I'll leave this case open for the moment, in the event we can create an isolated test.

from funcunit.

geekytime avatar geekytime commented on August 21, 2024

I created a isolated test case, but it worked fine on my machine. I guess it's too watered down from my real test. When I have time, I'll try adding bits of my app config until I can replicate the problem. Thanks for your patience.

from funcunit.

alexisabril avatar alexisabril commented on August 21, 2024

No worries at all. I'll close this case for the moment, but once you have a failing test, be sure to reference this issue and we'll be sure to take a look.

from funcunit.

geekytime avatar geekytime commented on August 21, 2024

I've tried several tricks to create an isolated test case, and I still can't duplicate this issue without my full developer setup. However, I was using PhantomJS for another project without FuncUnit, and I came across a scenario where I had closed a few popup windows, but still had references to the window objects. The window objects had devolved from DOMWindows into simple objects that just looked like: {closed:true}.

I haven't figured out exactly how it's happening, but I believe this is what is causing my problems with FuncUnit. I think it's got a reference to an object that it thinks is a DOMWindow, but it is actually one of these closed objects.

I'll keep digging around, but thought this discovery was worth sharing.

from funcunit.

alexisabril avatar alexisabril commented on August 21, 2024

@geekytime No worries! Thanks for the notes. I'm keeping this issue closed for the moment, but I'm noting it for additional testing on our end as well to try and locate the issue.

from funcunit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.