The problem is with the config file where I'm setting port to open up chrome. I am following 1) https://codecept.io/webdriver/#what-is-selenium-webdriver and ran a test using: npx codeceptjs run.
const { setHeadlessWhen } = require('@codeceptjs/configure');
// turn on headless mode when running with HEADLESS=true environment variable
// HEADLESS=true npx codecept run
setHeadlessWhen(process.env.HEADLESS);
exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
WebDriver: {
url: 'www.fb.com',
browser: 'chrome'
host:'127.0.0.1',
port: 4444,
restart: false,
windowSize: '1920x1680',
desiredCapabilities: {
chromeOptions: {
args: [ /*"--headless",*/ "--disable-gpu", "--no-sandbox" ]
}
},
},
}
include: {
I: './steps_file.js'
},
bootstrap: null,
mocha: {},
name: 'codecepjs',
plugins: {
wdio: {
enabled: true,
services: ['selenium-standalone']
}
retryFailedStep: {
enabled: true
},
screenshotOnFail: {
enabled: true
}
}
};