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

Full page screenshot support in Chrome #294

Conversation

PiteroS678
Copy link
Contributor

Description

Updated nu.validator version from 15.6.29 to 17.11.1
Updated ResolutionModifier to take full page screenshots in Chrome.
Updated HideModifier wiki
Updated suites & tests

Motivation and Context

AET supports Chrome as well as Firefox

Screenshots (if appropriate):

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.

smoczysko88 and others added 24 commits July 18, 2018 12:44
…anges.

Removed form which caused screen comparator stabilization issues.
… into bugfix/aet-integration-tests-stabilization
… into bugfix/aet-integration-tests-stabilization
… into bugfix/aet-integration-tests-stabilization
… into bugfix/aet-integration-tests-stabilization
…rade' into bugfix/aet-integration-tests-stabilization
…om:Cognifide/aet into bugfix/aet-integration-tests-stabilization
…om:Cognifide/aet into bugfix/aet-integration-tests-stabilization
@tkaik tkaik changed the title Bugfix/aet integration tests stabilization Full page screenshot support in Chrome, Jul 27, 2018
@tkaik tkaik changed the title Full page screenshot support in Chrome, Full page screenshot support in Chrome Jul 27, 2018
@tkaik tkaik changed the base branch from milestone/chrome-support to master July 30, 2018 10:51
@tkaik tkaik changed the base branch from master to milestone/chrome-support July 30, 2018 10:51
Copy link
Contributor

@malaskowski malaskowski left a comment

Choose a reason for hiding this comment

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

Please update Open module documentation. Please describe how it works, what is does with Chrome (e.g. waiting for DOM objects). What are differences between Chrome and Firefox.


@Deprecated
private boolean maximize;
private Optional<Integer> height;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not use Optional as a type of a field. Please make it Integer.

import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.RemoteWebDriver;

import static org.mockito.Mockito.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't use * in import.

@@ -35,14 +35,17 @@
</urls>
</test>

<!-- Chrome shows this error in console (FF didn't) that's why this error is being filtered. TODO: Remove this test or mark it as Failed and correct bobcat assertions -->
Copy link
Contributor

Choose a reason for hiding this comment

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

This TODO is done?

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 ok to keep this JS error filter here and just remove this TODO

localHeight = Integer
.parseInt(js.executeScript(JAVASCRIPT_GET_BODY_HEIGHT).toString());
if (localHeight > MAX_SIZE) {
LOG.info("Height is over browser limit, changing height to " + MAX_SIZE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of string concatenation, use logger {} feature. And this should be warning.

private static final String WIDTH_PARAM = "width";

private static final String HEIGHT_PARAM = "height";

private static final int MAX_SIZE = 100000;
private static final String JAVASCRIPT_GET_BODY_HEIGHT = "return document.body.scrollHeight";
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add those changes into resolution modifier documentation:

  • height param is no longer mandatory,
  • max page height,
  • how does AET detect page height,
  • remove maximize parameter

Copy link
Contributor Author

@PiteroS678 PiteroS678 Jul 31, 2018

Choose a reason for hiding this comment

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

Updated - 5f5e26c

@@ -24,6 +24,7 @@
<test name="S-comparator-Layout">
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm missing here some tests, that will check page with auto-height detection and fixed-height, e.g.:

  • there is always changing element at the bottom of a page, scenario:
    • F with auto-height detection
    • S with fixed-height (let's say 100px), because screenshot does not contain this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added - 0ae1f70

@@ -6,7 +6,8 @@ Module name: **hide**

| ! Important information |
|:----------------------- |
| In order to use this modifier it must be declared after the open module in the definition of the test suite XML. |
| *In order to use this modifier it must be declared after the open module in the definition of the test suite XML.
*In order to use this modifier with Resolution Modifier it must be declared before the Resolution Modifier.|
Copy link
Contributor

Choose a reason for hiding this comment

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

Please explain why - e.g. because the Hide modifier might affect the total height of the page (when used without leaveBlankSpace="true")

|:----------------------- |
| You cannot maximize the window and specify the dimension at the same time. If you specify height param you have to also specify width param and vice versa. |
| Note |
| When height is not specified then it's compute by JavaScript. <br/> If the resolution is specified without height parameter it should be specified after open. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the typo compute -> computed and make the open a link text that points to https://github.com/Cognifide/aet/wiki/Open

if (params.containsKey(HEIGHT_PARAM)) {
height = NumberUtils.toInt(params.get(HEIGHT_PARAM));
ParametersValidator
.checkRange(height, 1, MAX_SIZE, "Height should be greater than 0");
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's put here more verbose info:

"Height should be greater than 0 and smaller than " + MAX_SIZE

Copy link
Contributor

@malaskowski malaskowski left a comment

Choose a reason for hiding this comment

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

Please update CHANGELOG according to AET Contributing rules

@malaskowski malaskowski merged commit 5d12f34 into milestone/chrome-support Aug 3, 2018
@malaskowski malaskowski deleted the bugfix/aet-integration-tests-stabilization branch August 3, 2018 10:29
@tkaik tkaik mentioned this pull request Aug 21, 2018
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants