intuit / proof

A tapable integration testing library for your Storybook stories
https://intuit.github.io/proof/
MIT License
86 stars 30 forks source link

IllegalArgument: width is not integer #42

Closed hainessss closed 4 years ago

hainessss commented 4 years ago

Was trying to explore the applitools plugin; getting this error when running proof --visual.

Error: IllegalArgument: width is not integer 
<     at Function.isInteger (/node_modules/@applitools/eyes.webdriverio/node_modules/@applitools/eyes-sdk-core/node_modules/@applitools/eyes-common/lib/utils/ArgumentGuard.js:132:13)
<     at Function.greaterThanOrEqualToZero (/node_modules/@applitools/eyes.webdriverio/node_modules/@applitools/eyes-sdk-core/node_modules/@applitools/eyes-common/lib/utils/ArgumentGuard.js:81:21)
<     at new RectangleSize (/node_modules/@applitools/eyes.webdriverio/node_modules/@applitools/eyes-sdk-core/node_modules/@applitools/eyes-common/lib/geometry/RectangleSize.js:39:19)
<     at EyesVisualGrid.setViewportSize (/node_modules/@applitools/eyes.webdriverio/src/EyesVisualGrid.js:364:20)
<     at EyesVisualGrid.open (/node_modules/@applitools/eyes.webdriverio/src/EyesVisualGrid.js:141:18)
<     at process._tickCallback (internal/process/next_tick.js:68:7)

Seems to happen here in the RectangleSize constructor. This if block doesn't get hit: image

Despite seeming like an instance of RectangleSize. Debugger: image

Possibly a config error on my part? I am using the DesignSystem CLI base proof config. Plus:

const baseConfig = require('@design-systems/proof/proof.config.base.js');
const ApplitoolsPlugin = require('@proof-ui/applitools-plugin').default;
const { BrowserType } = require('@applitools/eyes-selenium');

baseConfig.plugins.push(
  new ApplitoolsPlugin({
    configure(configuration) {
      configuration.addBrowser(100, 200, BrowserType.CHROME);
    }
  })
);

module.exports = baseConfig;

Running on Node v13.7.0 Design System CLI 1.4.6.

I tried upgrade the @proof-ui/applitools-plugin and get

error Couldn't find package "@applitools/sdk-fake-eyes-server@^1.0.3" required by "@applitools/eyes-sdk-core@^5.16.1" on the "npm" registry.

Is the plugin's version of @applitools/eyes-sdk-core behind?

Maybe two separate problems here... Anyway, thanks in advance for any insight.

adierkens commented 4 years ago

I'll take a look into this. I know we've hit some issues with the configuration object from applitools before, so it could just be pulling down a bad release of @applitools package.

adierkens commented 4 years ago

We actually hit this a while ago in another project; surprised it wasn't already patched here. The Configuration object we needed to use moved from 1 package to another -- but is still exported from both. Should be fixed in #43

punjaan commented 4 years ago

I am facing the same issue with the package "codeceptjs-applitoolshelper". Looks like it is not updated. Can you please help

adierkens commented 4 years ago

@punjaan I'm not familiar with codeceptjs-applitoolshelper, but you can take a look at the fix I made here and see if it applies to your use-case. Really it came down to importing the Configuration object from @applitools/eyes-selenium to @applitools/eyes.webdriverio.