druid-ts 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +6 -7
  3. data/Gemfile +0 -5
  4. data/druid.gemspec +2 -1
  5. data/features/area.feature +0 -1
  6. data/features/audio.feature +0 -2
  7. data/features/bold.feature +0 -1
  8. data/features/canvas.feature +0 -2
  9. data/features/div.feature +0 -2
  10. data/features/heading.feature +0 -10
  11. data/features/italic.feature +0 -1
  12. data/features/label.feature +0 -2
  13. data/features/link.feature +0 -2
  14. data/features/list_item.feature +0 -2
  15. data/features/ordered_list.feature +0 -2
  16. data/features/paragraph.feature +0 -2
  17. data/features/span.feature +0 -2
  18. data/features/step_definations/element_steps.rb +2 -2
  19. data/features/step_definations/section_steps.rb +1 -1
  20. data/features/table.feature +0 -2
  21. data/features/table_cell.feature +0 -2
  22. data/features/unordered_list.feature +0 -3
  23. data/features/video.feature +0 -11
  24. data/lib/druid.rb +1 -5
  25. data/lib/druid/accessors.rb +2 -296
  26. data/lib/druid/assist.rb +1 -9
  27. data/lib/druid/elements/button.rb +0 -4
  28. data/lib/druid/elements/check_box.rb +0 -4
  29. data/lib/druid/elements/div.rb +0 -3
  30. data/lib/druid/elements/element.rb +3 -266
  31. data/lib/druid/elements/file_field.rb +0 -3
  32. data/lib/druid/elements/form.rb +0 -9
  33. data/lib/druid/elements/hidden_field.rb +0 -4
  34. data/lib/druid/elements/image.rb +0 -4
  35. data/lib/druid/elements/label.rb +0 -3
  36. data/lib/druid/elements/link.rb +0 -16
  37. data/lib/druid/elements/list_item.rb +0 -4
  38. data/lib/druid/elements/option.rb +0 -6
  39. data/lib/druid/elements/ordered_list.rb +0 -4
  40. data/lib/druid/elements/radio_button.rb +0 -3
  41. data/lib/druid/elements/select_list.rb +0 -26
  42. data/lib/druid/elements/span.rb +0 -4
  43. data/lib/druid/elements/table_cell.rb +0 -3
  44. data/lib/druid/elements/table_row.rb +4 -0
  45. data/lib/druid/elements/text_area.rb +0 -17
  46. data/lib/druid/elements/text_field.rb +0 -7
  47. data/lib/druid/elements/unordered_list.rb +0 -4
  48. data/lib/druid/page_populator.rb +15 -0
  49. data/lib/druid/version.rb +1 -1
  50. data/spec/druid/druid_spec.rb +1 -21
  51. data/spec/druid/elements/area_spec.rb +0 -8
  52. data/spec/druid/elements/bold_spec.rb +0 -9
  53. data/spec/druid/elements/button_spec.rb +0 -8
  54. data/spec/druid/elements/canvas_spec.rb +0 -9
  55. data/spec/druid/elements/check_box_spec.rb +0 -9
  56. data/spec/druid/elements/div_spec.rb +0 -9
  57. data/spec/druid/elements/element_spec.rb +6 -18
  58. data/spec/druid/elements/file_field_spec.rb +0 -9
  59. data/spec/druid/elements/form_spec.rb +0 -9
  60. data/spec/druid/elements/heading_spec.rb +0 -9
  61. data/spec/druid/elements/hidden_field_spec.rb +0 -9
  62. data/spec/druid/elements/image_spec.rb +0 -9
  63. data/spec/druid/elements/itatic_spec.rb +1 -10
  64. data/spec/druid/elements/label_spec.rb +0 -9
  65. data/spec/druid/elements/link_spec.rb +0 -16
  66. data/spec/druid/elements/list_item_spec.rb +0 -9
  67. data/spec/druid/elements/ordered_list_spec.rb +0 -9
  68. data/spec/druid/elements/paragraph_spec.rb +0 -9
  69. data/spec/druid/elements/radio_button_spec.rb +0 -9
  70. data/spec/druid/elements/select_list_spec.rb +0 -9
  71. data/spec/druid/elements/span_spec.rb +0 -9
  72. data/spec/druid/elements/table_cell_spec.rb +0 -9
  73. data/spec/druid/elements/table_row_spec.rb +0 -8
  74. data/spec/druid/elements/table_spec.rb +0 -9
  75. data/spec/druid/elements/text_area_spec.rb +0 -9
  76. data/spec/druid/elements/text_field_spec.rb +0 -9
  77. data/spec/druid/elements/unordered_list_spec.rb +0 -9
  78. data/spec/druid/page_populator_spec.rb +5 -3
  79. metadata +15 -15
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::FileField do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath, :title].each do |t|
8
- identifier = Druid::Elements::FileField.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double 'element' }
16
7
  let(:file_field) { Druid::Elements::FileField.new(element) }
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::Form do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath, :action].each do |t|
8
- identifier = Druid::Elements::Form.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double 'element' }
16
7
  let(:form) { Druid::Elements::Form.new(element) }
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::Heading do
5
- describe "When mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath].each do |t|
8
- identifier = Druid::Elements::Heading.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  it "should register with tag :h1" do
16
7
  expect(Druid::Elements.element_class_for(:h1)).to be Druid::Elements::Heading
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::HiddenField do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath, :value].each do |t|
8
- identifier = Druid::Elements::HiddenField.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  it "should register with type :hidden" do
16
7
  expect(Druid::Elements.element_class_for(:input, :hidden)).to be Druid::Elements::HiddenField
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::Image do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath, :alt].each do |t|
8
- identifier = Druid::Elements::Image.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { 'element' }
16
7
  let(:image) { Druid::Elements::Image.new(element) }
@@ -2,16 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Druid::Elements::Italic do
4
4
  let(:italic) { Druid::Elements::Italic}
5
-
6
- describe "when mapping how to find an element" do
7
- it "should map watir types to same" do
8
- [:class, :id, :idenx, :name, :xpath, :css].each do |t|
9
- identifier = italic.identifier_for t => 'value'
10
- expect(identifier.keys.first).to eql t
11
- end
12
- end
13
- end
14
-
5
+
15
6
  describe "interface" do
16
7
  it "should register with tag :i" do
17
8
  expect(Druid::Elements.element_class_for(:i)).to eql Druid::Elements::Italic
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::Label do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :text, :index, :xpath].each do |t|
8
- identifier = Druid::Elements::Label.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  it "should register with tag :label" do
16
7
  expect(Druid::Elements.element_class_for(:label)).to be Druid::Elements::Label
@@ -2,22 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::Link do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :href, :id, :index, :name, :text, :xpath, :css, :title].each do |t|
8
- identifier = Druid::Elements::Link.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
-
13
- it "should map selenium types to watir" do
14
- [:link, :link_text].each do |t|
15
- identifier = Druid::Elements::Link.identifier_for t => 'value'
16
- expect(identifier.keys.first).to eql :text
17
- end
18
- end
19
- end
20
-
21
5
  describe "interface" do
22
6
  it "should register with tag :a" do
23
7
  expect(Druid::Elements.element_class_for(:a)).to be Druid::Elements::Link
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::ListItem do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath, :text].each do |t|
8
- identifier = Druid::Elements::ListItem.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  it "should register as tag_name :li" do
16
7
  expect(Druid::Elements.element_class_for(:li)).to be Druid::Elements::ListItem
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::OrderedList do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :xpath].each do |t|
8
- identifier = Druid::Elements::OrderedList.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double 'element' }
16
7
  let(:ol) { Druid::Elements::OrderedList.new(element) }
@@ -4,15 +4,6 @@ require 'druid/elements'
4
4
  describe Druid::Elements::Paragraph do
5
5
  let(:paragraph) { Druid::Elements::Paragraph }
6
6
 
7
- describe "when mapping how to find an element" do
8
- it "should map watir types to same" do
9
- [:class, :id, :index, :name, :xpath].each do |t|
10
- identifier = paragraph.identifier_for t => 'value'
11
- expect(identifier.keys.first).to eql t
12
- end
13
- end
14
- end
15
-
16
7
  describe "interface" do
17
8
  it "should register with type :checkbox" do
18
9
  expect(Druid::Elements.element_class_for(:p)).to be Druid::Elements::Paragraph
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::RadioButton do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath, :value].each do |t|
8
- identifier = Druid::Elements::RadioButton.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double("element") }
16
7
  let(:driver) { double("driver") }
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::SelectList do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath, :text, :value].each do |t|
8
- identifier = Druid::Elements::SelectList.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double 'element' }
16
7
  let(:opts) { [element, element] }
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::Span do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :title, :xpath, :text].each do |t|
8
- identifier = Druid::Elements::Span.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  it "should register with tag_name :span" do
16
7
  expect(Druid::Elements.element_class_for(:span)).to be Druid::Elements::Span
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::TableCell do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :xpath, :name, :text].each do |t|
8
- identifier = Druid::Elements::TableCell.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  it "should register with tag_name :td" do
16
7
  expect(Druid::Elements.element_class_for(:td)).to be Druid::Elements::TableCell
@@ -2,14 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::TableRow do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :name, :xpath, :index].each do |t|
8
- identifier = Druid::Elements::TableRow.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
5
  describe "interface" do
14
6
  let(:element) { double 'element' }
15
7
  let(:table_row) { Druid::Elements::TableRow.new(element) }
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::Table do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :name, :index, :xpath].each do |t|
8
- identifier = Druid::Elements::Table.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double('element')}
16
7
  let(:table) { Druid::Elements::Table.new(element) }
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::TextArea do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :xpath].each do |t|
8
- identifier = Druid::Elements::TextArea.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double "element" }
16
7
  let(:text_area) { Druid::Elements::TextArea.new(element) }
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::TextField do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :name, :text, :xpath, :title, :label].each do |t|
8
- identifier = Druid::Elements::TextField.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double 'element' }
16
7
  let(:text_field) { Druid::Elements::TextField.new(element) }
@@ -2,15 +2,6 @@ require 'spec_helper'
2
2
  require 'druid/elements'
3
3
 
4
4
  describe Druid::Elements::UnOrderedList do
5
- describe "when mapping how to find an element" do
6
- it "should map watir types to same" do
7
- [:class, :id, :index, :xpath].each do |t|
8
- identifier = Druid::Elements::UnOrderedList.identifier_for t => 'value'
9
- expect(identifier.keys.first).to eql t
10
- end
11
- end
12
- end
13
-
14
5
  describe "interface" do
15
6
  let(:element) { double 'element' }
16
7
  let(:ul) { Druid::Elements::UnOrderedList.new(element) }
@@ -44,9 +44,11 @@ describe Druid::PagePopulator do
44
44
  end
45
45
 
46
46
  it "should set a value in a select list" do
47
- expect(druid).to receive(:sa=).with('value')
48
- expect(druid).to receive(:is_enabled?).and_return(true)
49
- druid.populate_page_with('sa' => 'value')
47
+ list = double('sl')
48
+ expect(druid).to receive(:sl_element).and_return(list)
49
+ expect(list).to receive(:options).and_return(['value'])
50
+ expect(list).to receive(:select).with('value')
51
+ druid.populate_page_with('sl' => 'value')
50
52
  end
51
53
 
52
54
  it "should set a value in a file field" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: druid-ts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Sheng
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.10'
41
- - !ruby/object:Gem::Dependency
42
- name: net-http-persistent
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 2.9.4
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 2.9.4
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rspec
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +80,20 @@ dependencies:
94
80
  - - ">="
95
81
  - !ruby/object:Gem::Version
96
82
  version: '1.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: net-http-persistent
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
97
  description: Druid DSL that works with Watir
98
98
  email:
99
99
  - 278570038@qq.com