Sha256: 83bfc7b677502bbb3312fe77c709e4b9faa0e222fa7048fd8a419f84d4f5f8dd
Contents?: true
Size: 1.16 KB
Versions: 14
Compression:
Stored size: 1.16 KB
Contents
require_relative '../../app_prism/elements/elements_collection' require_relative 'sections_collection' module AppPrism module Sections module SectionFinders def screen_section(name, section_class, identifiers) define_method(name) do if android? new_identifiers = identifiers[:android].clone elsif ios? new_identifiers = identifiers[:ios].clone else raise '[31m' + 'OS is not specified. Please run tests with ANDROID=true or IOS=true' + '[0m' end section_class.new(new_identifiers, @platform.driver) end define_method("#{name}_element") do get_element_for(identifiers) end define_method("#{name}?") do get_element_for(identifiers).visible? end end def screen_sections(name, section_class, identifiers) define_method(name) do sections_ary = AppPrism::Elements::ElementsCollection.new(identifiers, platform).map do |elt| section_class.new(elt.element, platform) end AppPrism::Sections::SectionsCollection[*sections_ary] end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems