screengem 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/screengem/actor.rb +2 -2
- data/lib/screengem/dampen_configuration.rb +1 -1
- data/lib/screengem/factories/factory_creation_error.rb +1 -3
- data/lib/screengem/screen_element.rb +8 -0
- data/lib/screengem/{page_references.rb → screen_elements.rb} +7 -7
- data/lib/screengem/version.rb +1 -1
- data/lib/screengem.rb +2 -2
- metadata +4 -4
- data/lib/screengem/feature_page.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f02d39c76804aaa3f566dec16b10dc343444c547cc4aa9d809e9ad5de1f78e56
|
4
|
+
data.tar.gz: 58073c450f813901633963b05408992085eb052722001c44fb2f95c52715bbfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7f94ccef0e664c4f61ffa859ecee1043080f69ad0eb1fb437ba8b5bca4379170143a2d0e62e6a04f1d23acd9fef79e82a2db51bccd44a0f6635b02c9369a8ea
|
7
|
+
data.tar.gz: 6e0d8aa3e48eead2f841ec00e22c3cf0dfa4c22d2d42ce531078f7e36482b31b7cafdec977be744cf926c944fab98770f8f20207f0dcaa4c8bba0ba3d02d71a2
|
data/CHANGELOG.md
CHANGED
data/lib/screengem/actor.rb
CHANGED
@@ -10,7 +10,7 @@ module Screengem
|
|
10
10
|
#
|
11
11
|
# Action, question, and task instances (aka primitives) are configured with:
|
12
12
|
# (1) a reference to the actor that is interacting with the primitive
|
13
|
-
# (2) a reference to the screen instance that hosts accessors to the
|
13
|
+
# (2) a reference to the screen instance that hosts accessors to the screen elements.
|
14
14
|
#
|
15
15
|
module Actor
|
16
16
|
#
|
@@ -81,7 +81,7 @@ module Screengem
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def screen
|
84
|
-
Screengem::
|
84
|
+
Screengem::ScreenElements.instance
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
@@ -4,14 +4,12 @@ module Screengem
|
|
4
4
|
# Knows the behaviour for error creation primitives.
|
5
5
|
#
|
6
6
|
module FactoryCreationError
|
7
|
-
attr_reader :error_message
|
8
|
-
|
9
7
|
def initialize(error_message)
|
10
8
|
@error_message = error_message
|
11
9
|
end
|
12
10
|
|
13
11
|
def execute
|
14
|
-
raise Screengem::ScreengemError, error_message
|
12
|
+
raise Screengem::ScreengemError, @error_message
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -1,25 +1,25 @@
|
|
1
1
|
module Screengem
|
2
2
|
#
|
3
|
-
# Singleton that gives the ability to get references to
|
3
|
+
# Singleton that gives the ability to get references to screen elements.
|
4
4
|
#
|
5
|
-
# On initialization generate a factory method for each
|
5
|
+
# On initialization generate a factory method for each screen element we can find. Example:
|
6
6
|
#
|
7
7
|
# def login_page
|
8
8
|
# Pages::LoginPage.new
|
9
9
|
# end
|
10
10
|
#
|
11
|
-
class
|
12
|
-
include Singleton
|
11
|
+
class ScreenElements
|
12
|
+
include ::Singleton
|
13
13
|
|
14
14
|
def initialize
|
15
15
|
generated_method_names = []
|
16
16
|
|
17
|
-
Screengem::
|
18
|
-
class_name =
|
17
|
+
Screengem::ScreenElement.descendants.each do |screen_element|
|
18
|
+
class_name = screen_element.name
|
19
19
|
method_name = class_name.demodulize.underscore
|
20
20
|
|
21
21
|
if generated_method_names.include?(method_name)
|
22
|
-
raise "Name collision: two
|
22
|
+
raise "Name collision: two screen elements resolve to '#{method_name}'."
|
23
23
|
end
|
24
24
|
|
25
25
|
generated_method_names << method_name
|
data/lib/screengem/version.rb
CHANGED
data/lib/screengem.rb
CHANGED
@@ -6,8 +6,8 @@ require "active_support/core_ext"
|
|
6
6
|
|
7
7
|
require "capybara/dsl"
|
8
8
|
|
9
|
-
require "screengem/feature_page"
|
10
9
|
require "screengem/incorrect_answer"
|
10
|
+
require "screengem/screen_element"
|
11
11
|
require "screengem/screengem_error"
|
12
12
|
|
13
13
|
require "screengem/configuration"
|
@@ -37,7 +37,7 @@ require "screengem/factories/standard_action_factory"
|
|
37
37
|
require "screengem/factories/question_factory"
|
38
38
|
require "screengem/factories/task_factory"
|
39
39
|
|
40
|
-
require "screengem/
|
40
|
+
require "screengem/screen_elements"
|
41
41
|
|
42
42
|
require "screengem/cli"
|
43
43
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: screengem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alistair McKinnell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -177,11 +177,11 @@ files:
|
|
177
177
|
- lib/screengem/factories/question_factory.rb
|
178
178
|
- lib/screengem/factories/standard_action_factory.rb
|
179
179
|
- lib/screengem/factories/task_factory.rb
|
180
|
-
- lib/screengem/feature_page.rb
|
181
180
|
- lib/screengem/incorrect_answer.rb
|
182
|
-
- lib/screengem/page_references.rb
|
183
181
|
- lib/screengem/primitive_key.rb
|
184
182
|
- lib/screengem/question.rb
|
183
|
+
- lib/screengem/screen_element.rb
|
184
|
+
- lib/screengem/screen_elements.rb
|
185
185
|
- lib/screengem/screengem_error.rb
|
186
186
|
- lib/screengem/task.rb
|
187
187
|
- lib/screengem/version.rb
|