So I have the following scenario.
We have a Protractor-Cucumber framework based on this framework.
The framework has been modified in a way that the config files are written in TS. This is an example config:
import { browser, Config } from 'protractor';
import { Reporter } from '../support/reporter';
const jsonReports = process.cwd() + '/reports/json';
export const config: Config = {
directConnect: true,
SELENIUM_PROMISE_MANAGER: false,
stackTrace: true,
capabilities: {
browserName: 'chrome'
},
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
'../../features/*.feature',
'../../features/**/*.feature',
],
onPrepare: () => {
browser.manage().window().maximize();
Reporter.createDirectory(jsonReports);
},
cucumberOpts: {
compiler: 'ts:ts-node/register',
format: 'json:./reports/json/cucumber_report.json',
require: [
'../../stepdefinitions/*.ts',
'../../stepdefinitions/**/*.ts',
'../../support/*.ts'
],
strict: true,
tags: '(@e2e) and (not @ignore) and (not @notImplemented)',
keepAlive: false,
},
allScriptsTimeout: 10000,
getPageTimeout: 5000,
onComplete: () => {
return Reporter.generateReports();
},
afterLaunch: exitCode => {
if (exitCode === 1) {
console.log('Actual Exit code: ' + exitCode);
process.exit(0);
}
}
};
Looking back at the framework this was implemented from, now they have implemented protractor-flake, which is something I need to include.
I have tried using the actual config which is being used, and can be seen here however when I try to run it I get the following error:
E/configParser - Error code: 105
[09:14:04] E/configParser - Error message: failed loading configuration file ./build/config/conf.debug.js
[09:14:04] E/configParser - Error: Cannot find module 'C:\Users\Protractor\build\config\conf.debug.js'
Please note that I have changed the protractor args to load the config shown above hence it is showing that is cannot load config.debug.js.
I have also been through Nick Tomlin's repositories for protractor flake and the cucumber specific documentation and added the necessary console.log in the After support code and tested running protractor flake from the cli but nothing seems to work. I get the error above followed by :
Using cucumber to parse output Tests failed but no specs were found.
All specs will be run again.Re-running tests: test attempt 2
However no tests are run .i.e. no run at all.
When I run the usual config using npm all runs well, without the re run of protractor flake.
Can anyone offer their 2 cents on this issue, what am I missing?
I have searched quite a bit to find a typescript example for this but as yet have not, unless I missed it.
Sorry I know it is long but wanted to try to cover everything I have tried.
Thanks in advance.