applitools / Eyes.Selenium.JavaScript

Applitools Eyes SDK For Selenium JavaScript WebDriver
Other
18 stars 18 forks source link

no ApiKey : "Failed: Promise factory was not initialized with proper callback" #64

Closed hepiyellow closed 5 years ago

hepiyellow commented 6 years ago

When trying to use, for example, eyes.checkWindow(), without first setting an api key (using eyes.setApiKey), then we get the following error:

Failed: Promise factory was not initialized with proper callback

This error could be more informative.

It would be nice if when there is no Api key, there would be only warnings. Or even if there was a way to state that this is a mock test with no Api key, so there won't even be any warnings.

astappiev commented 6 years ago

Thanks for reporting!

If you getting following error:

Error: Promise factory was not initialized with proper callback
    at PromiseFactory.makePromise (eyes.utils\src\PromiseFactory.js:41:15)
    at Eyes.check (eyes.selenium\src\Eyes.js:218:44)
    at Context.<anonymous> (eyes.selenium\test\selenium\check-interface-test.js:44:14)

Then using eyes.setApiKey will not help you, you need to call eyes.open first (where you should get an error about missing API key).

But anyway, I have update it and in next release you should not get the error (you will get another one, which says that Eyes is not open).