page_magic 1.2.8 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +23 -4
- data/.simplecov +5 -3
- data/.zsh_config +6 -0
- data/Dockerfile +11 -0
- data/Gemfile +13 -13
- data/Gemfile.lock +136 -148
- data/Makefile +17 -0
- data/README.md +26 -5
- data/Rakefile +12 -2
- data/VERSION +1 -1
- data/circle.yml +3 -1
- data/lib/active_support/core_ext/object/to_query.rb +84 -0
- data/lib/page_magic.rb +31 -24
- data/lib/page_magic/class_methods.rb +5 -2
- data/lib/page_magic/comparator.rb +37 -0
- data/lib/page_magic/comparator/fuzzy.rb +23 -0
- data/lib/page_magic/comparator/literal.rb +22 -0
- data/lib/page_magic/comparator/null.rb +26 -0
- data/lib/page_magic/comparator/parameter_map.rb +52 -0
- data/lib/page_magic/driver.rb +3 -0
- data/lib/page_magic/drivers.rb +6 -5
- data/lib/page_magic/drivers/poltergeist.rb +2 -0
- data/lib/page_magic/drivers/rack_test.rb +3 -1
- data/lib/page_magic/drivers/selenium.rb +4 -2
- data/lib/page_magic/element.rb +35 -15
- data/lib/page_magic/element/locators.rb +8 -5
- data/lib/page_magic/element/not_found.rb +38 -0
- data/lib/page_magic/element/query.rb +21 -20
- data/lib/page_magic/element/query/multiple_results.rb +21 -0
- data/lib/page_magic/element/query/prefetched_result.rb +26 -0
- data/lib/page_magic/element/query/single_result.rb +20 -0
- data/lib/page_magic/element/selector.rb +41 -16
- data/lib/page_magic/element/selector/methods.rb +18 -0
- data/lib/page_magic/element/selector/model.rb +21 -0
- data/lib/page_magic/element_context.rb +7 -21
- data/lib/page_magic/element_definition_builder.rb +20 -24
- data/lib/page_magic/elements.rb +65 -69
- data/lib/page_magic/elements/config.rb +103 -0
- data/lib/page_magic/elements/inheritance_hooks.rb +15 -0
- data/lib/page_magic/elements/types.rb +25 -0
- data/lib/page_magic/exceptions.rb +6 -1
- data/lib/page_magic/instance_methods.rb +8 -3
- data/lib/page_magic/mapping.rb +79 -0
- data/lib/page_magic/session.rb +15 -35
- data/lib/page_magic/session_methods.rb +3 -1
- data/lib/page_magic/transitions.rb +49 -0
- data/lib/page_magic/utils/string.rb +18 -0
- data/lib/page_magic/utils/url.rb +20 -0
- data/lib/page_magic/wait_methods.rb +3 -0
- data/lib/page_magic/watcher.rb +12 -17
- data/lib/page_magic/watchers.rb +31 -15
- data/page_magic.gemspec +15 -11
- data/spec/lib/active_support/core_ext/object/to_query_test.rb +78 -0
- data/spec/page_magic/class_methods_spec.rb +66 -37
- data/spec/page_magic/comparator/fuzzy_spec.rb +44 -0
- data/spec/page_magic/comparator/literal_spec.rb +41 -0
- data/spec/page_magic/comparator/null_spec.rb +35 -0
- data/spec/page_magic/comparator/parameter_map_spec.rb +75 -0
- data/spec/page_magic/driver_spec.rb +26 -28
- data/spec/page_magic/drivers/poltergeist_spec.rb +6 -7
- data/spec/page_magic/drivers/rack_test_spec.rb +6 -9
- data/spec/page_magic/drivers/selenium_spec.rb +11 -12
- data/spec/page_magic/drivers_spec.rb +38 -29
- data/spec/page_magic/element/locators_spec.rb +28 -25
- data/spec/page_magic/element/not_found_spec.rb +24 -0
- data/spec/page_magic/element/query/multiple_results_spec.rb +14 -0
- data/spec/page_magic/element/query/single_result_spec.rb +21 -0
- data/spec/page_magic/element/query_spec.rb +26 -45
- data/spec/page_magic/element/selector_spec.rb +120 -110
- data/spec/page_magic/element_context_spec.rb +47 -87
- data/spec/page_magic/element_definition_builder_spec.rb +14 -71
- data/spec/page_magic/element_spec.rb +256 -0
- data/spec/page_magic/elements/config_spec.rb +203 -0
- data/spec/page_magic/elements_spec.rb +90 -134
- data/spec/page_magic/instance_methods_spec.rb +65 -63
- data/spec/page_magic/mapping_spec.rb +181 -0
- data/spec/page_magic/session_methods_spec.rb +29 -25
- data/spec/page_magic/session_spec.rb +109 -199
- data/spec/page_magic/transitions_spec.rb +43 -0
- data/spec/page_magic/utils/string_spec.rb +29 -0
- data/spec/page_magic/utils/url_spec.rb +9 -0
- data/spec/page_magic/wait_methods_spec.rb +16 -22
- data/spec/page_magic/watcher_spec.rb +22 -0
- data/spec/page_magic/watchers_spec.rb +58 -62
- data/spec/page_magic_spec.rb +37 -29
- data/spec/spec_helper.rb +9 -2
- data/spec/support/shared_contexts.rb +3 -1
- data/spec/support/shared_examples.rb +17 -17
- metadata +101 -48
- data/lib/page_magic/element/query_builder.rb +0 -48
- data/lib/page_magic/element/selector_methods.rb +0 -13
- data/lib/page_magic/matcher.rb +0 -121
- data/spec/element_spec.rb +0 -249
- data/spec/page_magic/element/query_builder_spec.rb +0 -108
- data/spec/page_magic/matcher_spec.rb +0 -336
- data/spec/support/shared_contexts/files_context.rb +0 -7
- data/spec/support/shared_contexts/nested_elements_html_context.rb +0 -16
- data/spec/support/shared_contexts/rack_application_context.rb +0 -9
- data/spec/support/shared_contexts/webapp_fixture_context.rb +0 -39
- data/spec/watcher_spec.rb +0 -61
@@ -1,56 +1,37 @@
|
|
1
|
-
|
2
|
-
class Element
|
3
|
-
describe Query do
|
4
|
-
include_context :webapp_fixture
|
1
|
+
# frozen_string_literal: true
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
elements_page.visit(application: rack_app).current_page
|
12
|
-
end
|
13
|
-
|
14
|
-
describe '#execute' do
|
15
|
-
context 'no results found' do
|
16
|
-
subject do
|
17
|
-
QueryBuilder.find(:link).build(css: 'wrong')
|
18
|
-
end
|
3
|
+
RSpec.describe PageMagic::Element::Query do
|
4
|
+
describe '#execute' do
|
5
|
+
it 'calls find' do
|
6
|
+
subject = described_class.new
|
7
|
+
allow(subject).to receive(:find)
|
19
8
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context 'to many results returned' do
|
27
|
-
subject do
|
28
|
-
QueryBuilder.find(:link).build(css: 'a')
|
29
|
-
end
|
9
|
+
subject.execute(:capybara_element)
|
10
|
+
expect(subject).to have_received(:find).with(:capybara_element)
|
11
|
+
end
|
30
12
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
13
|
+
context 'when a formatter supplied' do
|
14
|
+
it 'uses it' do
|
15
|
+
subject = described_class.new
|
16
|
+
allow(subject).to receive(:find) { |_r, &formatter| formatter.call(:result) }
|
36
17
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
18
|
+
result = subject.execute(:capybara_element) { |capybara_result| "formatter_called_on_#{capybara_result}" }
|
19
|
+
expect(result).to eq('formatter_called_on_result')
|
20
|
+
end
|
21
|
+
end
|
41
22
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
23
|
+
context 'when no results are found' do
|
24
|
+
subject(:query_class) do
|
25
|
+
Class.new(described_class) do
|
26
|
+
def find(element)
|
27
|
+
element.find('missing')
|
46
28
|
end
|
47
29
|
end
|
30
|
+
end
|
48
31
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
expect(result.text).to eq('link in a form')
|
53
|
-
end
|
32
|
+
it 'Returns `NotFound`' do
|
33
|
+
element = PageMagic::Element.load('<html></html>')
|
34
|
+
expect(query_class.new.execute(element)).to be_a(PageMagic::Element::NotFound)
|
54
35
|
end
|
55
36
|
end
|
56
37
|
end
|
@@ -1,155 +1,165 @@
|
|
1
|
-
|
2
|
-
class Element
|
3
|
-
describe Selector do
|
4
|
-
describe '.find' do
|
5
|
-
it 'returns the constant with the given name' do
|
6
|
-
expect(Selector.find(:css)).to be(described_class::CSS)
|
7
|
-
end
|
8
|
-
|
9
|
-
context 'selector not found' do
|
10
|
-
it 'raises an exception' do
|
11
|
-
expect { Selector.find(:invalid) }.to raise_exception(UnsupportedCriteriaException)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '#build' do
|
17
|
-
it 'puts the locator and element type in to the result' do
|
18
|
-
expect(subject.build(:field, :locator)).to eq([:locator])
|
19
|
-
end
|
1
|
+
# frozen_string_literal: true
|
20
2
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
3
|
+
RSpec.describe PageMagic::Element::Selector do
|
4
|
+
describe '.find' do
|
5
|
+
it 'returns the constant with the given name' do
|
6
|
+
expect(described_class.find(:css)).to be(described_class::CSS)
|
7
|
+
end
|
25
8
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
9
|
+
context 'when selector not found' do
|
10
|
+
it 'raises an exception' do
|
11
|
+
expect { described_class.find(:invalid) }.to raise_exception(PageMagic::UnsupportedCriteriaException)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
30
15
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
16
|
+
describe '#build' do
|
17
|
+
it 'puts the locator and element type in to the result' do
|
18
|
+
expect(described_class.new.build(:field, :locator)).to have_attributes(
|
19
|
+
args: [:locator]
|
20
|
+
)
|
21
|
+
end
|
39
22
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
expect(subject.build(:field, :locator)).to eq([:formatted_locator])
|
48
|
-
end
|
49
|
-
end
|
23
|
+
context 'when exact matching is required' do
|
24
|
+
it 'is added to options' do
|
25
|
+
expect(described_class.new(exact: true).build(:field, :locator)).to have_attributes(
|
26
|
+
options: { exact: true }
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
50
30
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
31
|
+
context 'when supports_type true' do
|
32
|
+
it 'includes the element type' do
|
33
|
+
expect(described_class.new(supports_type: true).build(:field, :locator)).to have_attributes(
|
34
|
+
args: %i[field locator]
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
55
38
|
|
56
|
-
|
57
|
-
|
58
|
-
|
39
|
+
# TODO: - new class?
|
40
|
+
context 'when selector formatter is provided' do
|
41
|
+
subject(:selector) do
|
42
|
+
described_class.new do |param|
|
43
|
+
"formatted_#{param}".to_sym
|
59
44
|
end
|
60
45
|
end
|
61
46
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
47
|
+
it 'uses the formatter' do
|
48
|
+
expect(selector.build(:field, :locator)).to have_attributes(
|
49
|
+
args: [:formatted_locator]
|
50
|
+
)
|
66
51
|
end
|
67
52
|
end
|
68
53
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
54
|
+
context 'when type supplied' do
|
55
|
+
it 'is added to the result' do
|
56
|
+
expect(described_class.new(:css).build(:field, :locator)).to have_attributes(
|
57
|
+
args: %i[css locator]
|
58
|
+
)
|
75
59
|
end
|
60
|
+
end
|
61
|
+
end
|
76
62
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
63
|
+
describe '#initialize' do
|
64
|
+
context 'when exact' do
|
65
|
+
it 'sets the option' do
|
66
|
+
subject = described_class.new(exact: true).build(:element_type, {})
|
67
|
+
expect(subject.options).to eq({ exact: true })
|
81
68
|
end
|
69
|
+
end
|
70
|
+
end
|
82
71
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
72
|
+
describe 'predefined selectors' do
|
73
|
+
shared_examples 'a selector' do |named: false, **options|
|
74
|
+
def selector_name
|
75
|
+
self.class.metadata[:parent_example_group][:description].to_sym
|
87
76
|
end
|
88
77
|
|
89
|
-
|
90
|
-
|
91
|
-
expect(described_class.supports_type).to eq(false)
|
92
|
-
end
|
78
|
+
subject do
|
79
|
+
described_class.find(selector_name).build(:element_type, :locator)
|
93
80
|
end
|
94
81
|
|
95
|
-
|
96
|
-
|
97
|
-
it_behaves_like 'non element type selector'
|
82
|
+
it 'contains the selector args' do
|
83
|
+
name_arg = named && (named == true ? selector_name : named)
|
98
84
|
|
99
|
-
|
100
|
-
|
101
|
-
expect(described_class.build(:button, button_name)).to eq(["*[name='#{button_name}']"])
|
102
|
-
end
|
85
|
+
expected_args = [name_arg, :locator].compact
|
86
|
+
expect(subject.args).to eq(expected_args)
|
103
87
|
end
|
104
88
|
|
105
|
-
|
106
|
-
|
107
|
-
it_behaves_like 'non element type selector'
|
89
|
+
it 'contains the options' do
|
90
|
+
expect(subject.options).to eq(options)
|
108
91
|
end
|
92
|
+
end
|
109
93
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
end
|
94
|
+
let(:capybara_element) do
|
95
|
+
html_source = <<~HTML_SOURCE
|
96
|
+
<a href='#'>a link</a>
|
114
97
|
|
115
|
-
describe LABEL do
|
116
|
-
it_behaves_like 'named selector', exact: true
|
117
|
-
it_behaves_like 'non element type selector'
|
118
|
-
end
|
119
98
|
|
120
|
-
|
121
|
-
|
122
|
-
|
99
|
+
<div id='form' class="form">
|
100
|
+
<a id='form_link' href='/page2'>link in a form</a>
|
101
|
+
<label>enter text
|
102
|
+
<input id='field_id' name='field_name' class='input_class' type='text' value='filled in'/>
|
103
|
+
</label>
|
104
|
+
<button id='form_button' type='submit' value='a button'/>
|
105
|
+
</form>
|
106
|
+
HTML_SOURCE
|
107
|
+
PageMagic::Element.load(html_source)
|
108
|
+
end
|
109
|
+
|
110
|
+
describe 'label' do
|
111
|
+
it_behaves_like 'a selector', named: :field, exact: true
|
112
|
+
|
113
|
+
it 'finds elements by label' do
|
114
|
+
selector = described_class.find(:label).build(:text_field, 'enter text')
|
115
|
+
query = PageMagic::Element::Query::SingleResult.new(*selector.args)
|
116
|
+
expect(query.execute(capybara_element)[:name]).to eq('field_name')
|
123
117
|
end
|
124
118
|
end
|
125
119
|
|
126
|
-
|
127
|
-
|
128
|
-
|
120
|
+
describe 'name' do
|
121
|
+
it 'formats locators' do
|
122
|
+
name = 'my_button'
|
123
|
+
expect(described_class::NAME.build(:element_type, name)).to have_attributes(
|
124
|
+
args: ["*[name='#{name}']"],
|
125
|
+
options: {}
|
126
|
+
)
|
127
|
+
end
|
129
128
|
|
130
129
|
it 'finds elements by name' do
|
131
|
-
|
132
|
-
|
130
|
+
selector = described_class.find(:name).build(:text_field, 'field_name')
|
131
|
+
query = PageMagic::Element::Query::SingleResult.new(*selector.args)
|
132
|
+
expect(query.execute(capybara_element)[:name]).to eq('field_name')
|
133
133
|
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe 'xpath' do
|
137
|
+
it_behaves_like 'a selector', named: true
|
134
138
|
|
135
139
|
it 'finds elements by xpath' do
|
136
|
-
|
137
|
-
|
140
|
+
selector = described_class.find(:xpath).build(:element, '//div/label/input')
|
141
|
+
query = PageMagic::Element::Query::SingleResult.new(*selector.args)
|
142
|
+
expect(query.execute(capybara_element)[:name]).to eq('field_name')
|
138
143
|
end
|
144
|
+
end
|
145
|
+
|
146
|
+
describe 'id' do
|
147
|
+
it_behaves_like 'a selector', named: true
|
139
148
|
|
140
149
|
it 'finds elements by id' do
|
141
|
-
|
142
|
-
|
150
|
+
selector = described_class.find(:id).build(:text_field, 'field_id')
|
151
|
+
query = PageMagic::Element::Query::SingleResult.new(*selector.args)
|
152
|
+
expect(query.execute(capybara_element)[:name]).to eq('field_name')
|
143
153
|
end
|
154
|
+
end
|
144
155
|
|
145
|
-
|
146
|
-
|
147
|
-
expect(query.execute(capybara_session)[:name]).to eq('field_name')
|
148
|
-
end
|
156
|
+
describe 'text' do
|
157
|
+
it_behaves_like 'a selector', named: :element_type
|
149
158
|
|
150
159
|
it 'finds elements by text' do
|
151
|
-
|
152
|
-
|
160
|
+
selector = described_class.find(:text).build(:link, 'a link')
|
161
|
+
query = PageMagic::Element::Query::SingleResult.new(*selector.args)
|
162
|
+
expect(query.execute(capybara_element).text).to eq('a link')
|
153
163
|
end
|
154
164
|
end
|
155
165
|
end
|
@@ -1,111 +1,71 @@
|
|
1
|
-
|
2
|
-
describe ElementContext do
|
3
|
-
include_context :webapp_fixture
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
link(:a_link, text: 'a link')
|
10
|
-
link(:prefetched, Object.new)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
let(:page) do
|
15
|
-
elements_page.visit(application: rack_app).current_page
|
16
|
-
end
|
17
|
-
|
18
|
-
subject do
|
19
|
-
described_class.new(page)
|
20
|
-
end
|
21
|
-
|
22
|
-
let!(:session) do
|
23
|
-
double('session', raw_session: double('browser'))
|
3
|
+
RSpec.describe PageMagic::ElementContext do
|
4
|
+
describe '#method_missing' do
|
5
|
+
let(:element_class) do
|
6
|
+
Class.new(PageMagic::Element)
|
24
7
|
end
|
25
8
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
it 'passes arguments through to the element definition' do
|
34
|
-
elements_page.links :pass_through, css: 'a' do |args|
|
35
|
-
args[:passed_through] = true
|
36
|
-
end
|
37
|
-
args = {}
|
38
|
-
described_class.new(page).pass_through(args)
|
39
|
-
expect(args[:passed_through]).to eq(true)
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'does not evaluate any of the other definitions' do
|
43
|
-
elements_page.class_eval do
|
44
|
-
link(:another_link, :selector) do
|
45
|
-
raise('should not have been evaluated')
|
46
|
-
end
|
47
|
-
end
|
9
|
+
context 'when method is a element definition' do
|
10
|
+
it 'returns the sub page element' do
|
11
|
+
element_class.link(:a_link, text: 'a link')
|
12
|
+
element = described_class.new(element_class.load("<a href='#'>a link</a>")).a_link
|
13
|
+
expect(element.text).to eq('a link')
|
14
|
+
end
|
48
15
|
|
49
|
-
|
50
|
-
|
16
|
+
it 'passes arguments through to the element definition' do
|
17
|
+
element_class.link(:pass_through, css: 'a') { |args| args[:passed_through] = true }
|
51
18
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
links = described_class.new(page).links
|
56
|
-
expect(links.find_all { |e| e.class == Element }.size).to eq(2)
|
57
|
-
expect(links.collect(&:text)).to eq(['a link', 'link in a form'])
|
58
|
-
end
|
59
|
-
end
|
19
|
+
args = {}
|
20
|
+
described_class.new(element_class.load("<a href='#'>a link</a>")).pass_through(args)
|
21
|
+
expect(args[:passed_through]).to eq(true)
|
60
22
|
end
|
61
23
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
def page_method
|
66
|
-
:called
|
67
|
-
end
|
68
|
-
end
|
24
|
+
it 'does not evaluate any of the other definitions' do
|
25
|
+
element_class.link(:a_link, text: 'a link')
|
26
|
+
element_class.link(:another_link, :selector) { raise('should not have been evaluated') }
|
69
27
|
|
70
|
-
|
71
|
-
end
|
28
|
+
described_class.new(element_class.load("<a href='#'>a link</a>")).a_link
|
72
29
|
end
|
30
|
+
end
|
73
31
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
32
|
+
context 'when the method is found on page_element' do
|
33
|
+
it 'calls page_element method' do
|
34
|
+
element_class.define_method(:page_method) do
|
35
|
+
:called
|
78
36
|
end
|
79
|
-
end
|
80
37
|
|
81
|
-
|
82
|
-
it 'raises an error' do
|
83
|
-
expect { elements_page.missing_method }.to raise_error(NoMethodError)
|
84
|
-
end
|
38
|
+
expect(described_class.new(element_class.load("<a href='#'>a link</a>")).page_method).to eq(:called)
|
85
39
|
end
|
86
40
|
end
|
87
41
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
end
|
42
|
+
context 'when the method is not found on page_element or as a element definition' do
|
43
|
+
it 'raises an error' do
|
44
|
+
expect do
|
45
|
+
described_class.new(PageMagic::Element.load('')).missing_method
|
46
|
+
end.to raise_error(PageMagic::ElementMissingException)
|
93
47
|
end
|
48
|
+
end
|
49
|
+
end
|
94
50
|
|
95
|
-
|
96
|
-
|
51
|
+
describe '#respond_to?' do
|
52
|
+
let(:page_element_class) do
|
53
|
+
Class.new(PageMagic::Element) do
|
54
|
+
link(:a_link, text: 'a link')
|
97
55
|
end
|
56
|
+
end
|
98
57
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
58
|
+
context 'when the page_element responds to method name' do
|
59
|
+
it 'returns true' do
|
60
|
+
element = described_class.new(page_element_class.load("<a href='#'>a link</a>"))
|
61
|
+
expect(element).to respond_to(:a_link)
|
103
62
|
end
|
63
|
+
end
|
104
64
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
65
|
+
context 'when the method is not on the page_element' do
|
66
|
+
it 'calls super' do
|
67
|
+
element = described_class.new(page_element_class.load("<a href='#'>a link</a>")).a_link
|
68
|
+
expect(element.text).to respond_to(:methods)
|
109
69
|
end
|
110
70
|
end
|
111
71
|
end
|