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

Hotfix/screen max height #387

Merged
merged 6 commits into from
Oct 17, 2018
Merged

Hotfix/screen max height #387

merged 6 commits into from
Oct 17, 2018

Conversation

Jakub-Izbicki
Copy link
Contributor

@Jakub-Izbicki Jakub-Izbicki commented Oct 11, 2018

Change max allowed screenshot pixels height to 35k.

Description

After lowering of max allowed screenshot height from 100k to 15k, some projects were unable to test some of their long pages. After testing, this pr changes the value to 35k pixels.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the AET Contributor License Agreement.

CHANGELOG.md Outdated
@@ -15,6 +15,7 @@ All notable changes to AET will be documented in this file.

- [PR-380](https://github.com/Cognifide/aet/pull/380) Exclude elements position calculated with partial screenshot offset ([#379](https://github.com/Cognifide/aet/issues/379))
- [PR-378](https://github.com/Cognifide/aet/pull/378) OSGI-configurable Chrome options.
- [PR-enter pr no. here](https://github.com/Cognifide/aet/pull/prNumber) Set max allowed page screenshot height to 35k pixels.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please enter this number here please :) ?

@@ -41,7 +41,7 @@

private static final String JAVASCRIPT_GET_BODY_HEIGHT = "return document.body.scrollHeight";

private static final int MAX_SIZE = 15000;
private static final int MAX_SIZE = 35000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update Resolution Modifier wiki.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

<test name="S-comparator-Layout-long-page-without-dynamic-at-bottom">
<collect>
<open/>
<resolution width="767"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please leave here ToDo comment with info that resolution-sleep-resolution workaround should be removed after #357 is fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -474,5 +474,38 @@
<url href="comparators/layout/failed.jsp"/>
</urls>
</test>

<test name="F-comparator-Layout-dynamic-element-at-bottom-of-long-page">
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please explain what is the idea for this failing test?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's about checking if AET are capable of taking partial screenshot of element located at the bottom (.dynamic2) of a very long page.
@Jakub-Izbicki I think you could also add a test (F- type) which takes the screenshot of the whole page without excluding the dynamic content at the bottom - this way we'll check if AET is capable of taking such big screenshots.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tkaik You are right about what the test does. Concerning your suggestion about additional test: I don't think it is necessary as, as far I noticed, AET is always doing a full page screenshot, regardless whether partial is present or not? Take a look:

  private byte[] takeScreenshot() throws ProcessingException {
    try {
      if (isSelectorPresent()) {
        SeleniumWaitHelper
            .waitForElementToBePresent(webDriver, getLocator(), getTimeoutInSeconds());
        return getImagePart(getFullPageScreenshot(), webDriver.findElement(getLocator()));
      } else {
        return getFullPageScreenshot();
      }
      . . .

Copy link
Contributor

Choose a reason for hiding this comment

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

@Jakub-Izbicki You're right, I never noticed that :) However the full screenshot is taken but it's immediately changed to a partial-image - the full screenshot is not saved in the database or displayed on the report - I think it's good idea to test such case as well. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, fixed!

@tkaik tkaik merged commit 84af4d9 into master Oct 17, 2018
@tkaik tkaik deleted the hotfix/screen-max-height branch October 17, 2018 10:12
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