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

fixed setting titles from XML files #352

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fixed bad formatting
  • Loading branch information
DavertMik committed Jun 6, 2024
commit e152c381086c18300d62273a72028719af13c957
5 changes: 0 additions & 5 deletions lib/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 106,6 @@ const fetchSourceCodeFromStackTrace = (stack = '') => {
};

const TEST_ID_REGEX = /@T([\w\d]{8})/;
const SUITE_ID_REGEX = /@[Ss]([\w\d]{8})/;

const fetchIdFromCode = (code, opts = {}) => {
const comments = code
Expand Down Expand Up @@ -134,10 133,6 @@ const fetchIdFromOutput = output => {
return lines.find(c => c.match(TEST_ID_REGEX))?.match(TEST_ID_REGEX)?.[1];
};

const fetchSuiteId = (title) => {
return title.find(c => c.match(/@s/))?.match(TEST_ID_REGEX)?.[1];
};

const fetchSourceCode = (contents, opts = {}) => {
if (!opts.title && !opts.line) return '';

Expand Down
3 changes: 1 addition & 2 deletions lib/xmlReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 460,6 @@ function reduceTestCases(prev, item) {
// SpecFlow config
let { title, tags } = fetchProperties(item.type === 'ParameterizedMethod' ? item : testCaseItem);
let example = null;
let suiteTitle = reduceOptions.preferClassname ? testCaseItem.classname : item.name || testCaseItem.classname;

title ||= testCaseItem.name || testCaseItem.methodname || testCaseItem.classname;
tags ||= [];
Expand Down Expand Up @@ -494,7 493,7 @@ function reduceTestCases(prev, item) {
run_time: parseFloat(testCaseItem.time || testCaseItem.duration) * 1000,
status,
title,
suite_title: suiteTitle,
suite_title: reduceOptions.preferClassname ? testCaseItem.classname : item.name || testCaseItem.classname,
});
});
return prev;
Expand Down
Loading