element icon indicating copy to clipboard operation
element copied to clipboard

takeScreenshot png saved with jpeg extension

Open vhermecz opened this issue 3 years ago • 0 comments

Describe the bug Screenshots are saved with jpeg extension even if takeScreenshot is called with {type:"png"}. NOTE: The file content IS png as expected.

To Reproduce Steps to reproduce the behavior:

export default () => {
	step('Load test report', async (browser: Browser) => {
		await browser.visit('https://google.com', {
			waitUntil: 'load',
		});
		await browser.wait(5);
		await browser.takeScreenshot({fullPage: true, type: "png"});
	});
};

Expected behavior Would expect screenshots to be created with extension png. Instead their extension is jpeg, the content is indeed png as one would expect.

Additional context

  • https://github.com/flood-io/element/blob/1c95ba6a5dfdd3c5e3d4ef6b7cf6fc41d991e1ac/packages/core/src/runtime/Browser.ts#L422
  • https://github.com/flood-io/element/blob/1c95ba6a5dfdd3c5e3d4ef6b7cf6fc41d991e1ac/packages/core/src/runtime/Browser.ts#L541 saveScreenshot does not receive the options thus it is unaware of the expected extension.

vhermecz avatar Mar 17 '22 16:03 vhermecz