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

screenWidth not working #182

@zanto001

Description

@zanto001

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions