Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error message for :userProfile #7972

Merged
merged 3 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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