DevExpress / testcafe-reporter-xunit

This is the xUnit reporter plugin for TestCafe.
https://testcafe.io
MIT License
10 stars 30 forks source link

File field in testcase #24

Closed AGrigorii closed 1 year ago

AGrigorii commented 1 year ago

Привет! Для корректного отображения в gitlab переписываю следующим образом репорт:

import { readFileSync, writeFileSync } from 'fs';
import { resolve } from 'path';

const cwd = process.cwd();

const report = readFileSync(resolve(cwd, 'testcafe/reports/report.xml'), { encoding: 'utf-8' });
const fixed = report.replace(new RegExp(cwd, 'g'), () => '');

writeFileSync(resolve(cwd, 'testcafe/reports/report.xml'), fixed);

тем самым превращаю пути в относительные относительно репозитория: image

Подскажите, пожалуйста, есть ли стопперы к тому, что я создам вам в пакет пиар с этими правками?

rob4629 commented 1 year ago

Это выглядит хорошо, я проведу несколько тестов, чтобы подтвердить. Спасибо

AlexKamaev commented 1 year ago

This approach can be used as a workaround, but I'm afraid we cannot accept this kind of changes. We did not come to the conclusion regarding the file field in testcafe-reporter-xunit yet.

AGrigorii commented 1 year ago

Just to let you, jest junit reporter prints relative to project paths for such attributes by default. I have no idea, what is the benefit absolute path to be here.

AlexKamaev commented 1 year ago

Thank you for sharing this information. We'll take it into account.

rob4629 commented 1 year ago

Thank you for sharing this information. We'll take it into account.

Does that mean we can re-open this issue? Honestly, having the full path does nothing to solve the problem of why this attribute was requested in the first place

AlexKamaev commented 1 year ago

This issue only suggests a workaround, so we don't need to reopen it. However, in the testcafe-reporter-xunit repo, we can accept a PR with changing an absolute path to a relative one.

AGrigorii commented 1 year ago

We'd like to contribute by that) Let us do

AlexKamaev commented 1 year ago

@AGrigorii Please take into account that we would accept changes only in the testcafe-reporter-xunit module. We'd prefer not to modify the TestCafe code.