rox-client-bwoken 0.1.0

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjFjMjAxNmVkY2UwYTQzNTNiZTFlZGM1NmYzZTgxOWY0ODFmNjRiYQ==
5
+ data.tar.gz: !binary |-
6
+ MzhmNDE2ODM5YjVmNGQ1ZGRkMTUxYzcyNTZhMzQ5ZjNlOTdhOGM5Mg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MjliYTRkYjI5Njk5OGQyYzdhN2NjYjgxNDAwOGIxYmM4NzA2ODIyNmFmMjk4
10
+ NDQxNTVlMDhlZjFjNDBkMTUwOWU5ZmU3ZWQ4ZDgxMzk5MjJlYmRiOTlhNzM5
11
+ N2I3OTA1MjlmYzMyYTg0NjFhNDFkYTMyNTdlODBmYjM4MGY3MGE=
12
+ data.tar.gz: !binary |-
13
+ OTIyNDlhMmM3NDI4NGJhYTRkNjI3MzNlZDdhYWNhYTU4MGJiYTlkOGQzN2Nk
14
+ NDZhNjc0ZjExOWE1NDVlODA3ZGRkMTVmMmQ1ZTA1ZmIxN2Q1NDVhZGE2MDY5
15
+ MzVlYzk5ZjRiMDkyZmQ3NWYyMDZmMWJmMWEzMzFiYzA5MGUzYTA=
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ gem 'bwoken', '~> 2.0', git: 'git@github.com:lotaris/bwoken.git', branch: 'custom-formatter'
7
+ gem 'rox-client-ruby', '~> 0.1'
8
+
9
+ # Add dependencies to develop your gem here.
10
+ # Include everything needed to run rake, tests, features, etc.
11
+ group :development do
12
+ gem 'rspec', '~> 2.14'
13
+ gem 'bundler', '~> 1'
14
+ gem 'jeweler', '~> 1.8'
15
+ gem 'rake-version', '~> 0.4'
16
+ gem 'simplecov', '~> 0.7'
17
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Lotaris SA
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # Bwoken ROX Client
2
+
3
+ **[Bwoken](https://github.com/bendyworks/bwoken) client for [ROX Center](https://github.com/lotaris/rox-center).**
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/rox-client-bwoken.png)](http://badge.fury.io/rb/rox-client-bwoken)
6
+
7
+ ## Installation
8
+
9
+ In your Gemfile:
10
+
11
+ ```rb
12
+ gem 'rox-client-bwoken', '~> 0.1.0'
13
+ ```
14
+
15
+ Manually:
16
+
17
+ gem install rox-client-bwoken
18
+
19
+ ## Usage
20
+
21
+ The `rox-bwoken` command is simply a wrapper around `bwoken`:
22
+
23
+ ```
24
+ rox-bwoken test --family iphone --simulator --formater rox
25
+ ```
26
+
27
+ If you haven't done it already, follow the [ROX client setup procedure](https://github.com/lotaris/rox-client-ruby#setup).
28
+
29
+ To track a test, you must assign it a ROX test key generated from your ROX Center server.
30
+
31
+ **NOTE: currently, all the tests in your test suite must be assigned a test key for the client to work.**
32
+
33
+ Test keys are assigned to a test by adding a special annotation in the name:
34
+
35
+ ```rb
36
+ test("Main menu display Home and return to menu @rox(395f01a2b247)", function(target, app) {
37
+ var window = app.mainWindow();
38
+ window.tableViews()["mainMenu"].cells()["Home"].tap();
39
+ assertEquals("Home", app.navigationBar().staticTexts()[0].value(), "User should be on Home screen");
40
+ });
41
+ ```
42
+
43
+ ## Contributing
44
+
45
+ * [Fork](https://help.github.com/articles/fork-a-repo)
46
+ * Create a topic branch - `git checkout -b my_feature`
47
+ * Push to your branch - `git push origin my_feature`
48
+ * Create a [pull request](http://help.github.com/pull-requests/) from your branch
49
+
50
+ Please add a [changelog](CHANGELOG.md) entry with your name for new features and bug fixes.
51
+
52
+ ## License
53
+
54
+ The Bwoken ROX Client is licensed under the [MIT License](http://opensource.org/licenses/MIT).
55
+ See [LICENSE.txt](LICENSE.txt) for the full license.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/bin/rox-bwoken ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'rox-client-bwoken')
3
+
4
+ RoxClient.configure do |config|
5
+ config.client_name = 'bwoken'
6
+ config.project.category = 'UIAutomation'
7
+ end
8
+
9
+ require 'bwoken/cli'
@@ -0,0 +1,10 @@
1
+ module RoxClient
2
+
3
+ module Bwoken
4
+ VERSION = '0.1.0'
5
+
6
+ class Error < StandardError; end
7
+ end
8
+ end
9
+
10
+ Dir[File.join File.dirname(__FILE__), File.basename(__FILE__, '.*'), '*.rb'].each{ |lib| require lib }
@@ -0,0 +1,88 @@
1
+ require 'bwoken'
2
+ require 'bwoken/formatters/colorful_formatter'
3
+ require 'rox-client-ruby'
4
+
5
+ module Bwoken
6
+ class RoxFormatter < Bwoken::ColorfulFormatter
7
+
8
+ class << self
9
+ def on name, &block
10
+ method_name = "_on_#{name}_callback"
11
+ define_method method_name do |*args|
12
+ @original.send method_name, *args
13
+ instance_exec *args, &block
14
+ end
15
+ end
16
+ end
17
+
18
+ def initialize
19
+
20
+ @data = {}
21
+ @original = Bwoken::ColorfulFormatter.new
22
+
23
+ config = RoxClient.config
24
+ @client = RoxClient::Client.new config.server, config.client_options
25
+ @run = RoxClient::TestRun.new config.project
26
+ end
27
+
28
+ on :start do |line|
29
+ prepare_result line
30
+ end
31
+
32
+ on :pass do |line|
33
+ add_result line, true
34
+ end
35
+
36
+ on :fail do |line|
37
+ add_result line, false
38
+ end
39
+
40
+ on :error do |line|
41
+ add_result line, false
42
+ end
43
+
44
+ on :before_script_run do |path|
45
+ @start ||= Time.now
46
+ end
47
+
48
+ on :complete do |line|
49
+ @run.duration = ((Time.now - @start) * 1000).floor
50
+ @client.process @run
51
+ end
52
+
53
+ def prepare_result line
54
+ meta = rox_metadata line
55
+ @data[meta[:name]] = { start: Time.now }
56
+ end
57
+
58
+ def add_result line, passed
59
+ meta = rox_metadata line
60
+ @run.add_result meta.merge(passed: passed, duration: ((Time.now - @data[meta[:name]][:start]) * 1000).floor)
61
+ @data.delete meta[:name]
62
+ end
63
+
64
+ def rox_metadata line
65
+
66
+ tokens = line.split(' ')
67
+ name = tokens[4..-1].join(' ')
68
+
69
+ return { name: name } unless m = name.match(/.*@rox\(([^\(\)]+)\)/)
70
+
71
+ meta = { name: name.gsub(/@rox\([^\(\)]+\)/, '').strip, tags: [], tickets: [] }
72
+
73
+ m[1].split(/\s+/).reject{ |s| s.empty? }.each do |part|
74
+ if m = part.match(/c:(.+)/) || part.match(/category:(.+)/)
75
+ meta[:category] << m[1]
76
+ elsif m = part.match(/g:(.+)/) || part.match(/tag:(.+)/)
77
+ meta[:tags] << m[1]
78
+ elsif m = part.match(/t:(.+)/) || part.match(/ticket:(.+)/)
79
+ meta[:tickets] << m[1]
80
+ else
81
+ meta[:key] = part
82
+ end
83
+ end
84
+
85
+ meta
86
+ end
87
+ end
88
+ end
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rox-client-bwoken
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Simon Oulevay
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bwoken
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rox-client-ruby
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '0.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '2.14'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.14'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jeweler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '1.8'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.8'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake-version
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '0.4'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '0.4'
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '0.7'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '0.7'
111
+ description: Wraps bwoken to collect test results and send them to a ROX Center server.
112
+ email: simon.oulevay@lotaris.com
113
+ executables:
114
+ - rox-bwoken
115
+ extensions: []
116
+ extra_rdoc_files:
117
+ - LICENSE.txt
118
+ - README.md
119
+ files:
120
+ - Gemfile
121
+ - LICENSE.txt
122
+ - README.md
123
+ - VERSION
124
+ - bin/rox-bwoken
125
+ - lib/rox-client-bwoken.rb
126
+ - lib/rox-client-bwoken/formatter.rb
127
+ homepage: https://github.com/lotaris/rox-client-bwoken
128
+ licenses:
129
+ - MIT
130
+ metadata: {}
131
+ post_install_message:
132
+ rdoc_options: []
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ! '>='
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ requirements: []
146
+ rubyforge_project:
147
+ rubygems_version: 2.2.1
148
+ signing_key:
149
+ specification_version: 4
150
+ summary: Bwoken client for ROX Center.
151
+ test_files: []