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

fix: make failing e2e tests to create screenshot #22536

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

nallikaea
Copy link
Contributor

@nallikaea nallikaea commented Sep 20, 2023

@nallikaea nallikaea linked an issue Sep 20, 2023 that may be closed by this pull request
@che-bot che-bot added kind/bug Outline of a bug - must adhere to the bug report template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. target/branch Indicates that a PR will be merged into a branch other than master. labels Sep 20, 2023
Copy link
Contributor

@dkwon17 dkwon17 left a comment

Choose a reason for hiding this comment

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

Other than the error, it is working on my end:

image

Thank you for the quick fix!


// take page source and write to file
const pageSource: string = await this.driverHelper.getDriver().getPageSource();
const pageSourceStream: WriteStream = fs.createWriteStream(pageSourceFileName);
pageSourceStream.write(Buffer.from(pageSource));
pageSourceStream.end();
pageSourceStream.write(Buffer.from(pageSource), (): WriteStream => pageSourceStream.end());
Copy link
Contributor

Choose a reason for hiding this comment

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

I am getting an error when I run npm run test because of WriteStream type:

Generating index.ts file...
utils/CheReporter.ts:156:81 - error TS2322: Type 'void' is not assignable to type 'WriteStream'.

156    screenshotStream.write(Buffer.from(screenshot, 'base64'), (): WriteStream => screenshotStream.end());
                                                                                    ~~~~~~~~~~~~~~~~~~~~~~

utils/CheReporter.ts:161:71 - error TS2322: Type 'void' is not assignable to type 'WriteStream'.

161    pageSourceStream.write(Buffer.from(pageSource), (): WriteStream => pageSourceStream.end());
                                                                          ~~~~~~~~~~~~~~~~~~~~~~


Found 2 errors in the same file, starting at: utils/CheReporter.ts:156

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed
updated hasky pre-commit hook to prevent this kind of errors

Copy link
Contributor

@dmytro-ndp dmytro-ndp left a comment

Choose a reason for hiding this comment

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

looks good to merge

@nallikaea nallikaea merged commit b6eb83e into eclipse-che:main Sep 21, 2023
2 checks passed
@nallikaea nallikaea deleted the 22529 branch September 21, 2023 07:39
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. target/branch Indicates that a PR will be merged into a branch other than master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing e2e tests does not create screenshot
4 participants