Closed drptbl closed 4 years ago
createReport doesnt require any parameters anymore. look the the typescript bindings
Rich
On Fri, Apr 17, 2020 at 6:29 AM Jakub Mucha notifications@github.com wrote:
These changes fixed it for me:
onPrepare: (config, capabilities) => { global.reportAggregator = new ReportAggregator({ outputDir:
${reportsPath}/html-report/
, filename: 'master-report.html', reportTitle:Master Report for ${process.env.REVIEW_URL}
, browserName: browser.capabilities.browserName }).clean(); },onComplete: (exitCode, config, capabilities, results) => { global.reportAggregator.createReport({ config: config, capabilities: capabilities, results: results }); },
Cheers.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rpii/wdio-html-reporter/issues/26#issuecomment-615244176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEABIELVBICXHJRFSQBKSJLRNBKQXANCNFSM4MKXRB6Q .
My main point was that if someone follow the README, there is no way to make it work. It's outdated.
Same here: https://webdriver.io/docs/rpii-wdio-html-reporter.html
I thought I had updated that. Sorry about that... its updated now in git and I will publish it soon.
On Sat, Apr 18, 2020 at 6:11 AM Jakub Mucha notifications@github.com wrote:
Closed #26 https://github.com/rpii/wdio-html-reporter/issues/26.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rpii/wdio-html-reporter/issues/26#event-3247352957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEABIELYVL22LJYEVE2T4DTRNGRDZANCNFSM4MKXRB6Q .
I created an issue for the cucumber test. Is not working
On Sat, Apr 18, 2020 at 6:11 AM Jakub Mucha notifications@github.com wrote:
Closed #26 https://github.com/rpii/wdio-html-reporter/issues/26.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rpii/wdio-html-reporter/issues/26#event-3247352957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEABIELYVL22LJYEVE2T4DTRNGRDZANCNFSM4MKXRB6Q .
I am still facing this issue.
const {ReportAggregator, HtmlReporter} = require("@rpii/wdio-html-reporter");
exports.config = {
// debug: true,
baseUrl: 'test.com',
specs: [
"./e2e/tests/**/**-spec.ts"
],
runner: 'local',
port: 9515,
path: '/',
services: [
['chromedriver', {
args: ['--silent'] //
}]
],
capabilities: [{
maxInstances: 1,
browserName: 'chrome',
'goog:chromeOptions': {
args: ["--headless, --disable-gpu", "no-sandbox", "incognito", "--window-size=1920,1500"]
}
}],
outputDir: "./e2e/logs",
waitForTimeout: 1000,
coloredLogs: true,
screenshotOnReject: {
connectionRetryTimeout: 30000,
connectionRetryCount: 0
},
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
helpers: [require.resolve('@babel/register')]
},
reporters: [
'spec',
['allure', {
outputDir: './e2e/test-reports/allure-results',
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: true,
}]
],
reporterOptions: {
allure: {
outputDir: './e2e/test-reports/allure-results'
}
[HtmlReporter, {
outputDir: './e2e/test-reports/',
filename: 'report.html',
reportTitle: 'Test Report Title',
showInBrowser: true,
useOnAfterCommandForScreenshot: false,
}
]
},
beforeSession: function (config, capabilities, specs) {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
})
},
onPrepare: function (config, capabilities) {
let reportAggregator = new ReportAggregator({
outputDir: './e2e/test-reports/',
filename: 'master-report.html',
reportTitle: 'Master Report',
browserName: browser.capabilities.browserName,
template.hbs')
});
reportAggregator.clean();
global.reportAggregator = reportAggregator;
},
afterTest: function (test) {
const path = require('path');
const moment = require('moment');
if (test.passed) {
return;
}
const timestamp = moment().format('YYYYMMDD-HHmmss.SSS');
const filepath = path.join('./e2e/test-reports/screenshots/', timestamp + '.png');
browser.saveScreenshot(filepath);
process.emit('test:screenshot', filepath);
browser.reloadSession();
},
onComplete: function (exitCode, config, capabilities, results) {
(async () => {
await global.reportAggregator.createReport();
})();
}
}
`
I am still facing this issue.
const {ReportAggregator, HtmlReporter} = require("@rpii/wdio-html-reporter"); exports.config = { // debug: true, baseUrl: 'test.com', specs: [ "./e2e/tests/**/**-spec.ts" ], runner: 'local', port: 9515, path: '/', services: [ ['chromedriver', { args: ['--silent'] // }] ], capabilities: [{ maxInstances: 1, browserName: 'chrome', 'goog:chromeOptions': { args: ["--headless, --disable-gpu", "no-sandbox", "incognito", "--window-size=1920,1500"] } }], outputDir: "./e2e/logs", waitForTimeout: 1000, coloredLogs: true, screenshotOnReject: { connectionRetryTimeout: 30000, connectionRetryCount: 0 }, framework: 'jasmine', jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000, helpers: [require.resolve('@babel/register')] }, reporters: [ 'spec', ['allure', { outputDir: './e2e/test-reports/allure-results', disableWebdriverStepsReporting: true, disableWebdriverScreenshotsReporting: true, }] ], reporterOptions: { allure: { outputDir: './e2e/test-reports/allure-results' } [HtmlReporter, { outputDir: './e2e/test-reports/', filename: 'report.html', reportTitle: 'Test Report Title', showInBrowser: true, useOnAfterCommandForScreenshot: false, } ] }, beforeSession: function (config, capabilities, specs) { require('ts-node').register({ project: require('path').join(__dirname, './tsconfig.e2e.json') }) }, onPrepare: function (config, capabilities) { let reportAggregator = new ReportAggregator({ outputDir: './e2e/test-reports/', filename: 'master-report.html', reportTitle: 'Master Report', browserName: browser.capabilities.browserName, template.hbs') }); reportAggregator.clean(); global.reportAggregator = reportAggregator; }, afterTest: function (test) { const path = require('path'); const moment = require('moment'); if (test.passed) { return; } const timestamp = moment().format('YYYYMMDD-HHmmss.SSS'); const filepath = path.join('./e2e/test-reports/screenshots/', timestamp + '.png'); browser.saveScreenshot(filepath); process.emit('test:screenshot', filepath); browser.reloadSession(); }, onComplete: function (exitCode, config, capabilities, results) { (async () => { await global.reportAggregator.createReport(); })(); } }
`
Is this resolved ? whats the solution ?
Does someone solve this error?
The solution is what I have stated. You need the code in the onPrepare function... set a breakpoint there and make sure the global object is created...
onPrepare: function (config, capabilities) { let reportAggregator = new ReportAggregator({ outputDir: './e2e/test-reports/', filename: 'master-report.html', reportTitle: 'Master Report', browserName: browser.capabilities.browserName, template.hbs') }); reportAggregator.clean(); global.reportAggregator = reportAggregator; },
On Tue, Oct 13, 2020 at 2:27 PM juliogomezv notifications@github.com wrote:
Does someone solve this error?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rpii/wdio-html-reporter/issues/26#issuecomment-708018575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEABIEJH5ZVX5L3SNOL2G4DSKTAZHANCNFSM4MKXRB6Q .
^ Getting following error after doing step-by-step setup for master report from README. Using wdio@6 & node 10.