Skip to content

Commit

Permalink
Fix remaining remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyBelym committed Jan 24, 2019
1 parent 57bd122 commit 7866642
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/browser/provider/plugin-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ export default class BrowserProviderPluginHost {
}

async getVideoFrameData (browserId) {
this.reportWarning(browserId, WARNING_MESSAGE.videoNotSupportedByBrowserProvider, this[name]);
const browserAlias = BrowserConnection.getById(browserId).browserInfo.alias;

this.reportWarning(browserId, WARNING_MESSAGE.videoNotSupportedByBrowserProvider, browserAlias);
}

async reportJobResult (/*browserId, status, data*/) {
Expand Down
2 changes: 1 addition & 1 deletion src/browser/provider/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default {
if (!await provider.isValidBrowserName(browserName))
throw new GeneralError(MESSAGE.cantFindBrowser, alias);

return browserInfo;
return { alias, ...browserInfo };
},

addProvider (providerName, providerObject) {
Expand Down
2 changes: 1 addition & 1 deletion src/notifications/warning-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
screenshotRewritingError: 'The file at "{screenshotPath}" already exists. It has just been rewritten with a recent screenshot. This situation can possibly cause issues. To avoid them, make sure that each screenshot has a unique path. If a test runs in multiple browsers, consider including the user agent in the screenshot path or generate a unique identifier in another way.',
browserManipulationsOnRemoteBrowser: 'The screenshot and window resize functionalities are not supported in a remote browser. They can function only if the browser is running on the same machine and in the same environment as the TestCafe server.',
screenshotNotSupportedByBrowserProvider: 'The screenshot functionality is not supported by the "{providerName}" browser provider.',
videoNotSupportedByBrowserProvider: 'The video recording functionality is not supported by the "{providerName}" browser provider.',
videoNotSupportedByBrowserProvider: 'The video recording functionality is not supported by the "{browserAlias}" browser.',
resizeNotSupportedByBrowserProvider: 'The window resize functionality is not supported by the "{providerName}" browser provider.',
maximizeNotSupportedByBrowserProvider: 'The window maximization functionality is not supported by the "{providerName}" browser provider.',
resizeError: 'Was unable to resize the window due to an error.\n\n{errMessage}',
Expand Down
2 changes: 1 addition & 1 deletion src/video-recorder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default class VideoRecorder {
const connectionCapabilities = await testRun.browserConnection.provider.hasCustomActionForBrowser(connection.id);

if (!connectionCapabilities || !connectionCapabilities.hasGetVideoFrameData) {
this.browserJob.warningLog.addWarning(WARNING_MESSAGES.videoNotSupportedByBrowserProvider, connection.browserInfo.providerName);
this.browserJob.warningLog.addWarning(WARNING_MESSAGES.videoNotSupportedByBrowserProvider, connection.browserInfo.alias);

return;
}
Expand Down
12 changes: 0 additions & 12 deletions test/functional/fixtures/video-recording/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ if (config.useLocalBrowsers) {
setVideoPath: true,
shouldFail: true
})
.then(() => {
throw new Error('Promise rejection expected');
})
.catch(errors => {
expect(errors.length).to.equal(2);
expect(errors[0]).to.match(/^Error: Error 1/);
Expand All @@ -37,9 +34,6 @@ if (config.useLocalBrowsers) {
singleFile: true
}
})
.then(() => {
throw new Error('Promise rejection expected');
})
.catch(assertionHelper.getVideoFilesList)
.catch(errors => {
expect(errors.length).to.equal(2);
Expand All @@ -61,9 +55,6 @@ if (config.useLocalBrowsers) {
failedOnly: true
}
})
.then(() => {
throw new Error('Promise rejection expected');
})
.catch(assertionHelper.getVideoFilesList)
.catch(errors => {
expect(errors.length).to.equal(2);
Expand All @@ -86,9 +77,6 @@ if (config.useLocalBrowsers) {
singleFile: true
}
})
.then(() => {
throw new Error('Promise rejection expected');
})
.catch(assertionHelper.getVideoFilesList)
.catch(errors => {
expect(errors.length).to.equal(2);
Expand Down

0 comments on commit 7866642

Please sign in to comment.