Skip to content

fix cucumber report issue - windows#11118

Merged
christian-bromann merged 3 commits intowebdriverio:mainfrom
tamil777selvan:cucumber_report_fix
Sep 9, 2023
Merged

fix cucumber report issue - windows#11118
christian-bromann merged 3 commits intowebdriverio:mainfrom
tamil777selvan:cucumber_report_fix

Conversation

@tamil777selvan
Copy link
Member

Proposed changes

  • Fixing report path for windows
  • Keeping custom reporter as default, allows to use cucumber formatting in addition to other formatting options

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

@tamil777selvan tamil777selvan changed the title fix report issue fix cucumber report issue - windows Sep 8, 2023
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
Copy link
Member

Seems like some tests aren't happy 😉

@tamil777selvan
Copy link
Member Author

Seems like some tests aren't happy 😉

on it..

@christian-bromann
Copy link
Member

@tamil777selvan regarding your last commit, I suggest to update the unit test rather than amending the package code. The unit test should be written so they don't break the code not other way around 😉

@tamil777selvan
Copy link
Member Author

@tamil777selvan regarding your last commit, I suggest to update the unit test rather than amending the package code. The unit test should be written so they don't break the code not other way around 😉

got it @christian-bromann let me refactor it now.

@tamil777selvan
Copy link
Member Author

@christian-bromann, Because the file name is hardcoded, I faced challenges while trying to modify the tests. I also made an attempt to mock the url and path methods as shown, but this caused issues in other areas where the actual path is necessary. Could we consider moving the formatter as part of the constructor arguments in this case? I'd appreciate your thoughts on this suggestion.

vi.mock('url', async (importOriginal) => {
    const mod = await importOriginal()
    return {
       default: {
         ...mod,
        pathToFileURL: vi.fn().mockImplementation((filePath) => ({
                href: 'progress'
        })),
        fileURLToPath: vi.fn().mockImplementation(() => '')
       }
   }
})

vi.mock("path", async (importOriginal) => {
    const mod = await importOriginal()
    return {
        ...mod,
        resolve: vi.fn().mockImplementation((...paths) => ""),
   }
})

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.

Awesome, LGTM 👍

@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Sep 9, 2023
@christian-bromann christian-bromann merged commit f687404 into webdriverio:main Sep 9, 2023
@christian-bromann
Copy link
Member

Just fyi: the windows tests are failing due to not meeting the coverage treshold. I don't want to block PRs because of this so I will adjust it in main. We overall have a pretty good test coverage.

@tamil777selvan tamil777selvan deleted the cucumber_report_fix branch September 10, 2023 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants