Hi Mike, thanks for reply…
Well, my scenario is kinda different. While you are using a single csv file for a group of test cases, I have 1 csv file for each and every one of my test cases.
Each test case has different parameters so each test case might need to run a different number of times than other test case in the group, that’s why I am using --pm=all and not the --iter modifier.
Based on the documentation site, I wrote a suite config file like the following one:
const path = require('path');
module.exports = {
//
// ======
// Suites
// ======
// Define your test suites here.
//
suites: [{
name: 'Unidad 1',
cases: [{
path: "./testCases/Some Directory 01/Caso123.js",
},
{
path: "./testCases/Other Directory 01/Caso456.js",
}]
}],
//
// ============
// Capabilities
// ============
// Define your capabilities here.
// If "concurrency" value is greater than 1, tests with different capabilities will be executed in parallel.
//
concurrency: 1,
capabilities: [{
browserName: 'chrome',
}],
// ============
// Parameters
// ============
//
parameters : {
mode: 'all'
},
// =======
// Modules
// =======
// List modules you want to enable during the test execution.
// Loading unnecessary modules might slow down your test execution,
// so only load modules that are used in the test.
// See a list of available modules here: http://docs.oxygenhq.org/
//
modules: ['web', 'log', 'assert'],
// =========
// Reporting
// =========
// Define test reporter format and corresponding options.
// Multiple reporter formats can be specified.
// Available reporters: json | html | junit | excel | pdf | xml
//
reporting: {
outputDir: path.join(__dirname, 'reports'),
reporters: ['html'],
},
//
// =====
// Hooks
// =====
// Oxygen provides several hooks that can be used to interfere with the test
// execution process.
//
hooks: {
//
// Hook that gets executed before the test starts.
// At this point, Oxygen has been already initialized, so you
// can access Oxygen via 'ox' global variable.
//
beforeTest: function(runId, options, caps) {
console.log('Marco landed on beforeT');
},
beforeSuite: function(runId, suiteDef) {
console.log('Marco landed on beforeS');
},
beforeCase: function(runId, caseDef) {
web.init()
log.info('Say hello before running this test case!')
console.log('Marco landed on beforeC');
},
afterCase: async function(runId, caseResult, error) {
console.log('Marco landed on afterC')
},
afterSuite: function(runId, suiteResult, error) {
console.log('Marco landed on afterS')
},
afterTest: function(runId, testResult, error) {
console.log('Marco landed on afterT')
}
}
};
When running each test case directly with oxygen-cli, the parameter file is read automatically, But when running a suite file they don’t get read. How can I specify that oxygen-cli looks for a csv file named as each test case that comprises the suite? without writing in the suite file the path to each one of my 50 csv filess??
Once again, thank you very much, I appreciate your helping me out.