Sha256: 14140a279e9b54b62f2da8074edce26834cb7111aef7a975a05073d672366e8e

Contents?: true

Size: 1.26 KB

Versions: 17

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'

describe "MsUia::Functions", :if => SpecHelper.adapter == :ms_uia do
  context "working with expandable / collapsable items" do
    let(:tree_view) { RAutomation::Window.new(:title => "MainFormWindow").select_list(:id => "treeView") }

    def options
      tree_view.options.map &:text
    end

    it "can be expanded by value" do
      options.should eq ["Parent One", "Parent Two"]
      tree_view.expand "Parent One"
      options.should eq ["Parent One", "Child 1", "Child 2", "Parent Two"]
    end

    it "can be expanded by index" do
      options.should eq ["Parent One", "Parent Two"]
      tree_view.expand 0
      tree_view.expand 2
      options.should eq ["Parent One", "Child 1", "Child 2", "Grandchild 1", "Parent Two"]
    end

    it "can be collapsed by value" do
      tree_view.expand "Parent One"
      options.should eq ["Parent One", "Child 1", "Child 2", "Parent Two"]
      tree_view.collapse "Parent One"
      options.should eq ["Parent One", "Parent Two"]
    end

    it "can be collapsed by index" do
      tree_view.expand 0
      options.should eq ["Parent One", "Child 1", "Child 2", "Parent Two"]
      tree_view.collapse 0
      options.should eq ["Parent One", "Parent Two"]
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rautomation-1.1.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-1.0.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.17.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.16.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.15.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.14.1 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.14.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.13.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.12.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.11.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.10.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.9.4 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.9.3 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.9.2 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.9.1 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.9.0 spec/adapter/ms_uia/functions_spec.rb
rautomation-0.8.0 spec/adapter/ms_uia/functions_spec.rb