Skip to content

Don't create thumbnails by default #6078

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

Merged
merged 2 commits into from
Aug 22, 2021
Merged

Conversation

taiki-fw
Copy link
Contributor

@taiki-fw taiki-fw commented Mar 24, 2021

Purpose

Make thumbnails generation customizable when taking screenshots.
(By default, thumbnails are not generated when taking screenshots.)

Approach

  • Added thumbnails to Screenshot Options for the -s (--screenshots) command line flag. (e.g. -s thumbnails=true)
  • Added the thumbnails parameter of the screenshots API method. (e.g. takeScreenshot({thumbnails: true}))

References

resolved #1550

Pre-Merge TODO

  • Write tests for your proposed changes
  • Make sure that existing tests do not fail

Sorry, something went wrong.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 24, 2021
@testcafe-build-bot
Copy link
Collaborator

@taiki-fw taiki-fw marked this pull request as ready for review March 27, 2021 14:23
@testcafe-build-bot
Copy link
Collaborator

@testcafe-build-bot
Copy link
Collaborator

Copy link
Contributor

@AndreyBelym AndreyBelym left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! The code is very good, but I feel that we should discuss some points:

  1. Disabling thumbnails by default can be considered as a breaking change. If someone has a scripts that simply counts all files in the screenshots directory, they will have failed tests after this change. So let's just use true as the default value for the thumbnails options.
  2. It's awesome that you added a functional test. Could you please add some a unit test for the configuration parser:
    https://github.com/DevExpress/testcafe/blob/master/test/server/configuration-test.js#L159

@AndreyBelym AndreyBelym removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 9, 2021
@AndreyBelym
Copy link
Contributor

Hi @taiki-fw, would you like to address my suggestions? If you don't plan to maintain this PR anymore, I can assign myself or some other TestCafe developer to it.

@taiki-fw
Copy link
Contributor Author

taiki-fw commented Apr 27, 2021

Hi! @AndreyBelym. Thank you for replying to the message.
Sorry, I couldn't handle it because I was busy.
But, I want to deal with your suggestion on May 1st.
Please wait a little more:pray:.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 27, 2021
@miherlosev miherlosev removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 29, 2021
@taiki-fw taiki-fw temporarily deployed to authentication May 1, 2021 13:41 Inactive
@taiki-fw taiki-fw temporarily deployed to CI May 1, 2021 13:41 Inactive
@taiki-fw taiki-fw temporarily deployed to authentication May 1, 2021 14:30 Inactive
@taiki-fw taiki-fw temporarily deployed to CI May 1, 2021 14:30 Inactive
@taiki-fw
Copy link
Contributor Author

taiki-fw commented May 1, 2021

Hi! @AndreyBelym.
I deal with your suggestion , so please review it.
I made a different change from the original Purpose and Approach, should I change it?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 1, 2021
@wentwrong
Copy link
Contributor

@taiki-fw, thank you for addressing the suggestions. We'll review this PR and get back to you soon.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label May 3, 2021
@miherlosev miherlosev requested a review from AndreyBelym May 4, 2021 06:36
@AndreyBelym AndreyBelym temporarily deployed to authentication May 6, 2021 12:15 Inactive
@AndreyBelym AndreyBelym temporarily deployed to CI May 6, 2021 12:16 Inactive
@AndreyBelym AndreyBelym temporarily deployed to authentication May 6, 2021 13:15 Inactive
@AndreyBelym AndreyBelym temporarily deployed to CI May 6, 2021 13:17 Inactive
@AlexKamaev AlexKamaev temporarily deployed to CI June 22, 2021 11:20 Inactive
@AlexKamaev AlexKamaev temporarily deployed to authentication June 28, 2021 13:12 Inactive
@AlexKamaev AlexKamaev temporarily deployed to CI June 28, 2021 13:26 Inactive
@AlexKamaev AlexKamaev temporarily deployed to authentication July 13, 2021 08:57 Inactive
@AlexKamaev AlexKamaev temporarily deployed to CI July 13, 2021 08:58 Inactive
@miherlosev miherlosev temporarily deployed to authentication July 15, 2021 11:48 Inactive
@miherlosev miherlosev temporarily deployed to CI July 15, 2021 11:49 Inactive
@miherlosev miherlosev temporarily deployed to authentication August 20, 2021 11:15 Inactive
@miherlosev miherlosev temporarily deployed to CI August 20, 2021 11:16 Inactive
@miherlosev miherlosev merged commit 4f1ba62 into DevExpress:master Aug 22, 2021
@joma74
Copy link

joma74 commented Sep 16, 2021

1.16.0

  • Does not work if via runTestCafe programmatic configuration
  • typescript definitions not updated

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 16, 2021
@miherlosev
Copy link
Collaborator

miherlosev commented Sep 20, 2021

Does not work if via runTestCafe programmatic configuration

I ran a test using the programmatic interface - everything works correctly on my side.
run.js

(async () => {
    const createTestCafe = require('testcafe');

    const testcafe = await createTestCafe();

    await testcafe
        .createRunner()
        .src('test.ts')
        .browsers('chrome')
	.screenshots({ thumbnails: false })
        .run();

    await testcafe.close();
})();

test.ts

fixture `Fixture`;

test('test', async t => {
	await t.takeScreenshot();
});

Could you please share an example where the issue is reproduced?

typescript definitions not updated

I created a PR with the definition update.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 20, 2021
@joma74
Copy link

joma74 commented Sep 20, 2021

Confirm that object style option works as per your example. Which i will switch to as soon as that TS Def is available :)

But, comment refered to the parameter style option https://testcafe.io/documentation/402654/reference/testcafe-api/runner/screenshots which is described as:
obsolete: screenshots(path [, takeOnFails] [, pathPattern] [,fullPage] [,thumbnails]) → this.

Definition of obsolete is missing for me. Do you mean deprecated? That is supported but will be removed in future version?

If parameter style option is still supported, this case is not working. Plus the TS Def for that style is also missing.

Example:
.screenshots( // @ts-ignore ENVMODE.hasVDevelopment() ? process.env["npm_package_config_screenshots_dev"] : process.env["npm_package_config_screenshots_prod"], true, process.env["npm_package_config_screenshot-path-pattern"], // @ts-ignore false, // @ts-ignore false, )

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 20, 2021
@miherlosev
Copy link
Collaborator

Definition of obsolete is missing for me. Do you mean deprecated?

Yes, you are right. Deprecated is a more suitable word. I created an issue for this.

If parameter style option is still supported, this case is not working. Plus the TS Def for that style is also missing.

The new options are only supported when using the 'object parameter' style. The TypeScript definitions are present for the supported options. In the future, we have plans to add a warning when using deprecated API.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 22, 2021
@AlexSkorkin AlexSkorkin mentioned this pull request Jul 11, 2022
1 task
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.

Don't create thumbnails by default
7 participants