acceptance_test 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGES +5 -1
- data/lib/acceptance_test/acceptance_test_helper.rb +0 -16
- data/lib/acceptance_test/cucumber_helper.rb +60 -0
- data/lib/acceptance_test/page.rb +17 -0
- data/lib/acceptance_test/page_set.rb +34 -0
- data/lib/acceptance_test/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTBiY2I3NjQ3YTcxYzM1Nzc1MWY0OWM1NTVlY2M5NDZiOTljOWU4MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWE4YjZhNWI2MWViZTAzNDY5ZTk0ZDY2OGRhNjUwMzFlYTU3ZTdlYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjBhZGY2YWVmOGQ0NjQyODRkMjFlNjFkYTg2MGU5YzkzM2RiYjE2MzRmNjQz
|
10
|
+
YTQ2NDUxNGZhODAxN2Y4NmZhN2E5NzY4MTc2NmM4YWIxNjBjNWJiN2EzMWZh
|
11
|
+
NzhjOGUzMzdmN2I0NzYwZmQzNDkyYmUzMjg1ZTgzMzYzYzVlMTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjYwYjNkNTNmZWI0MjBlMjdlZDQyODQyOGIwNWQzZjM1MDY5ZDllNTdmZjc3
|
14
|
+
MjNiMTA4MGFmYTdiNGQ0MDVjNzdhODgzYzQ1YzhhNjdkZjJjNzFiMGQ3ZmJm
|
15
|
+
ZTNlNjJhMzRmMjg3YjQyOTgwYTcwZWZlMjhjZmZkMDY3ZGJkYzg=
|
data/CHANGES
CHANGED
@@ -61,22 +61,6 @@ class AcceptanceTestHelper
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
def metadata_from_scenario scenario
|
65
|
-
tags = scenario.source_tag_names.collect { |a| a.gsub("@", '') }
|
66
|
-
|
67
|
-
metadata = {}
|
68
|
-
|
69
|
-
if tags.size > 0
|
70
|
-
tag = tags.first.to_sym
|
71
|
-
|
72
|
-
if AcceptanceTest.supported_drivers.include? tag
|
73
|
-
metadata[:driver] = tag
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
metadata
|
78
|
-
end
|
79
|
-
|
80
64
|
def get_localhost
|
81
65
|
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily
|
82
66
|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
3
|
+
require 'cucumber/ast/outline_table'
|
4
|
+
|
5
|
+
class CucumberHelper
|
6
|
+
include Singleton
|
7
|
+
|
8
|
+
def enable_external_source data
|
9
|
+
outline_table = Cucumber::Ast::OutlineTable
|
10
|
+
|
11
|
+
outline_table.class_eval do
|
12
|
+
@data = data # class instance variable
|
13
|
+
|
14
|
+
def self.data # access to class instance variable
|
15
|
+
@data
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(raw, scenario_outline)
|
19
|
+
new_raw = raw
|
20
|
+
|
21
|
+
name = raw[0][0]
|
22
|
+
|
23
|
+
if name == 'external_source'
|
24
|
+
test_name, parameter_name = raw[1][0].split(":")
|
25
|
+
|
26
|
+
size = Cucumber::Ast::OutlineTable.data[test_name][parameter_name].size
|
27
|
+
|
28
|
+
new_raw = Array.new(size+1) {Array.new(1)}
|
29
|
+
new_raw[0][0] = parameter_name
|
30
|
+
|
31
|
+
Cucumber::Ast::OutlineTable.data[test_name][parameter_name].each_with_index do |value, index|
|
32
|
+
new_raw[index+1][0] = value
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
super(new_raw)
|
37
|
+
|
38
|
+
@scenario_outline = scenario_outline
|
39
|
+
@cells_class = Cucumber::Ast::OutlineTable::ExampleRow
|
40
|
+
init
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def metadata_from_scenario scenario
|
46
|
+
tags = scenario.source_tag_names.collect { |a| a.gsub("@", '') }
|
47
|
+
|
48
|
+
metadata = {}
|
49
|
+
|
50
|
+
if tags.size > 0
|
51
|
+
tag = tags.first.to_sym
|
52
|
+
|
53
|
+
if AcceptanceTest.supported_drivers.include? tag
|
54
|
+
metadata[:driver] = tag
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
metadata
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
require 'base/page'
|
4
|
+
|
5
|
+
class PageSet
|
6
|
+
extend Forwardable
|
7
|
+
|
8
|
+
attr_accessor :session
|
9
|
+
|
10
|
+
def page
|
11
|
+
session
|
12
|
+
end
|
13
|
+
|
14
|
+
def execute &code
|
15
|
+
self.instance_eval &code
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.delegate_to_pages *pages
|
19
|
+
pages.each do |page|
|
20
|
+
class_name = camelize(page.to_s)
|
21
|
+
clazz = Object.const_get(class_name)
|
22
|
+
|
23
|
+
attr_reader page
|
24
|
+
|
25
|
+
def_delegators page, *(clazz.instance_methods - Page.instance_methods)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def self.camelize string
|
32
|
+
string.split("_").each {|s| s.capitalize! }.join("")
|
33
|
+
end
|
34
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acceptance_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Shvets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gemspec_deps_gen
|
@@ -66,6 +66,9 @@ files:
|
|
66
66
|
- lib/acceptance_test.rb
|
67
67
|
- lib/acceptance_test/acceptance_test.rb
|
68
68
|
- lib/acceptance_test/acceptance_test_helper.rb
|
69
|
+
- lib/acceptance_test/cucumber_helper.rb
|
70
|
+
- lib/acceptance_test/page.rb
|
71
|
+
- lib/acceptance_test/page_set.rb
|
69
72
|
- lib/acceptance_test/screenshot_maker.rb
|
70
73
|
- lib/acceptance_test/version.rb
|
71
74
|
- spec/features/acceptance_config.yml
|