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

Commit e796dce

Browse files
committed
fix: method "fullUrl" should resolve url in runtime
1 parent ea0f42c commit e796dce

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/runner/browser-runner/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ module.exports = class BrowserRunner extends Runner {
3030
.filter((suite) => _.includes(suite.browsers, this._browserId))
3131
.map((suite) => {
3232
if (suite.hasOwnProperty('url')) {
33-
suite.fullUrl = this._mkFullUrl(suite.url);
33+
Object.defineProperty(suite, 'fullUrl', {
34+
get: () => this._mkFullUrl(suite.url)
35+
});
3436
}
3537

3638
return this._runSuite(suite, stateProcessor);

test/unit/runner/browser-runner/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ describe('runner/BrowserRunner', () => {
144144
.then(() => suiteRunnerFabric.create.args[0][0]); // resolve with modified suite
145145
};
146146

147+
it('should resolve url in runtime', () => {
148+
return run_({rootUrl: 'http://localhost/', suiteUrl: 'testUrl'})
149+
.then((suite) => {
150+
suite.url += '/?query=value';
151+
assert.equal(suite.fullUrl, '/testUrl/?query=value');
152+
});
153+
});
154+
147155
it('should not modify suite without "url" as own property', () => {
148156
return run_({rootUrl: 'http://localhost/foo/bar/'})
149157
.then((suite) => assert.isUndefined(suite.fullUrl));

0 commit comments

Comments
 (0)