webdrivercss icon indicating copy to clipboard operation
webdrivercss copied to clipboard

screenWidth not working

Open zanto001 opened this issue 7 years ago • 0 comments

If you don't set any screenWidth screenshots will be taked in tablet mode. If you want desktop mode for the screenshots its suggested in the official README to use screenWidth. Though what happens in my case is that a regression screenshot will be taken but shortly after that deleted and no regression test is being done. Although there are clearly differences.

While debugging i came accross the windowHandleSize(...)
in /node_modules/webdrivercss/lib/documentScreenshot.js

Here is the example from that script

/**
 *
 * Save a screenshot as a base64 encoded PNG with the current state of the browser.
 *
 * <example>
    :saveScreenshot.js
    client
        // set browser window size
        .windowHandleSize({width: 500, height: 500})
        .saveScreenshot('viewport.png') // make screenshot of current viewport (500x500px)
        .saveScreenshot('wholeScreen.png', true) // makes screenshot of whole document (1280x1342px)
        .end();
 * </example>
 *
 * @param {String}   fileName    path of generated image (relative to the execution directory)
 * @param {Boolean=} totalScreen if true (default value) it takes a screenshot of whole website, otherwise only of current viewport
 *
 * @uses protocol/execute, utility/scroll, protocol/screenshot
 * @type utility
 *
 */

If someone has issues with screenWidth causing trouble, try this out :)

zanto001 avatar Mar 28 '18 16:03 zanto001