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

When takeOnFails is triggered, fullPage is ignored: the screenshot is not full-page. #7761

Closed
DanKaplanSES opened this issue Jun 5, 2023 · 3 comments
Assignees
Labels
FREQUENCY: level 1 Good first issue TYPE: bug The described behavior is considered as wrong (bug).

Comments

@DanKaplanSES
Copy link

DanKaplanSES commented Jun 5, 2023

What is your Scenario?

I want to create a screenshot of the entire page on failure. .takeScreenshot({fullPage: true}) in my test does this, but "takeOnFails": true, "fullPage": true in my configuration does not.

What is the Current behavior?

A non-fullscreen screenshot is taken.

What is the Expected behavior?

A fullscreen screenshot is taken.

What is your public website URL? (or attach your complete example)

https://advancedinstaller.com/blog/page-1.html

What is your TestCafe test code?

import { Selector } from 'testcafe';

fixture.only`test`.page(`https://advancedinstaller.com/blog/page-1.html`);

test(`test screenshot of blog page`, async (t) => {
  await t
    .resizeWindow(768, 800)
    .click(Selector('#cookies button'))
    .click(Selector('#cookies button').withText('There is no way this exists'));
});

Your complete configuration file

{
  "browsers": ["firefox:headless"],
  "screenshots": {
    "takeOnFails": true,
    "fullPage": true
  },
  "compilerOptions": {
    "typescript": {
      "customCompilerModulePath": "../typescript",
      "options": { "forceConsistentCasingInFileNames": "false" },
      "configPath": "tsconfig.testcafe.json"
    }
  }
}

Your complete test report

No response

Screenshots

image

Steps to Reproduce

import { Selector } from 'testcafe';

fixture.only`test`.page(`https://advancedinstaller.com/blog/page-1.html`);

test(`test screenshot of blog page`, async (t) => {
  await t
    .resizeWindow(768, 800)
    .click(Selector('#cookies button'))
    .click(Selector('#cookies button').withText('There is no way this exists'));
});

TestCafe version

2.5.0

Node.js version

v18.15.0

Command-line arguments

'tsc/**.ts'"

Browser name(s) and version(s)

113.0.2 (64-bit)

Platform(s) and version(s)

Windows 10

Other

This has been around for a while and probably exists on chrome browsers, too; I've basically turned this comment into its own issue.

@DanKaplanSES DanKaplanSES added the TYPE: bug The described behavior is considered as wrong (bug). label Jun 5, 2023
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 5, 2023
@AlexKamaev
Copy link
Contributor

I managed to reproduce the issue. I confirm that the fullPage option is ignored in debugOnFail mode. We will research the issue on our side, but I can't give you any promises or time estimates. Thank you for your report.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 5, 2023
@DanKaplanSES
Copy link
Author

DanKaplanSES commented Jun 5, 2023

I managed to reproduce the issue. I confirm that the fullPage option is ignored in debugOnFail mode.

I'm not sure I'm familiar with debugOnFail. Did you mean takeOnFails?

Thanks for your reply.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 5, 2023
@AlexKamaev
Copy link
Contributor

AlexKamaev commented Jun 6, 2023

Yes, I meant the takeOnFails option. Sorry for the typo.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 6, 2023
@Bayheck Bayheck self-assigned this Nov 8, 2023
aleks-pro pushed a commit that referenced this issue Nov 22, 2023
<!--
Thank you for your contribution.

Before making a PR, please read our contributing guidelines at

https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution

We recommend creating a *draft* PR, so that you can mark it as 'ready
for review' when you are done.
-->

## Purpose
There is an option for testcaferc configuration file called takeOnFails.
The issue here was that the screenshot taken by takeOnFails was not
responding to option fullPage. The screenshot was always small.

## Approach
I found the place where the fullPage option was not passing. Fixed it by
passing fullPage option to TakeScreenshotOnFailCommand.

## References
#7761

## Pre-Merge TODO
- [x] Write tests for your proposed changes
- [x] Make sure that existing tests do not fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FREQUENCY: level 1 Good first issue TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

4 participants