Giter Site home page Giter Site logo

Comments (6)

doits avatar doits commented on May 26, 2024

Same for me, does not work with firefox but with chrome.

from nightwatch-testing-library.

benmonro avatar benmonro commented on May 26, 2024

Thanks for letting us know, PRs always welcome!

from nightwatch-testing-library.

doits avatar doits commented on May 26, 2024

Currently I cannot offer any support since I was just testing the library out. Just wanted to make sure this really is an issue, at least for more than one person.

But if I used it, I would try my best to provide a PR that fixes this.

from nightwatch-testing-library.

ankur-kushwaha avatar ankur-kushwaha commented on May 26, 2024

I am also facing the same issue, Any update on fix?

from nightwatch-testing-library.

benmonro avatar benmonro commented on May 26, 2024

I'm no longer maintaining this project. If you make a PR I'll give you admin rights. 🙂

from nightwatch-testing-library.

CoryBond avatar CoryBond commented on May 26, 2024

So I spent some time today investigating this issue. I was facing the same problems with the Testing-Dom library injection failing in Firefox in a team project. Based on the work done in testing-library/webdriverio-testing-library/issues/18 I was able to copy a workaround injection for firefox instances. This is the code segment that works:

function injectDomLib(library) {
  // add DOM Testing Library to page as a script tag to support Firefox
  if (navigator.userAgent.indexOf('Firefox') !== -1) {
    const script = document.createElement('script');
    script.innerHTML = library;
    return document.head.append(script);
  } // eval library on other browsers


  return eval(library);
}

I couldn't make a branch off of this repo (at least not one I couldn't push without seeing a 403 issue) so I made a fork instead with my work:
https://github.com/CoryBond/nightwatch-testing-library

I also tested out my solution in my other testing repo:
https://github.com/CoryBond/nightwatch-website-tests

I have not tested this extensively in other browsers except chrome but I suspect thanks to the line:

  if (navigator.userAgent.indexOf('Firefox') !== -1) {

Other browsers are not effected by this new custom injection


As mentioned in testing-library/webdriverio-testing-library/issues/18 if there is a better solution to injecting the dom script then adding a script element to the dom we should use that instead.

It's still not clear why firefox is not executing the internal UMD script but its likely due to some firefox security check. Maybe this is configurable? Not sure, but this might be a good solution until someone finds a better workaround.

from nightwatch-testing-library.

Related Issues (9)

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.