mercredi 27 mai 2015

Selenium HTML Mock/Fixture to test JS controls

I'm using Cucumber (jvm) with Selenium and would like to test, not an entire page, but a control (that can be loaded on any page with JavaScript).

So I'd to do have something like:

webdriver.get("<html>[remotejsfiles][loadcontrol]</body></html>")

As you might figure, the js files location should be configurable. What I could do:

  • Create a static html file
  • override the location of the js file in thte html in a hook (ugly part)
  • use driver.get("file:/// [file] ")

But I'm pretty sure there is a better way...

Aucun commentaire:

Enregistrer un commentaire