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

Resolve module issue and missing data folder #3

Merged
merged 1 commit into from
Jun 11, 2022
Merged

Resolve module issue and missing data folder #3

merged 1 commit into from
Jun 11, 2022

Conversation

mrmckeb
Copy link
Contributor

@mrmckeb mrmckeb commented Jun 2, 2022

First, thanks for the helpful package!

This PR resolves two issues:

  • The data folder may not be present if no screenshots or traces were captured.
  • playwright-core may not exist in the specified location. Instead, this package will now find playwright-core directly.

Copy link
Owner

@anooprav7 anooprav7 left a comment

Choose a reason for hiding this comment

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

LGTM

@mrmckeb
Copy link
Contributor Author

mrmckeb commented Jun 12, 2022

Thanks @anooprav7 - just a note that this fix was also needed.
#2

We ran into this issue too and I pulled this into my fork, but not the PR I submitted.

@anooprav7
Copy link
Owner

Ok, checking that now. Thanks

@mstepin
Copy link

mstepin commented Jun 12, 2022

@anooprav7 I think I'm running described above. I took your 0.2.1 version. It now at least doesn't fail when the folders are missing, but am finding that some tests are missing in the merged report. It also now finds the playwright-core module.
In CI I get a slightly different error though. I've not looked into your code as I haven't had time, but I'm hoping it is related to this. The merged HTML report generated in CI has the index / title page working fine, but clicking into any tests just results in blank pages.

@mrmckeb
Copy link
Contributor Author

mrmckeb commented Jun 12, 2022

That'll be fixed by this, @mstepin :)
#2

@anooprav7
Copy link
Owner

#2 has also been merged with #4 (new PR because of merge commits)

@anooprav7
Copy link
Owner

@mstepin new package version 0.2.2 with the fix merged.

@mstepin
Copy link

mstepin commented Jun 14, 2022

Hi @anooprav7 thanks for the fix. I tried it today, and at least no tests are missing on the summary. However drilling into tests in a merged report still results in a blank page.

@mstepin
Copy link

mstepin commented Jun 14, 2022

In addition videos and screenshots are not available on merged reports for failed tests.

EDIT:
seems @nickofthyme 's changes here fixes all the abovementioned issues.

@mrmckeb
Copy link
Contributor Author

mrmckeb commented Jun 16, 2022

Thanks again for all of your work on this @anooprav7!

@mstepin
Copy link

mstepin commented Jun 16, 2022

Apologies, I tested the changes locally and they all worked, as I have node 14 locally. This change unfortunately breaks things for us in CI as it makes it no longer node 12 compatible (which is what we have in CI) as it uses ECMA2020 features such as the nullish coalescing syntax ??:

/tmp/jenkins-18f5e62e/workspace/Libraries/pipeline_testing/Pipeline Testing - E2E/e2e/node_modules/playwright-merge-html-reports/dist/merge-reports.js:33
        const [, base64Str] = re.exec(indexHTMLContent) ?? [];

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:1072:16)
    at Module._compile (internal/modules/cjs/loader.js:1122:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/tmp/jenkins-18f5e62e/workspace/Libraries/pipeline_testing/Pipeline Testing - E2E/e2e/lib/helpers/playwrightReportHelper.js:2:30)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
script returned exit code 1

@mstepin
Copy link

mstepin commented Jun 16, 2022

I do appreciate all the work that has gone into this though. Thanks everyone.
I'll look to get the ball rolling to have our CI AMIs baked in with node 14 or higher, once we sift through all the dependencies. Will have to roll back to 0.2.2 for now so it at least doesn't exit the CI flow. If you guys decide to make it node 12 resilient instead, please let me know asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants