Skip to content

Instantly share code, notes, and snippets.

@klamping
Created October 22, 2013 16:59
Show Gist options
  • Select an option

  • Save klamping/7104237 to your computer and use it in GitHub Desktop.

Select an option

Save klamping/7104237 to your computer and use it in GitHub Desktop.

Revisions

  1. klamping created this gist Oct 22, 2013.
    50 changes: 50 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@
    Script to build URLs
    https://github.com/cgiffard/node-simplecrawler

    Script to build CSS selector file
    https://github.com/caplin/SuperSelector
    http://selectorgadget.com/

    Script to convert :hover, :focus, etc to .hover, .focus etc
    https://github.com/jacobrask/styledocco/blob/master/share/previews.js
    Apply for any selectors that match

    Script to parse css
    https://github.com/NV/CSSOM

    var els = [];
    var selectors = 'td:nth-child(1) , #style, .output-cell';
    var arr = selectors.split(',');
    arr.forEach(function (selector){ els = els.concat([].slice.call(document.querySelectorAll(selector))); })
    els.forEach(function (el) { console.log(el) });

    Script to take screenshots and save (localStorage?) (also, looping through repeated elements)
    http://html2canvas.hertzen.com/examples.html

    Script to save screenshots to hard drive?
    Script to compare screenshots to existing source
    https://github.com/HumbleSoftware/js-imagediff
    https://github.com/thingsinjars/Hardy/blob/master/features/support/imagetest.js
    http://huddle.github.io/Resemble.js/

    Script to integrate with selenium and make all this come together
    WebDriver
    Selenium to do test execution, driving of browsers (but can also be run w/o selenium)
    https://saucelabs.com/builder


    var elementSelector = selectors(elementName);
    imageTest.init({
    screenshotRoot: process.env.TESTPATH + '/screenshots',
    processRoot: process.env.BINARYPATH,
    webdriver: this
    });
    imageTest.screenshot(elementSelector, function(err, result) {
    if (err) {
    return callback.fail(err);
    }
    if (result.status === 'firstrun') {
    return callback.fail(new Error("First time this test has been run. New test cases have been created."));
    }
    imageTest.compare(result.value, callback);
    });