ae_page_objects 0.1.2.dt2 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ae_page_objects.rb +0 -1
- data/lib/ae_page_objects/concerns/staleable.rb +1 -1
- data/lib/ae_page_objects/core/application.rb +2 -1
- data/lib/ae_page_objects/core/singleton.rb +0 -6
- data/lib/ae_page_objects/document.rb +0 -9
- data/lib/ae_page_objects/element.rb +2 -2
- data/lib/ae_page_objects/node.rb +1 -1
- data/lib/ae_page_objects/version.rb +1 -1
- metadata +3 -6
- data/lib/ae_page_objects/window.rb +0 -51
data/lib/ae_page_objects.rb
CHANGED
@@ -33,7 +33,6 @@ module AePageObjects
|
|
33
33
|
autoload :Visitable, 'ae_page_objects/concerns/visitable'
|
34
34
|
end
|
35
35
|
|
36
|
-
autoload :Window, 'ae_page_objects/window'
|
37
36
|
autoload :Node, 'ae_page_objects/node'
|
38
37
|
autoload :Document, 'ae_page_objects/document'
|
39
38
|
autoload :Element, 'ae_page_objects/element'
|
@@ -20,7 +20,7 @@ module AePageObjects
|
|
20
20
|
raise ArgumentError, ":name or :locator is required" unless @name || @locator
|
21
21
|
|
22
22
|
@locator ||= default_locator
|
23
|
-
|
23
|
+
|
24
24
|
super(scoped_node)
|
25
25
|
end
|
26
26
|
|
@@ -38,7 +38,7 @@ module AePageObjects
|
|
38
38
|
|
39
39
|
def __full_name__
|
40
40
|
if parent.respond_to?(:__full_name__)
|
41
|
-
[ parent.__full_name__, __name__ ].compact.
|
41
|
+
[ parent.__full_name__, __name__ ].compact.join('_')
|
42
42
|
else
|
43
43
|
__name__
|
44
44
|
end
|
data/lib/ae_page_objects/node.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ae_page_objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
9
|
- 2
|
10
|
-
|
11
|
-
- 2
|
12
|
-
version: 0.1.2.dt2
|
10
|
+
version: 0.1.2
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Donnie Tognazzini
|
@@ -147,7 +145,6 @@ files:
|
|
147
145
|
- lib/ae_page_objects/elements/select.rb
|
148
146
|
- lib/ae_page_objects/node.rb
|
149
147
|
- lib/ae_page_objects/version.rb
|
150
|
-
- lib/ae_page_objects/window.rb
|
151
148
|
homepage: http://github.com/appfolio/ae_page_objects
|
152
149
|
licenses:
|
153
150
|
- MIT
|
@@ -1,51 +0,0 @@
|
|
1
|
-
module AePageObjects
|
2
|
-
class Window
|
3
|
-
class << self
|
4
|
-
def all
|
5
|
-
@all ||= {}
|
6
|
-
end
|
7
|
-
|
8
|
-
def current
|
9
|
-
current_handle = Capybara.current_session.driver.browser.window_handle
|
10
|
-
|
11
|
-
window = all.keys.find do |window|
|
12
|
-
window.handle == current_handle
|
13
|
-
end
|
14
|
-
|
15
|
-
unless window
|
16
|
-
window = new(current_handle)
|
17
|
-
all[window] = window
|
18
|
-
end
|
19
|
-
|
20
|
-
window
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
attr_reader :current_document, :handle
|
25
|
-
|
26
|
-
def initialize(handle)
|
27
|
-
@handle = handle
|
28
|
-
@current_document = nil
|
29
|
-
|
30
|
-
self.class.all[self] = self
|
31
|
-
end
|
32
|
-
|
33
|
-
def current_document=(document)
|
34
|
-
@current_document.send(:stale!) if @current_document
|
35
|
-
@current_document = document
|
36
|
-
end
|
37
|
-
|
38
|
-
def switch_to
|
39
|
-
Capybara.current_session.driver.browser.switch_to.window(handle)
|
40
|
-
current_document
|
41
|
-
end
|
42
|
-
|
43
|
-
def close
|
44
|
-
self.current_document = nil
|
45
|
-
|
46
|
-
Capybara.current_session.execute_script("window.close();")
|
47
|
-
|
48
|
-
self.class.all.delete(self)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|