GithubHelp home page GithubHelp logo

retest / recheck-web-js Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 3.0 1.19 MB

recheck for web apps – change comparison tool with Golden Masters and Git-like ignore syntax.

Home Page: https://retest.de

License: GNU Affero General Public License v3.0

TypeScript 99.48% JavaScript 0.52%
regression regression-testing regression-automation test-automation testing-tools testing-framework assertion-framework visual-regression-testing golden-master snapshot-testing

recheck-web-js's Introduction

recheck-web-js

Build Status Latest recheck on Maven Central license PRs welcome code with hearth by retest

This is the JavaScript behind recheck-web and the corresponding Chrome extension. What it does is collect all attributes of all elements of the rendered DOM. This can then be collected by recheck-web or sent to retest.de.

Installation

npm i recheck-web-js

Usage

TypeScript / es6

import { mapElement } from "recheck-web-js";

var htmlNode = document.getElementsByTagName("html")[0];
var html = transform(htmlNode);
var allElements = mapElement(htmlNode, "//html[1]", {
    "//html[1]" : html
});
console.log(allElements);

Test

npm run test

Release

The release of npm module and webjar is performed on travis. To trigger a build update the version in npm files and create a tag with:

npm version patch && git push --tags

If you want to release a minor version use:

npm version minor && git push --tags

recheck-web-js's People

Contributors

beatngu13 avatar dependabot-preview[bot] avatar dependabot[bot] avatar lliu33 avatar martin-v avatar mergify[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

recheck-web-js's Issues

Add basic image comparison functionality

Problem

Based on this discussion, I believe it would be helpful to have a very basic image comparison functionality. Many GUIs such as websites have e.g. icons or image banners. Currently, we aren't notified when such content changes—which is not ideal for a lib that is said to support visual testing.

Solution

As suggested by @roesslerj, a very basic implementation could try to extract hashes for images and then these hashes can be compared.

Also, the question arises if we can remove the legacy stuff from de.retest.recheck.image.

Consider using visible text for text

Text (key text) is currently extracted via nodeValue (see getText), i.e., the node's actual text value. The problem is that the text might be displayed differently, for example, if a certain text-transform is applied. So when a node's text is "foo", this could be displayed as "Foo", "FOO", …

The WebDriver link text locator retrieves the rendered text via the Get Element Text command:

Let rendered text be the result of performing implementation-specific steps whose result is exactly the same as the result of a Call(bot.dom.getVisibleText, null, element).

We might want to consider to do this is as well, but:

  1. Is dom.js available in the browser? If yes, in any browser? If no, do we have to bundle the script since we don't want to reimplement the functionality?
  2. What do we do with redundant information such as text-transform, which is then reflected in the rendered text?
  3. How can this be properly tested?

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.