sw2at-ui 0.0.6 → 0.0.7
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 +4 -4
- data/README.md +80 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/swat/application.coffee +2 -0
- data/app/assets/javascripts/swat/bower_components.coffee +3 -0
- data/app/assets/stylesheets/swat/swat_theme.sass +15 -2
- data/app/models/test_case.rb +14 -4
- data/app/views/swat/pages/revisions/show.slim +16 -5
- data/docs/resources/swat-ui-example.png +0 -0
- data/sw2at-ui.gemspec +4 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0f30d57dca7571b6f2404e9eb31fc9957a6bfb0
|
4
|
+
data.tar.gz: 19b8bc0b73021b3afdc54573dd147e8a43a68017
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce764b8792413fb801cba3bb800d2f536623d4e7317faef96bdc38b4cae3f1ad7856bb4c4001a3712a3856ec414c78f6f8a1430a60c6f77b1280d51eb7b6096c
|
7
|
+
data.tar.gz: cf1e3ec654dab19c283c5cbd7aff86dae1b82f0e810aa82244cd8899ddc288919122f23731df0a268ef8a5b87f6ec38d15e13499481dbe9a31b086f1fd8da0dd
|
data/README.md
CHANGED
@@ -1,9 +1,85 @@
|
|
1
|
-
# sw2at-
|
1
|
+
# sw2at-ui
|
2
2
|
## SWAT(Simple Way to Automate Tests) - UI
|
3
|
-
Gem
|
3
|
+
Gem helps in testing of Rails applications.
|
4
|
+
* track your test revisions
|
5
|
+
* easily configure and run tests in parallel
|
6
|
+
* share testing results with team members and customers
|
4
7
|
|
5
|
-
## How to install
|
6
|
-
|
8
|
+
## How to install Rails app with sw2at-ui from scratch
|
9
|
+
|
10
|
+
Create app (skip this if you have app already)
|
11
|
+
```
|
12
|
+
gem install rails
|
13
|
+
rails new swat-ui-app
|
14
|
+
cd swat-ui-app
|
15
|
+
```
|
16
|
+
add RSpec gem to your Gemfile (skip this if you have rspec already)
|
17
|
+
```ruby
|
18
|
+
gem 'rspec', '~> 3.0'
|
19
|
+
group :development, :test do
|
20
|
+
gem 'rspec-rails', '~> 3.0'
|
21
|
+
end
|
22
|
+
```
|
23
|
+
|
24
|
+
install RSpec(skip this if you have rspec already)
|
25
|
+
```
|
26
|
+
bundle install
|
27
|
+
rails generate rspec:install
|
28
|
+
```
|
29
|
+
|
30
|
+
add sw2at-ui gem to your Gemfile
|
31
|
+
```ruby
|
32
|
+
gem 'sw2at-ui', '0.0.6'
|
33
|
+
```
|
34
|
+
Install `sw2at-ui`
|
35
|
+
```
|
36
|
+
bundle install
|
37
|
+
rails g swat:ui:install
|
38
|
+
```
|
39
|
+
Go to [firebase.com](firebase.com) and create a free acount there to get your https path.
|
40
|
+
|
41
|
+
Insert it in `Rails.root/initializers/swat_ui.rb`. You can define your [parallelism settings](#) here.
|
42
|
+
|
43
|
+
Edit yout `Rails.root/config/routes.rb`
|
44
|
+
```ruby
|
45
|
+
Rails.application.routes.draw do
|
46
|
+
|
47
|
+
unless Rails.env.production?
|
48
|
+
require 'sw2at-ui'
|
49
|
+
mount Swat::Engine => '/swat'
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
```
|
54
|
+
Connect sw2at-ui to RSpec. Edit your `Rails.root/spec/rails_helper.rb`, add following lines
|
55
|
+
```ruby
|
56
|
+
require 'rspec/core/formatters/base_text_formatter'
|
57
|
+
config.formatter = RSpec::Core::Formatters::BaseTextFormatter # if you don't use any custom formatters.
|
58
|
+
Swat::UI.rspec_config = config
|
59
|
+
```
|
60
|
+
Add a test. For example
|
61
|
+
```ruby
|
62
|
+
it 'should check math' do
|
63
|
+
expect(2+2).to eq(4)
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
Run rspec
|
68
|
+
```
|
69
|
+
rspec
|
70
|
+
```
|
71
|
+
or with a swat-ui runner
|
72
|
+
```
|
73
|
+
SWAT_CURRENT_REVISION_NAME='Hello SWAT!' rake swat:ci:run
|
74
|
+
```
|
75
|
+
|
76
|
+
Now you can check your results at [http://localhost:3000/swat](http://localhost:3000/swat).
|
77
|
+
(don't forget to start the app with `rails s`)
|
78
|
+

|
79
|
+
|
80
|
+
|
81
|
+
## Examples
|
82
|
+
You can check a configured example [here](https://github.com/tw4qa/swat-ui-example).
|
7
83
|
|
8
84
|
## Contributing to sw2at-ui
|
9
85
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
@@ -92,8 +92,7 @@ html, body
|
|
92
92
|
table#test-cases
|
93
93
|
border-top: 0
|
94
94
|
tr
|
95
|
-
|
96
|
-
background: grey
|
95
|
+
cursor: default
|
97
96
|
th
|
98
97
|
border-top: 0
|
99
98
|
background: #ffffff
|
@@ -103,6 +102,15 @@ html, body
|
|
103
102
|
width: 100px
|
104
103
|
&.duration
|
105
104
|
width: 100px
|
105
|
+
td
|
106
|
+
&:hover
|
107
|
+
background-color: transparent
|
108
|
+
padding: 0
|
109
|
+
.cell
|
110
|
+
padding: 8px
|
111
|
+
display: block
|
112
|
+
.detailed-info
|
113
|
+
padding: 0 8px
|
106
114
|
|
107
115
|
td.status
|
108
116
|
font-weight: bold
|
@@ -127,6 +135,11 @@ html, body
|
|
127
135
|
&.failed
|
128
136
|
background: mistyrose
|
129
137
|
color: red
|
138
|
+
.main-info
|
139
|
+
cursor: pointer
|
140
|
+
&:hover
|
141
|
+
background: #ffd7e5
|
142
|
+
|
130
143
|
td.command
|
131
144
|
input
|
132
145
|
color: rgb(223, 96, 96)
|
data/app/models/test_case.rb
CHANGED
@@ -15,10 +15,7 @@ class TestCase < Fire::Model
|
|
15
15
|
}.merge!(revision_opts).merge!(extras)
|
16
16
|
|
17
17
|
if rspec_example.exception
|
18
|
-
data[:exception] =
|
19
|
-
message: rspec_example.exception.message,
|
20
|
-
backtrace: rspec_example.exception.backtrace,
|
21
|
-
}
|
18
|
+
data[:exception] = extract_exception(rspec_example)
|
22
19
|
end
|
23
20
|
|
24
21
|
if rspec_example.respond_to?(:swat_extras)
|
@@ -28,6 +25,19 @@ class TestCase < Fire::Model
|
|
28
25
|
create(data)
|
29
26
|
end
|
30
27
|
|
28
|
+
private
|
29
|
+
|
30
|
+
def extract_exception(rspec_example)
|
31
|
+
trace = rspec_example.exception.backtrace
|
32
|
+
if defined?(Rails)
|
33
|
+
trace = ([ trace.first ] + trace.select{|x| x.include?(Rails.root.to_s) } + [ trace.last ]).uniq
|
34
|
+
end
|
35
|
+
{
|
36
|
+
message: rspec_example.exception.message,
|
37
|
+
backtrace: trace,
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
31
41
|
end
|
32
42
|
|
33
43
|
end
|
@@ -26,14 +26,25 @@
|
|
26
26
|
th.status Status
|
27
27
|
th.command Location
|
28
28
|
tr ng-class="test.status" ng-repeat="test in tab.thread.tests"
|
29
|
+
- test_id = '{{ test.id }}'
|
29
30
|
td title="{{ test.full_description }}"
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
.main-info.cell data-toggle="collapse" data-target="##{test_id}"
|
32
|
+
strong
|
33
|
+
| {{ $index+1 }}.
|
34
|
+
| {{ test.full_description }}
|
35
|
+
.detailed-info.collapse id="#{test_id}" ng-if="test.exception"
|
36
|
+
span.message
|
37
|
+
strong
|
38
|
+
| {{ test.exception.message }}
|
39
|
+
.backtrace
|
40
|
+
p.trace-line ng-repeat="line in test.exception.backtrace track by $index"
|
41
|
+
| {{ line }}
|
33
42
|
td.duration
|
34
|
-
|
43
|
+
span.cell
|
44
|
+
| {{ test.run_time | number:0 }} sec
|
35
45
|
td.status
|
36
|
-
|
46
|
+
span.cell
|
47
|
+
| {{ test.status }}
|
37
48
|
td.command clip-copy="'rspec ' + test.location" title="{{ 'rspec ' + test.location }}"
|
38
49
|
input type="text" value="rspec {{ test.location }}" disabled="disabled"
|
39
50
|
a.fa.fa-copy.copy-icon
|
Binary file
|
data/sw2at-ui.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: sw2at-ui 0.0.
|
5
|
+
# stub: sw2at-ui 0.0.7 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "sw2at-ui"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.7"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Vitaly Tarasenko"]
|
14
|
-
s.date = "2015-06-
|
14
|
+
s.date = "2015-06-30"
|
15
15
|
s.description = " Control your tests, run them parallel. Check statuses of your revisions online. Share results to all team members. "
|
16
16
|
s.email = "vetal.tarasenko@gmail.com"
|
17
17
|
s.executables = ["rails"]
|
@@ -387,6 +387,7 @@ Gem::Specification.new do |s|
|
|
387
387
|
"app/views/swat/shared/_header.slim",
|
388
388
|
"bin/rails",
|
389
389
|
"config/routes.rb",
|
390
|
+
"docs/resources/swat-ui-example.png",
|
390
391
|
"fixtures/firebase_collection.rb",
|
391
392
|
"lib/sw2at-ui.rb",
|
392
393
|
"lib/swat/engine.rb",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sw2at-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitaly Tarasenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -583,6 +583,7 @@ files:
|
|
583
583
|
- app/views/swat/shared/_header.slim
|
584
584
|
- bin/rails
|
585
585
|
- config/routes.rb
|
586
|
+
- docs/resources/swat-ui-example.png
|
586
587
|
- fixtures/firebase_collection.rb
|
587
588
|
- lib/sw2at-ui.rb
|
588
589
|
- lib/swat/engine.rb
|