Skip to content

Commit

Permalink
fix wdio5-service exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
amitzur committed Jun 15, 2020
1 parent e7289de commit af8b7f8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/eyes-webdriverio-5/src/EyesService.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict'

const {ConsoleLogHandler, Eyes, Target, VisualGridRunner} = require('..')
const {ConsoleLogHandler, VisualGridRunner} = require('@applitools/eyes-sdk-core')
const {WDIOEyesFactory: Eyes} = require('../src/WDIOSpecializedEyes')
const Target = require('../src/WDIOCheckSettings')
const VERSION = require('../package.json').version

const DEFAULT_VIEWPORT = {
Expand Down Expand Up @@ -60,12 +62,7 @@ class EyesService {
'eyesCheck',
async (title, checkSettings = Target.window().fully()) => {
await this._eyesOpen()

const matchResult = await this._eyes.check(title, checkSettings)
if (this._eyesConfig.throwErrorIfNotAsExpected && !matchResult.getAsExpected()) {
throw new Error('Eyes detected visual mismatch!')
}
return matchResult
return this._eyes.check(title, checkSettings)
},
)

Expand Down

0 comments on commit af8b7f8

Please sign in to comment.