applitools / eyes-storybook

Applitools SDK for Storybook. This repository is deprecated. It has moved to https://github.com/applitools/eyes.sdk.javascript1/tree/master/packages/eyes-storybook
Other
13 stars 6 forks source link

Getting `result.getName is not a function` #19

Closed jonathanadler closed 5 years ago

jonathanadler commented 5 years ago

Hello,

We're using eyes-storybook in our CI environment, and lately we've been getting this exception:

> eyes-storybook -c ./.storybook-test
[npm run test] 
[npm run test] Using @applitools/eyes-storybook version 2.7.19.
[npm run test] 
[npm run test] - Starting storybook server
[npm run test] ✔ Storybook was started
[npm run test] - Reading stories
[npm run test] ✔ Reading stories
[npm run test] - Done 0 stories out of 34
[npm run test] ✖ Done 34 stories out of 34
[npm run test] result.getName is not a function
[npm run test] npm ERR! code ELIFECYCLE
[npm run test] npm ERR! errno 1
danielschwartz85 commented 5 years ago

Hi, Does this happen consistently ? Can you share the logs of the run ? enable logs with:

  1. APPLITOOLS_SHOW_LOGS=true eyes-storybook -c ./.storybook-test
  2. add showLogs:true to applitools.config.js
jonathanadler commented 5 years ago

Hi, Does this happen consistently ? Can you share the logs of the run ? enable logs with:

  1. APPLITOOLS_SHOW_LOGS=true eyes-storybook -c ./.storybook-test
  2. add showLogs:true to applitools.config.js

I'll try it and hope to update soon

jonathanadler commented 5 years ago

I can't recreate this with logs. So i'll close this issue for now.

I have a feeling there might be problems when we have different PR's running with different versions of eyes-storybook, but I couldn't prove it. If I have luck recreating the problem i'll report back.

danielschwartz85 commented 5 years ago

@jonathanadler thanks for the update 👍

williamdenton commented 5 years ago

anecdotally, i saw this happening when the iframe was loaded with iframe.html?id=undefined when visiting the storybook with no query string for the first time.

if i changed the storybook url to include a query string like this

eyes-storybook --conf .applitools/applitools.config.ci.js -u http://localhost:10000/?path=/story/header--basic-usage"

this got rid of the undefined request to the iframe, and the result.getName() error went away and the test run finished correctly

danielschwartz85 commented 5 years ago

@williamdenton thanks for the comment. Did you see the iframe open in the logs ? how do you know the iframe was loaded with iframe.html?id=undefined ? when you say you started eyes-storybook with no query string do you mean like this: http://localhost:10000/ ?

williamdenton commented 5 years ago

i think its something to do with storybook rather than applitools. here is chrome loading my storybook

image

ive noticed the same request behaviour when using serve-http on the static output dir using eyes-storybook.

im not sure on causation/correlation but when i add a valid query string that behaviour doesn't happen, and eyes is happy.

when you say you started eyes-storybook with no query string do you mean like this: http://localhost:10000/ ?

yes

williamdenton commented 5 years ago

oh, it seems, the query string thing doesn't make a difference. sometimes it works sometimes not, i can't find what flipps the state.

$ concurrently --success first --kill-others --kill-others-on-fail "yarn serve:storybook" "yarn eyes:storybook"
$ http-server dist/storybook -p 10000
$ eyes-storybook --conf .applitools/applitools.config.ci.js -u http://localhost:10000?path=/story/header--basic-usage
[0] Starting up http-server, serving dist/storybook
[0] Available on:
[0]   http://127.0.0.1:10000
[0]   http://127.94.0.2:10000
[0]   http://127.94.0.3:10000
[0]   http://127.94.0.1:10000
[0]   http://10.100.11.73:10000
[0] Hit CTRL-C to stop the server
[1] Using @applitools/eyes-storybook version 2.7.14.
[1] 
[1] - Reading stories
[0] [2019-08-13T21:44:13.749Z] "GET /?path=/story/header--basic-usage" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] (node:45347) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
[0] [2019-08-13T21:44:13.766Z] "GET /runtime~main.d468ad552b61ace5e7a1.bundle.js" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:13.768Z] "GET /vendors~main.27b249904c72899039e2.bundle.js" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:13.769Z] "GET /main.ecb713bab6678191cf98.bundle.js" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:14.145Z] "GET /iframe.html?id=header--basic-usage" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:14.217Z] "GET /runtime~main.f32e24a4057174de490d.bundle.js" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:14.218Z] "GET /vendors~main.f32e24a4057174de490d.bundle.js" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:14.218Z] "GET /main.f32e24a4057174de490d.bundle.js" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[1] ✔ Reading stories
[1] - Done 0 stories out of 12
[0] [2019-08-13T21:44:14.552Z] "GET /iframe.html?selectedKind=Community&selectedStory=Edit%20Profile&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:14.553Z] "GET /iframe.html?selectedKind=Donor%20List&selectedStory=Donor%20List&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:14.679Z] "GET /iframe.html?selectedKind=Header&selectedStory=Basic%20Usage&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.289Z] "GET /iframe.html?selectedKind=Service%20Error&selectedStory=Service%20Error%20without%20message&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.311Z] "GET /iframe.html?selectedKind=Community&selectedStory=Community%20Member%20List&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.425Z] "GET /iframe.html?selectedKind=Service%20Error&selectedStory=Service%20Error%20with%20message&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.544Z] "GET /iframe.html?selectedKind=Giving%20Summary&selectedStory=Giving%20Summary&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.553Z] "GET /iframe.html?selectedKind=TableLoading&selectedStory=Loading%20without%20message&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.667Z] "GET /undefined" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.669Z] "GET /undefined" Error (404): "Not found"
[0] [2019-08-13T21:44:15.707Z] "GET /iframe.html?selectedKind=InsightsPanel&selectedStory=Basic%20Usage&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.719Z] "GET /iframe.html?selectedKind=Giving%20Summary&selectedStory=Global%20Period%20Selector&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.946Z] "GET /iframe.html?selectedKind=Latest%20Snapshot&selectedStory=Latest%20Snapshot&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[0] [2019-08-13T21:44:15.946Z] "GET /iframe.html?selectedKind=Donor%20Action%20Panel&selectedStory=Basic%20Usage&eyes-storybook=true" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3835.0 Safari/537.36"
[1] ✖ Done 12 stories out of 12
[1] result.getName is not a function
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[1] yarn eyes:storybook exited with code 1
--> Sending SIGTERM to other processes..
[0] http-server stopped.
[0] yarn serve:storybook exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

i am however convinced the undefined requests in the middle are causing the issue. But dont know why they are there

update just tried again and it completed even with the undefined requests in the middle...

I have no idea whats going on here

danielschwartz85 commented 5 years ago

@williamdenton Thanks for the check regardless, Btw I suggest updating eyes-stroybook since the new version contains better login, I could also make more sense of this error if you can share the logs.

Enabled logs with APPLITOOLS_SHOW_LOGS=true env variable or adding showLogs:true in applitools.config.js.

williamdenton commented 5 years ago

Its just flipped back into not working mode for me, I'm less motivated to drive for a fix to this now as i have worked around it by scraping the detailed log file to extract the bits i need and determine success/failure.

here is the detail log: babbage.log.zip

danielschwartz85 commented 5 years ago

Looks like we have found this issue (caused by a string error that is expected to be an Error instance). I have not updated since this has not been fixed yet. But expect a fix soon, I will update. Thanks.

danielschwartz85 commented 5 years ago

Fixed in version 2.7.35