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

RangeError during captureElememtScreenshot #33

Open
eilensm opened this issue Dec 16, 2019 · 0 comments
Open

RangeError during captureElememtScreenshot #33

eilensm opened this issue Dec 16, 2019 · 0 comments

Comments

@eilensm
Copy link

eilensm commented Dec 16, 2019

Hello,

I'm new to nightwatch and nightwatch-vrt and but finally managed to get a sensible setup and initial test running. We want to do some visual regression tests of a Vue.js app for Chrome, Firefox and IE.

Now, I get an error in my test for my firefox headless setup. For IE, Chrome (non-headless and headless) and Firefox (non-headless) it works.

I think it has to do with a negative y axis value for the selected element, as I was able to log (see the code)

describe("App page", () => {
  it("should compare screenshot to baseline", browser => {
    const elementSelector = "#app";
    browser
      .init()
      .getLocationInView(elementSelector, value => {
        console.log("value", value);
      })
      .assert.visible(elementSelector)
      .assert.screenshotIdenticalToBaseline(elementSelector, "app")
      .end();
  });
});

In the non-headless mode, y has the value 8, in headless mode, following is logged:
value { state: 'success', sessionId: null, value: { x: 8, y: -34.600006103515625 }, status: 0 }
Any idea???

Here is some additional information about my setup...

"npm/6.13.2 node/v12.13.1 win32 x64"
"nightwatch": "version": "1.3.1",
"nightwatch-vrt": "version": "0.2.10",
"geckodriver": "version": "1.19.1",
"selenium-server": "version": "3.141.59",

This is my nightwatch.conf.js, although I'm using a derived configuration for the vrt tests but there, I only adapt some pathes besides using the standards from the documentation...

module.exports = {
  test_settings: {
    selenium: {
      // Selenium Server is running locally and is managed by Nightwatch
      selenium: {
        start_process: true,
        port: 4444,
        server_path: require("selenium-server").path,
        cli_args: {
          "webdriver.gecko.driver": require("geckodriver").path,
          "webdriver.ie.driver": process.platform === "win32" ? require("iedriver").path : ""
        }
      }
    },
    // we need a selenium.firefox configuration, because plain webdriver does not support getLocationInView which is
    // called from nightwatch-vrt assertions... (also see https://github.com/nightwatchjs/nightwatch/issues/2275)
    "selenium.firefox": {
      extends: "selenium",
      desiredCapabilities: {
        browserName: "firefox"
      }
    },
    "selenium.firefox.headless": {
      extends: "selenium",
      desiredCapabilities: {
        browserName: "firefox",
        "moz:firefoxOptions": {
          args: ["--headless"]
        }
      }
    },
    "selenium.ie": {
      extends: "selenium",
      desiredCapabilities: {
        browserName: "internet explorer"
      }
    }
  }
};
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

1 participant