magicspec 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd8f6ca87e5e7cacdc792e9946b8bd71788dcb4e
4
- data.tar.gz: d0ea55de3ee093e2ffc0dcaf77905eac17d1805e
3
+ metadata.gz: 62765281aa56fd7b53cc356fdd44b27fefbbc85d
4
+ data.tar.gz: e8b13150816cb2c815122094dcb5e43e14908e0a
5
5
  SHA512:
6
- metadata.gz: 82e46251f3e0db9aa3d655d782db58eb51b5824c50b602727d0be8bb089d9949f4b9e5a327151b11ff23e860d85160509483bf37c191de5c9060d439fa00cb62
7
- data.tar.gz: 90093205813a40dd8fa01c72b417d3df543600f9b50c0810b198ecff39fc33a1d92c4d85657b75b70792d25bc8d53086115745d7cb7ad72e8f24a0f18e5983e6
6
+ metadata.gz: d5e59c02d6a2768f4e19cd4419c1689293df3741d7e45b0ced8aeaf76c7e7c9d08ae78454c5590e52759ac2a31840bf4ec334eba6d366b8450fa25a200955875
7
+ data.tar.gz: ac72930e5c3c9ce648475fdfb7b47b1ce45914301abe5f3407e7222495bfa7618303547027db20988ce4a2cd93b7e108b21097f67283b03ddb2d3acf04a8a821
data/Gemfile CHANGED
@@ -11,6 +11,7 @@ gem "fuubar"
11
11
  gem "thor"
12
12
  gem "watir-browser-factory"
13
13
  gem "net-ping"
14
+ gem 'rspec-rest-formatter', :git => 'https://git.yale.edu/YaleQA/rspec-rest-formatter'
14
15
 
15
16
  group :development do
16
17
  gem "rdoc"
data/README.md CHANGED
@@ -1,68 +1,55 @@
1
- magic_spec
1
+ magicspec
2
2
  =====================
3
3
 
4
4
  A simple web automation test framework using [selenium-webdriver](http://docs.seleniumhq.org/projects/webdriver/),[watir-webdriver](https://github.com/watir/watir-webdriver),[page-object](https://github.com/cheezy/page-object) and [rspec](https://github.com/rspec/rspec).
5
5
 
6
- This should get you up and running magically.
6
+ This should get you up and running magically. Much like rails this should scaffold tests and make it easy to add new specs an pages using generators and templates.
7
7
 
8
- Install lazyman
8
+ Install magicspec
9
9
  ---------------
10
- Install lazyman from rubygems
10
+ Install magicspec from rubygems
11
11
 
12
- gem install lazyman
12
+ gem install magicspec
13
13
 
14
14
  Or clone from github, build the gem and install
15
15
 
16
- If you have any issue when install lazyman, install the gems below:
17
-
18
- gem install thor
19
-
20
-
21
- Create a lazyman project
16
+ Create a magicspec project
22
17
  ------------------------
23
18
  Open a command console and type just like below:
24
19
 
25
- lazyman new your_project_name
20
+ magicspec new your_project_name
26
21
 
27
22
  Run Examples
28
23
  ------------
29
24
 
30
- Lazyman contains some examples that explain how to use lazyman writing your own test cases.
25
+ Lazyman contains some examples that explain how to use magicspec writing your own test cases.
31
26
 
32
- By default, lazyman runs examples using chrome browser, so make sure you installed google chrome and according [chrome driver](http://code.google.com/p/chromedriver/downloads/list)
27
+ By default, magicspec runs examples using chrome browser, so make sure you installed google chrome and according [chrome driver](http://code.google.com/p/chromedriver/downloads/list)
33
28
 
34
29
  Using following command to make everything running.
35
30
 
36
31
  cd your_project_name
37
- lazyman go
32
+ rspec
38
33
 
39
- Lazyman go command supports all the rspec options and it is the recommend way.
34
+ Add a new spec
35
+ ------------
40
36
 
41
- You can find test report in app/reports folder. It is a html file with current time stamp.
37
+ Add a new page
38
+ ------------
42
39
 
43
40
  Using Console
44
41
  -------------
45
42
  You can use eat console to debug your test in irb.
46
43
 
47
44
  cd your_project_name
48
- lazyman c
49
-
50
- Lazyman will load all your pages, start irb and open browser which was defined in your config.yml.
51
-
52
- Then you can use $navi variable the same way in your test file.
53
-
54
- p = $navi.goto_baidu_page
55
- p.keyword="watir-webdriver"
56
- p.search_element.click
57
-
58
- You can type everything just like you are write a text case.
45
+ magicspec c
59
46
 
60
- Understand lazyman project structure
47
+ Understand magicspec project structure
61
48
  ------------------------------------
62
49
 
63
- Lazyman project has a clean and simple structure.
50
+ A magicspec project has a clean and simple structure.
64
51
 
65
- * app: holds your test codes;
52
+ * app: holds your test code;
66
53
  * config: where your config file placed;
67
54
 
68
55
  * app->pages: puts all your pages files here;
@@ -76,7 +63,7 @@ Lazyman project has a clean and simple structure.
76
63
  * app->support->matchers: defind your owner rspec matchers here.
77
64
 
78
65
 
79
- Contributing to lazyman
66
+ Contributing to magicspec
80
67
  -----------------------
81
68
 
82
69
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
@@ -7,7 +7,6 @@ require 'magicspec'
7
7
  require 'active_record'
8
8
  require 'net/http'
9
9
  require 'watir-browser-factory'
10
- require 'rspec-rest-formatter'
11
10
 
12
11
  Dir["./app/spec/support/**/*.rb"].sort.each {|f|require f}
13
12
 
@@ -105,14 +104,20 @@ RSpec.configure do |c|
105
104
  }
106
105
  }
107
106
  else
108
- # Add formatters
109
- c.add_formatter("Fuubar")
110
- #c.add_formatter("Lazyman::LazymanFormatter")
111
- # Check to make sure we can reach our service and if so push reports to there.
112
- HOST = "http://localhost:3000"
113
- if JSON.parse(RestClient.get("#{HOST}/about/summary.json"))["status"] == "up"
114
- c.add_formatter("RestFormatter")
115
- end
107
+
108
+ # Add formatters
109
+ c.add_formatter("Fuubar")
110
+ # Check to make sure we can reach our service
111
+ HOST = "http://localhost:3000"
112
+ begin
113
+ if JSON.parse(RestClient.get("#{HOST}/about/summary.json"))["status"] == "up"
114
+ c.add_formatter("RestFormatter")
115
+ else
116
+ c.add_formatter("Lazyman::LazymanFormatter")
117
+ end
118
+ rescue
119
+ c.add_formatter("Lazyman::LazymanFormatter")
120
+ end
116
121
 
117
122
  # If there is a tag value and no one has passed a filter to rspec use the config
118
123
  if $config.tags && c.inclusion_filter.empty?
@@ -1,10 +1,6 @@
1
1
  require 'rspec'
2
2
  require 'rspec/core/formatters/base_text_formatter'
3
3
  require 'rspec/core/formatters/html_printer'
4
- require 'gmail'
5
- require 'sys/uname'
6
-
7
- include Sys
8
4
 
9
5
  #https://github.com/GICodeWarrior/threaded-rspec
10
6
 
@@ -37,23 +33,10 @@ module RSpec
37
33
 
38
34
  @output.puts "<script type=\"text/javascript\">document.getElementById('duration').innerHTML = \"Finished in <strong>#{formatted_duration} seconds</strong>\";</script>"
39
35
  @output.puts "<script type=\"text/javascript\">document.getElementById('totals').innerHTML = \"#{totals}\";</script>"
40
- @output.puts "<script type=\"text/javascript\">document.getElementById('browser').innerHTML = \"#{Uname.sysname}\";</script>"
41
36
  @output.puts "</div>"
42
37
  @output.puts "</div>"
43
38
  @output.puts "</body>"
44
39
  @output.puts "</html>"
45
-
46
- # Send a note to all the emails!
47
- gmail = Gmail.new("yaleqa@gmail.com","")
48
- gmail.deliver do
49
- to $emails
50
- subject "Test is complete!"
51
- html_part do
52
- content_type 'text/html; charset=UTF-8'
53
- body "<p>Done!</p><p>#{totals}</p>"
54
- end
55
- #add_file "/path/to/some_image.jpg"
56
- end
57
40
  end
58
41
 
59
42
  YALE_REPORT_HEADER = <<-EOF
@@ -126,14 +109,6 @@ module RSpec
126
109
  </div>
127
110
  <div id="deets">
128
111
  <table class="table table-bordered table-condensed table-responsive">
129
- <tr>
130
- <td>Browser</td>
131
- <td id="browser"></td>
132
- </tr>
133
- <tr>
134
- <td>OS</td>
135
- <td id="OS">Mac</td>
136
- </tr>
137
112
  <tr>
138
113
  <td>Date</td>
139
114
  <td id="Date">#{Time.now.to_s}</td>
data/magicspec.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "magicspec"
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["dmfranko"]
12
- s.date = "2014-02-18"
12
+ s.date = "2014-02-26"
13
13
  s.description = "A test framework using watir-webdriver rspec and page-object"
14
14
  s.email = "dan.franko@yale.edu"
15
15
  s.executables = ["magicspec"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magicspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - dmfranko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: page-object