Sha256: 34d53ccf4c06c5fff009760efa09dd66d29e1289604b7d01f597a1a54bcba727
Contents?: true
Size: 1.43 KB
Versions: 25
Compression:
Stored size: 1.43 KB
Contents
require 'spec_helper' describe Uia::Patterns::Selection do let(:main) { Uia.find_element id: 'MainFormWindow' } Given(:select_list) { main.find(id: 'FruitListBox').as :selection } Given(:combo_box) { main.find(id: 'FruitsComboBox').as :selection } context 'properties' do context '#multi_select?' do Then { expect(select_list).to_not be_multi_select } end context '#selection_required?' do Then { expect(select_list).to_not be_selection_required } end context '#selection_items' do let(:respond_to_selections) { lambda { |e| e.respond_to? :add_to_selection } } Then { combo_box.selection_items.map(&:name) == ['Apple', 'Caimito', 'Coconut', 'Orange', 'Passion Fruit'] } Then { select_list.selection_items.all?(&respond_to_selections) == true } context 'multiple levels of #selection_items' do Given(:tree_view) { main.find(id: 'treeView').as :selection } When { tree_view.selection_items.first.as(:expand_collapse).expand } Then { tree_view.selection_items.map(&:name) == ['Parent One', 'Child 1', 'Child 2', 'Parent Two'] } end end context '#selected_items' do When do main.find(name: 'Toggle Multi-Select').click select_list.selection_items.each &:add_to_selection end Then { expect(select_list.selected_items.map(&:name)).to eq ['Apple', 'Orange', 'Mango'] } end end end
Version data entries
25 entries across 25 versions & 1 rubygems