Sha256: b5af381529e44c1a32305919af90f2347aa44e8b85d973c99aa2edc1fef2dd8c

Contents?: true

Size: 929 Bytes

Versions: 8

Compression:

Stored size: 929 Bytes

Contents

module TestCentricity
  class CellElement < UIElement
    attr_accessor :table
    attr_accessor :column

    def initialize(name, parent, locator, context, table, column)
      @name        = name
      @parent      = parent
      @context     = context
      @alt_locator = nil
      @table       = table
      @column      = column
      @locator     = "#{@table.get_table_cell_locator('ROW_SPEC', column)}/#{locator}"
    end

    def exists?(row)
      obj, = find_cell_element(row)
      obj != nil
    end

    def click(row)
      obj, = find_cell_element(row)
      cell_object_not_found_exception(obj, @type, row)
      obj.click
    end

    def find_cell_element(row)
      set_alt_locator("#{@locator.gsub('ROW_SPEC', row.to_s)}")
      find_element
    end

    def cell_object_not_found_exception(obj, obj_type, row)
      object_not_found_exception(obj, "Row #{row}/Col #{@column} #{obj_type}")
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
testcentricity_web-2.0.6 lib/testcentricity_web/elements/cell_element.rb
testcentricity_web-2.0.5 lib/testcentricity_web/elements/cell_element.rb
testcentricity_web-2.0.4 lib/testcentricity_web/elements/cell_element.rb
testcentricity_web-2.0.3 lib/testcentricity_web/elements/cell_element.rb
testcentricity_web-2.0.2 lib/testcentricity_web/elements/cell_element.rb
testcentricity_web-2.0.1 lib/testcentricity_web/elements/cell_element.rb
testcentricity_web-2.0.0 lib/testcentricity_web/elements/cell_element.rb
testcentricity_web-1.0.23 lib/testcentricity_web/elements/cell_element.rb