Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

screenWidth not working #182

Open
zanto001 opened this issue Mar 28, 2018 · 0 comments
Open

screenWidth not working #182

zanto001 opened this issue Mar 28, 2018 · 0 comments

Comments

@zanto001
Copy link

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant