Skip to content

Commit

Permalink
fix error message for :userProfile (#7972)
Browse files Browse the repository at this point in the history
already checked by @titerman

---------

Co-authored-by: titerman <[email protected]>
  • Loading branch information
AlexKamaev and titerman authored Aug 25, 2023
1 parent d26cb24 commit a6a0cd7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/errors/runtime/templates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions test/functional/fixtures/regression/gh-7925/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ const { expect } = require('chai');
const createTestCafe = require('../../../../../lib');
const { onlyInNativeAutomation } = require('../../../utils/skip-in');

const EXPECTED_ERROR = 'The "userProfile" option is enabled for the following browsers: "chrome:userProfile".\n' +
'The "userProfile" option is not supported in the Native Automation mode.\n' +
'Use the "disable native automation" option or remove "userProfile" option to continue.';
const EXPECTED_ERROR = 'Cannot initialize the test run. ' +
'When TestCafe uses native automation, it can only launch browsers with an empty user profile. ' +
'Disable native automation, or remove the "userProfile" suffix from the following ' +
'browser aliases: "chrome:userProfile, chrome:userProfile".';

let testcafe = null;
let error = null;
Expand Down Expand Up @@ -33,7 +34,7 @@ function runTests (browsers) {

describe('[Regression](GH-7925) Browsers with "userProfile" option in Native Automation', function () {
onlyInNativeAutomation('chrome:userProfile', function () {
return runTests(['chrome:userProfile'])
return runTests(['chrome:userProfile', 'chrome:userProfile'])
.then(() => {
expect(error.message).contains(EXPECTED_ERROR);
});
Expand Down
7 changes: 3 additions & 4 deletions test/server/bootstrapper-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,9 @@ describe('Bootstrapper', () => {
throw new Error('Promise rejection expected');
}
catch (err) {
expect(err.message).eql('The "userProfile" option is enabled for the following browsers: "chrome, edge".\n' +
'The "userProfile" option is not supported in the Native Automation mode.\n' +
'Use the "disable native automation" option or remove "userProfile" option to continue.'
);
expect(err.message).eql('Cannot initialize the test run. When TestCafe uses native automation, it can only ' +
'launch browsers with an empty user profile. Disable native automation, or remove ' +
'the "userProfile" suffix from the following browser aliases: "chrome, edge".');
}
});
});
Expand Down

0 comments on commit a6a0cd7

Please sign in to comment.