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

feat: add possibility to pass additional data to the reporter plugin (closes #3584) #7562

Merged
merged 16 commits into from
Mar 30, 2023

Conversation

Artem-Babich
Copy link
Contributor

@Artem-Babich Artem-Babich commented Mar 15, 2023

Purpose

#3584
A lot of users need to pass additional information from the test to the custom or existing reporter.

Aproach

This is the first part of reporter improvements that allow users to pass additional data to the reporter by running t.report action.
This action triggers reportData reporter event as well as adds passed data to the testRun. Finally this data is passed to the reportTestDone event handler.

API:

TestController:

t.report (...args: any[]): TestControllerPromise

ReporterPlugin

interface TestRunInfo {
   //...
   reportData: { [testRunId: string]: any[] };
}

interface ReportDataTestRunInfo {
    test: {name, id, meta},
    fixture: {name, id, meta, path},
    testRunId: string,
    browser: BrowserInfo,
}

class ReporterPlugin {
   reportData (testRun: ReportDataTestInfo, ...data: any[]) { }

   reportTestDone ( testName: string, { reportData, browsers }: TestRunInfo, meta: Metadata ) {
       browsers.forEach(({ testRunId, alias }) => {
          const browserReportData = reportData[testRunId];
       });
   }
}

References

#3584
DevExpress/testcafe-reporter-spec#8

Pre-Merge TODO

  • Write tests for your proposed changes
  • Make sure that existing tests do not fail

@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 08:09 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 08:13 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 09:53 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 10:26 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 10:36 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 12:18 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 12:42 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich changed the title feat: add possibility to pass additional data to the reporter plugin feat: add possibility to pass additional data to the reporter plugin (closes #3584) Mar 15, 2023
@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 13:44 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 15, 2023 13:47 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich requested a review from miherlosev March 15, 2023 14:18
@Artem-Babich Artem-Babich temporarily deployed to CI March 17, 2023 11:55 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 17, 2023 11:56 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 17, 2023 12:11 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 20, 2023 08:45 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 21, 2023 07:10 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 22, 2023 11:36 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich temporarily deployed to CI March 22, 2023 12:33 — with GitHub Actions Inactive
@Artem-Babich Artem-Babich requested a review from miherlosev March 22, 2023 12:37
@github-actions
Copy link

Release v2.5.0-rc.1 addresses this.

aleks-pro pushed a commit that referenced this pull request Apr 4, 2023
<!--
Thank you for your contribution.

Before making a PR, please read our contributing guidelines at

https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution

We recommend creating a *draft* PR, so that you can mark it as 'ready
for review' when you are done.
-->

## References
#7562

## Pre-Merge TODO
- [ ] Write tests for your proposed changes
- [ ] Make sure that existing tests do not fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants