gemini-testing / gemini

💀💀💀[DEPRECATED] Use hermione
https://github.com/gemini-testing/hermione
MIT License
1.5k stars 149 forks source link

Unexpected value of suite.fullUrl on Windows #904

Open generalov opened 6 years ago

generalov commented 6 years ago

Output of gemini --version: 5.6.2

I've noted that html-reporter plugin produces data.json which contains invalid value in metaInfo.url property on Windows:

metaInfo: {
  url: "\\\\user\\profile.html\\",
}

Expected:

metaInfo: {
  url: "/user/profile.html",
}

The plugin uses value from suite.fullUrl to put in the report. Root cause of the issue is in https://github.com/gemini-testing/gemini/blob/7c709d778979adba0d97eb53c78bc7b2a035f647/lib/runner/browser-runner/index.js#L47-L52

The _mkFullUrl() function calls Node.js path module. But the module is intended to deal with filesystem paths rather URLs. It could return unexpected results on *nix systems too.

Perhaps url-join package or something like that could be used to concatenate URLs correctly.