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 after:run event #14263

Merged
merged 45 commits into from Dec 21, 2020
Merged

feat: Add after:run event #14263

merged 45 commits into from Dec 21, 2020

Conversation

chrisbreiding
Copy link
Contributor

@chrisbreiding chrisbreiding commented Dec 21, 2020

User facing changelog

  • You can now listen to a after:run event in the plugins file. See the documentation for more information (TODO: link to doc).

Additional details

  • The event fires after the run.
  • It only fires in run mode.
  • If running parallel, it will run for each machine running.
  • The event handler receives one argument, an object with the result of the run. It's the same results the module API receives.
on('after:run', (results) => {
  // {
  //   startedTestsAt: '2020-12-21T14:31:56.409Z',
  //   endedTestsAt: '2020-12-21T14:31:56.449Z',
  //   totalDuration: 40,
  //   totalSuites: 0,
  //   totalTests: 1,
  //   totalFailed: 0,
  //   totalPassed: 1,
  //   totalPending: 0,
  //   totalSkipped: 0,
  //   runs: [
  //     {
  //       stats: [Object],
  //       reporter: 'spec',
  //       reporterStats: [Object],
  //       hooks: [],
  //       tests: [Array],
  //       error: null,
  //       video: '/Users/janelane/app/cypress/videos/login_spec.js.mp4',
  //       spec: [Object],
  //       shouldUploadVideo: true
  //     }
  //   ],
  //   browserPath: '',
  //   browserName: 'electron',
  //   browserVersion: '87.0.4280.67',
  //   osName: 'darwin',
  //   osVersion: '19.6.0',
  //   cypressVersion: '6.1.0',
  //   config: {
  //     // ... config properties ...
  //   },
  //   status: 'finished'
  // }
})

PR Tasks

chrisbreiding and others added 30 commits December 9, 2020 13:48
mostly for the run_spec.js test's sake, so they don't fail because they don't pass config in
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 21, 2020

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Dec 21, 2020



Test summary

9170 0 118 3Flakiness 1


Run details

Project cypress
Status Passed
Commit 94ed103
Started Dec 21, 2020 6:23 PM
Ended Dec 21, 2020 6:35 PM
Duration 12:09 💡
OS Linux Debian - 10.5
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/retries.ui.spec.js Flakiness
1 runner/cypress retries.ui.spec > opens attempt on each attempt failure for the screenshot, and closes after test passes

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@chrisbreiding chrisbreiding changed the base branch from TR-538-before-run-event to develop December 21, 2020 18:07
@chrisbreiding chrisbreiding merged commit 9a25fd0 into develop Dec 21, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 21, 2020

Released in 6.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v6.2.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 21, 2020
@chrisbreiding chrisbreiding deleted the TR-542-after-run-event branch April 5, 2022 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants