mockUrl extension

Some time ago i had a need in my client to test failure scenarios and created a mockUrl browser extensions. Extension now has support to block & mock any requests and record har files and also create mock responses based on pre-recorded and/or modified har files..

New change that just landed yesterday, i added rfdocs for each keyword and argument validation so that user cannot provide incorrect arguments that could lead to crash in playwright side.

Extension is here: robotframework-browser-extensions/mockUrl at main · MarketSquare/robotframework-browser-extensions · GitHub

2 Likes

Cool, thank you! Since mockUrl-extension does not need additional npm modules, would it work out-of-the-box with the bundled NodeJS from the batteries deployment of robotframework-browser[bb]?

Considering that the release notes from @tatutatu said that batteries version includes nodejs and npm dependencies and it does not, i cant say either way .. I did however try to install batteries version and my example ran just fine (besides RecordHAR keyword test but thats because my demo site is snafu)

Few findings from batteries:

  • if external nodejs is not installed and activated via nvm, i get filenotfound exception for npm .. Release notes did say that “all npm dependencies are shipped”, so if thats the case, in scenario where i didnt have npm in path, rfbrowser throws this exception ?
  • on my venv, i dont see any references to neither npmor node executables
  • my current default node is 20.10 but running rfbrowser init says bad engine and 20.17 is needed, which hints towards that there is no node shipped with batteries ..
  • grpc stuff was installed just fine

@aaltat @Snooz82 ^ ping .. “yeah yeah, do a bug report” is the awswer but feels like this wasnt tested properly to be released - atleast on macos or wording around what is still required feels a bit wonky since the discussion in the gh issue did point that nodejs itself is also shipped but i guess im wrong ?

1 Like

All NodeJS, NodeJS dependecies and Browser library NodeJS code are shipped as prebuilt binary. There is a single executable that contains all those elements. But it doesn’t mean that one can access npm or other modules from NodeJS. If you need those then install NodeJS normally and use rfbrowser init

1 Like

Point was, If changelog says; “all node and npm dependencies are met”- I was expected that if when batteries are included, checking what needs to be installed with init would default to shipped npm and node as the default behaviour was not clearly indicated. Gladly the logging was clear enough to handle this.

I’ll write a feature suggestion about handling node/npm deps

Yes, this was badly communicated from my part, sorry about that. I am open to suggestion how to improve.