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

[browserstack-service] Sending skipped test details for beforeEach, beforeAll and afterEach hooks in mocha #10258

Merged
merged 23 commits into from
Apr 26, 2023

Conversation

sriteja777
Copy link
Contributor

@sriteja777 sriteja777 commented Apr 24, 2023

Proposed changes

  • Sending test details as skipped whenever hook fails along with hook failure details

Related v7 PR #10259

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

@sriteja777
Copy link
Contributor Author

@christian-bromann Please review this PR

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update the branch and see if the test pass? If so I am happy to merge.

let parentTitle = test.parent
// Sometimes parent will be an object instead of a string
if (typeof test.parent === 'object') {
// @ts-ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we resolve the type issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we are getting the test object from the context of the test that is passed to the service (test.ctx.test.parent) in some places. And this object doesn't match with Framework.Test type which has parent has string, but in the context object, the parent can be an object. Also we don't have any exported types to type for this context.

Currently removed the ts-ignore and casted it to any. Let me know if you have any better solution

@sriteja777
Copy link
Contributor Author

@christian-bromann the tests have passed. Please merge if it looks good to you.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Apr 26, 2023
@christian-bromann christian-bromann merged commit 6329071 into webdriverio:main Apr 26, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Polish 💅 PRs that contain improvements on existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants