Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: exclude skipped tests from report #129

Merged
merged 1 commit into from
Aug 11, 2023
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
13 changes: 8 additions & 5 deletions src/server/report/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,14 @@ export function renderBrowserResults(browser, tests, options) {
return acc;
}

let status = STATUS_TYPE.WARNING;
if (resultData.duration > resultData.info.slowDuration) {
status = STATUS_TYPE.ERROR;
} else if (resultData.duration < (resultData.info.slowDuration / 2)) {
status = STATUS_TYPE.NORMAL;
let status = STATUS_TYPE.NORMAL;
if (resultData.info) {
status = STATUS_TYPE.WARNING;
if (resultData.duration > resultData.info.slowDuration) {
status = STATUS_TYPE.ERROR;
} else if (resultData.duration < (resultData.info.slowDuration / 2)) {
status = STATUS_TYPE.NORMAL;
}
}

return acc.push(html`
Expand Down
7 changes: 6 additions & 1 deletion src/server/visual-diff-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ function flattenResults(session, browserData, fileData) {
tests.forEach(t => {
const testName = `${prefix}${t.name}`;
const testKey = testName.replaceAll(' > ', ' ');
const info = getTestInfo(session, testKey);

// tests missing info but with no error were skipped via grep, so exclude them
if (!info && !t.error) return;

if (!fileData.tests.has(testName)) {
fileData.tests.set(testName, {
name: testName,
Expand All @@ -87,7 +92,7 @@ function flattenResults(session, browserData, fileData) {
duration: t.duration,
error: t.error?.message,
passed: t.passed,
info: getTestInfo(session, testKey)
info: info
});
});
}
Expand Down