Giter Site home page Giter Site logo

redecheck / redecheck Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 4.0 284.55 MB

:zap: Automatically Detecting Layout Failures in Responsive Web Pages

Home Page: http://redecheck.org

License: MIT License

JavaScript 3.78% Java 95.16% Shell 1.06%
layout-testing research-tool responsive-web-design testing

redecheck's Introduction

Welcome to ReDeCheck!

ReDeCheck (REsponsive DEsign CHECKer, pronounced “Ready Check”) is an automated tool designed to aid developers during the process of testing the layouts of responsive (i.e., "mobile ready") web sites. With the huge range of devices currently available, performing adequate quality assurance on a sufficient range of devices is extremely difficult, if not impossible. ReDeCheck extracts the layout of a web page at a wide variety of viewport widths, from smartphones to desktops, then analyses the layout behaviour found to detect common RWD layout issues, such as overlapping elements, elements overflowing their containers or the viewport, and incongruous wrapping elements. Since it is important to have a high-quality mobile-ready web site, ReDeCheck makes responsive web testing both efficient and effective!

Installing Maven

The ReDeCheck project has been implemented using Maven, a build automation tool for projects programmed in the Java programming language. If you wish to build the ReDeCheck tool from its source code, then you will first need to install Maven on your workstation. If you have already installed Maven, then please go directly to the next section. Otherwise, follow the installation guidelines at https://maven.apache.org/install.html.

Downloading ReDeCheck

Clone the ReDeCheck project repository using either a graphical Git client or by running the following command at the prompt of your terminal window:

git clone https://github.com/redecheck/redecheck.git

Installing ReDeCheck

As ReDeCheck has been implemented as a Maven project using the Java programming language, the easiest method of generating the executable tool involves importing the project into an integrated development environment (IDE) and generating the Java archive (JAR) from inside the IDE. Instructions are presented for doing this using two common IDEs: Eclipse (https://www.eclipse.org/downloads/) and IntelliJ (https://www.jetbrains.com/idea/download/). However, if you would prefer to build the project using the command line in an appropriate terminal emulator, then instructions to do so are also provided.

Dependencies

The pom.xml file provided in the repository will handle the vast majority of dependencies needed for ReDeCheck to install and run correctly. However, before attempting to run ReDeCheck to test your websites, please ensure your setup is complete with the following requirements:

Resources

The resources provided in the repository are for use on MacOS machines, so if you're running Windows or Linux as your operating system, you'll need to replace them with the linux versions, from the links below:

https://sites.google.com/a/chromium.org/chromedriver/

https://github.com/mozilla/geckodriver/releases/

http://phantomjs.org/

Java Version

ReDeCheck has been implemented to run using Java Development Kit (JDK) 7 or 8, which can be downloaded from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html and http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, respectively. Instead of downloading the JDK from one of the aforementioned web sites, you can also use your operating system's package manager to install it correctly. After downloading and installing the JDK, you are also likely to have to set Java 1.7 (or, Java 1.8) as the chosen Java Development Kit for the ReDeCheck project. Please follow the instructions provided by either your operating system or your integrated development environments to accomplish this task.

Firefox

ReDeCheck uses the popular Mozilla Firefox web browser to render and analyse the web page under test. Currently, it has been tested on version 46, which is available at https://ftp.mozilla.org/pub/firefox/releases/46.0/, for all major operating systems. Simply download and install the relevant version for your setup and ReDeCheck will handle the rest. There is no need to manually add Firefox into your PATH variable, as the tool will automatically find it on your workstation.

As there are a large number of options available, here is an example. To install on MacOS, first select mac/ and then select your desired language (e.g. en-GB for English UK). Please be careful to not simply download the SDK (e.g. firefox-46.0.mac-x86_64.sdk.tar.bz2) as this will not provide you with an executable Firefox browser.

You may be able to use ReDeCheck with a more recent version of Firefox, but due to widely reported communication issues between Selenium and Firefox version 47 and later, there is a chance it may not execute correctly. If this is the case, using version 46 should solve the issue.

Installation with Eclipse

  1. Select 'File' → 'Import'.
  2. From the project options, select 'Maven' → 'Existing Maven Projects'.
  3. Select the root directory of your downloaded copy of ReDeCheck.
  4. Click 'Finish' to complete the import.
  5. To generate the JAR file, select 'Run' → 'Run As' → 'maven install'.
  6. A JAR file called redecheck-jar-with-dependencies.jar should have been created in the target directory of ReDeCheck's main directory; if this JAR file does not exist, then the installation with Eclipse failed and you will not yet be able to use ReDeCheck. Please try these steps again or, alternatively, try another IDE or the command-line-based approach.

Installation with IntelliJ

  1. Select 'File' → 'Open'.
  2. Navigate to the root directory of your installation of ReDeCheck.
  3. Select the 'pom.xml' file and click 'Finish'.
  4. Open the Maven Projects toolbar using 'View' → 'Tool Windows' → 'Maven Projects'.
  5. Select the ReDeCheck project and click 'package'.
  6. A JAR file called redecheck-jar-with-dependencies.jar should have been created in the target directory of ReDeCheck's main directory; if this JAR file does not exist, then the installation with IntelliJ failed and you will not yet be able to use ReDeCheck. Please try these steps again or, alternatively, try another IDE or the command-line-based approach.

Installation at the Command Line

  1. Navigate to the root directory containing of your installation of ReDeCheck.
  2. Type the following command to build the tool: mvn package
  3. Maven will build the project from scratch, downloading all the required dependencies for the project automatically.
  4. A JAR file called redecheck-jar-with-dependencies.jar should have been created in the target directory of ReDeCheck's main directory; if this JAR file does not exist, then the installation with the command line failed and you will not yet be able to use ReDeCheck. Please try these steps again or, alternatively, try one of the methods that uses an IDE.

Directory Structure

Before presenting usage examples for the tool, below is the directory structure following a clean clone of the repository:

  • src - Contains all the source code and test code for the tool
  • resources - Contains various drivers required by the tool
  • readme-images - Contains images used by this README file

IMPORTANT - After running the tool for the first time, a reports directory will be created. This is where all the failure reports will be stored.

Running ReDeCheck

Once you have ReDeCheck correctly packaged and ready to run on your workstation, you have two options regarding the running of the tool:

  1. Run ReDeCheck on a fully live site on the World Wide Web.
  2. Run ReDeCheck on a local web page file.

Examples of how to run ReDeCheck in each configuration are shown below:

Running on a Live Site

Running ReDeCheck to test a live webpage is simple. Simply navigate into the target directory of your ReDeCheck installation (to make sure you're in the same directory as the executable .jar generated in the previous step) and run the following command: java -jar redecheck-jar-with-dependencies.jar --url http://conf.researchr.org/home/issta-2017

The above command will render the home page of the ISSTA 2017 Conference.

The ReDeCheck RLF repository

To aid with any potential replication of our experimental results, we have made the entire collection of 26 web pages used in our experimental study available here. To run ReDeCheck on any of the provided web pages, follow the intructions below entitled "Running on a Local Page".

Running on a Local Page

Running ReDeCheck to test a local web page is simple. Simply navigate into the target directory of your ReDeCheck installation (to make sure you're in the same directory as the executable .jar generated in the previous step) and run the following command, which runs the Duolingo example from a local clone of the webpage repository: java -jar redecheck-jar-with-dependencies.jar --url Duolingo/index.html --preamble /Users/joebloggs/redecheck-rlf-examples/

To explain how the various parameters are combined into a full local file path for ReDeCheck to use, the above example is now explained step-by-step.

Parameter Description
--preamble The root directory in which all your local website files are stored
--url The directory containing the web page you want to test

The full file path produced in this example is Users/joebloggs/redecheck-rlf-examples/Duolingo/index.html, so by simply changing any combination of these parameters you can test any local web page.

Understanding ReDeCheck's Reports

After the tool has finished analysing a webpage for responsive layout failures, it produces a report and a series of highlighted screenshots, which will be saved in the reports directory of your ReDeCheck installation, with each report marked with a timestamp, such as the example below:

reports
└───Duolingo
    └───index-2017-01-29_12-28-49
        │   fault-report.txt
        └───fault1
        │   └───overlapWidth600.png
        └───fault2
        │   └───overflowWidth800.png
        └───fault3
            └───wrappingWidth350.png       

Each issue listed in fault-report.txt is also highlighted in an accompanying screenshot. Subdirectories named faultXXX where XXX is the number of the failure in fault-report.txt contain the relevant screenshot.

Please note - If the tool detects no issues with the test web page, the directory for the report will not contain any /fault* subdirectories and fault-report.txt will simply state NO ERRORS DETECTED.

To get the most out of ReDeCheck, it is important to learn how to interpret these reports, thus making it as easy as is possible to locate and fix any detected problems.

As ReDeCheck is currently capable of detecting five different types of responsive layout failure, an example of each is presented below so you know what to expect when going through your own test reports.

Element Collision

Element collision failures occur when two elements that were not overlapping at wider widths begin to overlap as the viewport narrows. The two offending elements and the viewport widths at which the failure occurs are presented in the fault-report.txt file as follows:

ELEMENTS /HTML/BODY/DIV/DIV[2]/DIV/DIV[2] AND /HTML/BODY/DIV/DIV[2]/DIV/DIV/FORM/DIV ARE OVERLAPPING BETWEEN 768 AND 1132

The screenshot for the above failure is shown below: Highlighted image of element collision

Element Protrusion

Element protrusion failures occur when a container is no longer wide enough to fit all of its contents, so elements spill out into surrounding parts of the page. A failure report for this failure type is shown below:

/HTML/BODY/DIV[3]/DIV/DIV[2] OVERFLOWED ITS PARENT BETWEEN 801 AND 805
/HTML/BODY/DIV[3] , /HTML/BODY/DIV[3]/DIV/DIV[2] , SIBLING , 801 , 805 ,  {aboverightAlignoverlapping}

Highlighted image of element protrusion

Here we see an element (blue) reported as overflowing its parent (red) between 801px and 805px.

Viewport Protrusion

An extension of element protrusion, this failure type occurs when part or all of an element is pushed outside of the viewable portion of the page. They are reported as follows:

/HTML/BODY/DIV[2] overflowed the viewport window between 415 and 767

Highlighted image of viewport protrusion

Here we can clearly see the main content container (highlighted in red) overflowing the viewport window (highlighted in green), meaning everything to the right of the green vertical line will be unviewable to the user.

Small-Range Layouts

When developers make mistake in how their media queries turn on and off as the viewport resizes, weird layouts can be observed for a small number of viewport widths. An example is shown below:

SMALL RANGE ERROR:
	THIS: /HTML/BODY/DIV , /HTML/BODY/NAV , SIBLING , 990 , 991 ,  {belowleftAlignrightAlignxMidAlignoverlapping}
	PREV: /HTML/BODY/DIV , /HTML/BODY/NAV , SIBLING , 320 , 989 ,  {belowleftAlignrightAlignxMidAlign}
	NEXT: /HTML/BODY/DIV , /HTML/BODY/NAV , SIBLING , 992 , 1400 ,  {belowleftAlignrightAlignxMidAlign}

Highlighted image of small-range layout

Here we can see that for two viewport widths (990-991px), the header navigation links are displayed on a new line in the navbar (highlighted in blue), which in turn causes the header to overlap with the main content of the page (highlighted in red).

Wrapping elements

The final type of failure currently detected by ReDeCheck occurs when an element is no longer wide enough to render it's contents in a single row, so one element wraps onto a new line below. Below is an example:

WRAPPING ELEMENT ERROR FOR RANGE 456 -> 514:
	/HTML/BODY/DIV/DIV/FORM/BUTTON wrapped from row
	[ /HTML/BODY/DIV/DIV/FORM/INPUT /HTML/BODY/DIV/DIV/FORM/LABEL /HTML/BODY/DIV/DIV/FORM/BUTTON ]

Highlighted image of wrapping failure

The above example shows how as the viewport narrows, the form is not wide enough to render its three components side by side in a row, so the BUTTON (highlighted in red) wraps onto a new line.

Building and Execution Environment

All of the previous instructions for building, installing, and using ReDeCheck have been tested on MacOS 10.12 "Sierra" and Ubuntu Linux 15.04 "Vivid Vervet". All of the development and testing on the Mac OS X workstations was done with Java Standard Edition 1.7, while the same work was done with Java Standard Edition 1.8 on the Ubuntu workstation. While ReDeCheck is very likely to work on other Unix-based development environments, we cannot guarantee correct results for systems different than the ones mentioned previously. Currently, we do not provide full support for the building, installation, and use of ReDeCheck on Windows; forks and pull requests that provide this functionality are welcomed.

Problems or Praise?

If you have any problems with building, installing, or executing ReDeCheck, then please feel free to create an issue associated with this Git repository using the "Issues" link at the top of this site. The contributors to the redecheck-tool repository will do all that they can to resolve your issue and ensure that the entire tool works well in your development environment and for your web site. If you find that ReDeCheck works well, then we also encourage you to "star" and "watch" the project!

Thank you for your interest in responsive web testing and the ReDeCheck tool!

redecheck's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

redecheck's Issues

Is this tool still working currently with PhantomJS disabled?

This is an interesting project and I'd wanted to deploy it in my work, however since it has been four years for this project, firefox has come to version 58, and PhantomJS has deprecated.

I tried to build the ReDeCheck in Eclipse IDE but failed: MojoFailureException, it's said that this exception is triggered when there is something wrong with dependencies or sources of project.

Is this tools still available currently?

Can't run it

Hi, this is a really interesting tool and I'm interested in using it but I can't run it...

I downloaded and installed it in the development environment recommended in the readme:
OS is Ubuntu Linux 15.04 "Vivid Vervet"
Java Standard Edition 1.8
Mozilla Firefox 44

The project builds successfully using maven from the command line.

But when I try to run it, I get this:
screenshot from 2017-05-04 09 17 13
screenshot from 2017-05-04 09 17 21

I have no idea what I might be doing wrong, so if you could help me out I'd be really grateful!

Thanks!

Breaks on Infinite Scroll

Alright, so not sure if this is really an issue or me just giving information, but it breaks when run on websites that have infinite scroll enabled. Or, at least it did on youtube's mobile site (m.youtube.com). From what I've seen, it doesn't look like it really has a condition to handle those type of sites. It just kind of keeps scrolling and finding errors that aren't really relevant to the part of the page that it's looking at. So, it takes screenshots until it crashes, which in my case was probably a bit bigger than 331x26326 pixels. I'm not sure of the actual size that caused it to crash, but that was the newest screenshot. In addition, the screenshot was of an error that it had already detected earlier in the run. I feel like it should have a condition that tells it to stop scrolling when it gets to a certain point, if that is indeed what it is doing. Also, I'm not even sure what the error was because it was too big to fit in the terminal.

Reports not writing website name

I'm storing the reports outside of the ReDeCheck directory, but when it writes them it's just giving the dates and such rather than the website name and then the dates. It even just write the faults to a folder called "https" at one point. Any idea of what could be the cause of this?

Installation depandancie problem

Hi,

I'm using windows, and I've tryed to use your application in order to test a website.

But I've got installation problems when I try to install dependencies, I tryed it with eclipse and at the command line:
screenshot_13

I did not find how to resolv it after, here is the debugging report :
test.txt

Sorry for asking you here, but your application seems really convenient

Best Regards,
Rémi Matasse

NS_ERROR_SOCKET_ADDRESS_IN_USE

Not sure if this is just an issue with one of the linux components that I had to install manually, but it keeps giving me a socket in use error.
Here's some of the terminal output. It outputs the first one every time it opens a new instance of firefox, and then eventually quits with the second.

1506812158870 geckodriver INFO geckodriver 0.19.0
1506812158876 geckodriver INFO Listening on 127.0.0.1:19253
Sep 30, 2017 6:55:59 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
1506812159437 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.YSPZaMZarPWp"
1506812160782 Marionette INFO Listening on port 2828
Sep 30, 2017 6:56:59 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to original OSS JSON Wire Protocol.
1506812219835 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.rpQMbB6feMVV"
1506812220730 Marionette ERROR Error on starting server: [Exception... "Component returned failure code: 0x804b0036 (NS_ERROR_SOCKET_ADDRESS_IN_USE [nsIServerSocket.initSpecialConnection]" nsresult: "0x804b0036 (NS_ERROR_SOCKET_ADDRESS_IN_USE)" location: "JS frame :: chrome://marionette/content/server.js :: MarionetteServer.prototype.start :: line 111" data: no]
[Exception... "Component returned failure code: 0x804b0036 (NS_ERROR_SOCKET_ADDRESS_IN_USE) [nsIServerSocket.initSpecialConnection]" nsresult: "0x804b0036 (NS_ERROR_SOCKET_ADDRESS_IN_USE)" location: "JS frame :: chrome://marionette/content/server.js :: MarionetteServer.prototype.start :: line 111" data: no]
MarionetteServer.prototype.start@chrome://marionette/content/server.js:111:19
MarionetteComponent.prototype.init@resource://gre/components/marionettecomponent.js:185:5
MarionetteComponent.prototype.handle@resource://gre/components/marionettecomponent.js:100:5

org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions@76a3e297, browserName=firefox, moz:firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions@76a3e297, version=, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'fanne-VirtualBox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-35-generic', java.version: '1.8.0_131'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:259)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:247)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:242)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:238)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
at shef.utils.BrowserFactory.getNewDriver(BrowserFactory.java:23)
at shef.main.RLGExtractor.extract(RLGExtractor.java:100)
at shef.main.Tool.runFaultDetector(Tool.java:185)
at shef.main.Tool.<init>(Tool.java:136)
at shef.main.Tool.main(Tool.java:417)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.