0

I'm trying to implement the basic example shown here on my own code https://applitools.com/tutorials/quickstart/native-mobile/appium/ruby

Here is how my code looks:

# frozen_string_literal: true

require 'eyes_appium'

module Raider
  module VisualHelper
    attr_reader :eyes

    APPIUM = Applitools::Appium
    EYES = APPIUM::Eyes
    TARGET = APPIUM::Target
    REGTANGLE_SIZE = Applitools::RectangleSize

    def create_eyes
      EYES.new
    end

    def check_page(page)
      page = format_page(page)
      @eyes.check(page, TARGET.window)
    end

    def format_page(page)
      page.instance_of?(String) ? page : page.to_s
    end

    def config(eyes)
      eyes.api_key = ENV['APPLITOOLS_API_KEY']
    end
  end
end

Every time I run I manage to create a successful run on applitools where it reads my viewport with the correct size and know my phone capabilities

applitools run

However, I keep getting the run empty and this error thrown when I run eyes.check:

  Applitools::EyesError:
       Request failed: IllegalArgument: size.width must be > 0. Received 0

Does anyone know why this is happening?

Holger Just
  • 52,918
  • 14
  • 115
  • 123
  • There must be something else going on here because looking at the code you posted I would have expected `NoMethodError (undefined method \`check' for nil:NilClass)` given the fact that `@eyes` is never set. – engineersmnky Mar 14 '23 at 16:26
  • I’m actually defining eyes somewhere else and I’m including this module in the object that uses eyes, so it is defined – Agustin Pequeno Mar 18 '23 at 10:32

0 Answers0