Skip to content

canofm/agileengine-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Component finder in HTML Challenge

Challenge

The idea is for the given component taken from the original HTML, lookup for the most similar component in other HTML.

Approach

The approach I took was to make many comparator, which compares with the original: text, tag, attributes, CSS styles. Every comparator returns a score for that element and then it's classified. Finally, we just took the element with the highest score.

How to use it

  1. Install dependencies
yarn install
  1. In your shell:
yarn find <original sample> <diff sample> <element id?>

NOTE: element id is optional, by default it takes: "make-everything-ok-button"

Example:

yarn find samples/sample-0-origin.html samples/sample-1-evil-gemini.html

The output is the XPath to the element and its HTML.

Test

yarn test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published