Skip to content
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 docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ within('.js-signup-form', () => {
I.see('There were problems creating your account.');
```

> ⚠ `within` can cause problems when used incorrectly. If you see a weired behavior of a test try to refactor it to not use `within`. It is recommended to keep within for simplest cases when possible.
> ⚠ `within` can cause problems when used incorrectly. If you see a weird behavior of a test try to refactor it to not use `within`. It is recommended to keep within for simplest cases when possible.

`within` can also work with IFrames. A special `frame` locator is required to locate the iframe and get into its context.

Expand Down
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ exports.config = {

## Profile

Using values from `process.profile` you can change the config dynamically.
Using `process.env.profile` you can change the config dynamically.
It provides value of `--profile` option passed to runner.
Use its value to change config value on the fly.

Expand All @@ -134,7 +134,7 @@ exports.config = {
WebDriver: {
url: 'http://localhost:3000',
// load value from `profile`
browser: process.profile || 'firefox'
browser: process.env.profile || 'firefox'

}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/codecept.conf.example.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
console.log('Use JS config file');

console.log(process.profile);
console.log(process.env.profile);

exports.config = {
tests: './*_test.js',
Expand All @@ -9,7 +9,7 @@ exports.config = {
helpers: {
WebDriverIO: {
url: 'http://localhost',
browser: process.profile || 'firefox',
browser: process.env.profile || 'firefox',
restart: true,
},
},
Expand Down
2 changes: 2 additions & 0 deletions lib/command/interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const event = require('../event');
const output = require('../output');

module.exports = function (path, options) {
// Backward compatibility for --profile
process.profile = options.profile;
process.env.profile = options.profile;

const testsPath = getTestRoot(path);
const config = getConfig(testsPath);
Expand Down
2 changes: 1 addition & 1 deletion lib/command/run-multiple.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let processesDone;

module.exports = function (selectedRuns, options) {
// registering options globally to use in config
process.profile = options.profile;
process.env.profile = options.profile;
const configFile = options.config;
let codecept;

Expand Down
2 changes: 2 additions & 0 deletions lib/command/run-rerun.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const Codecept = require('../rerun');

module.exports = function (test, options) {
// registering options globally to use in config
// Backward compatibility for --profile
process.profile = options.profile;
process.env.profile = options.profile;
const configFile = options.config;
let codecept;

Expand Down
2 changes: 1 addition & 1 deletion lib/command/run-workers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = function (workers, options) {
'Required minimum Node version of 11.7.0 to work with "run-workers"',
);

process.profile = options.profile;
process.env.profile = options.profile;

const { Worker } = require('worker_threads');

Expand Down
2 changes: 2 additions & 0 deletions lib/command/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const Codecept = require('../codecept');

module.exports = function (test, options) {
// registering options globally to use in config
// Backward compatibility for --profile
process.profile = options.profile;
process.env.profile = options.profile;
const configFile = options.config;
let codecept;

Expand Down
2 changes: 1 addition & 1 deletion test/data/sandbox/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const profile = process.profile;
const profile = process.env.profile || process.profile;

exports.config = {
tests: './*_test.js',
Expand Down