Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #736 from gemini-testing/fix/metainfo-url
Browse files Browse the repository at this point in the history
Method "fullUrl" should resolve url in runtime
  • Loading branch information
DudaGod authored Feb 15, 2017
2 parents 50c738d + e796dce commit 8c24228
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/runner/browser-runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ module.exports = class BrowserRunner extends Runner {
.filter((suite) => _.includes(suite.browsers, this._browserId))
.map((suite) => {
if (suite.hasOwnProperty('url')) {
suite.fullUrl = this._mkFullUrl(suite.url);
Object.defineProperty(suite, 'fullUrl', {
get: () => this._mkFullUrl(suite.url)
});
}

return this._runSuite(suite, stateProcessor);
Expand Down
8 changes: 8 additions & 0 deletions test/unit/runner/browser-runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ describe('runner/BrowserRunner', () => {
.then(() => suiteRunnerFabric.create.args[0][0]); // resolve with modified suite
};

it('should resolve url in runtime', () => {
return run_({rootUrl: 'http://localhost/', suiteUrl: 'testUrl'})
.then((suite) => {
suite.url += '/?query=value';
assert.equal(suite.fullUrl, '/testUrl/?query=value');
});
});

it('should not modify suite without "url" as own property', () => {
return run_({rootUrl: 'http://localhost/foo/bar/'})
.then((suite) => assert.isUndefined(suite.fullUrl));
Expand Down

0 comments on commit 8c24228

Please sign in to comment.