Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full page screenshot not working for chrome #6

Open
ohlori opened this issue Apr 30, 2021 · 2 comments
Open

Full page screenshot not working for chrome #6

ohlori opened this issue Apr 30, 2021 · 2 comments

Comments

@ohlori
Copy link

ohlori commented Apr 30, 2021

  • Nodejs version: 10.15.3
  • Protractor version: 7.0.0
  • Operating system: MacOS and windows
  • Browser and its version: Chrome 90.4430.93

We somehow integrated your package in our test framework.
Just a little background, we are using protractor + mocha + mochawesome-screenshot (html reporting).
We have integrated it the way it was listed on the guide:
https://www.npmjs.com/package/protractor-screenshot-utils

However, for some reason, whenever I call it on the ts file, it's not overriding the browser.takeScreenshot(). It only takes the screenshot of what's visible on the browser. We are also using

On the onPrepare section, we have set it to
setAsDefaultScreenshotMethod : true

@sudharsan-selvaraj
Copy link
Owner

Hi @ohlori ,

I'm unable to reproduce the issue reported for the given environment. Below is the code that i have used for testing,

config.js

var screenShotUtils = require("protractor-screenshot-utils").ProtractorScreenShotUtils;

exports.config = {
    specs : ["./spec.js"],
    onPrepare: function () {
        browser.waitForAngularEnabled(false);
        global.screenShotUtils = new screenShotUtils({
            browserInstance : browser,
            setAsDefaultScreenshotMethod : true
        });
    },
}

spec.js

describe("Sample test", function () {
    it("to check full page screenshot functionality", async function (){
        browser.get("https://www.npmjs.com/package/protractor-screenshot-utils");
        browser.takeScreenshot({
            saveTo: "fullpage.png"
        })
    })
})

Nodejs version:
image

Fullpage screenshot
image

@klainev
Copy link

klainev commented May 7, 2021

One quick question though, I saw that you initialized browser.waitForAngularEnabled(false); on onPrepare section.

Does that mean, this full page screenshot can only work on non-angular pages?

I cannot put this on onPrepare section as I'm working on both Angular and Non-Angular pages. But the one thing I noticed is, this cannot take a screenshot of an angular homepage.

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

No branches or pull requests

3 participants