lazyman 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lazyman.gemspec +11 -4
- data/lib/lazyman/generators/lazyman/app/cases/{examples → baidu_and_google}/baidu_example_spec.rb +0 -0
- data/lib/lazyman/generators/lazyman/app/cases/{examples → baidu_and_google}/google_example_spec.rb +0 -0
- data/lib/lazyman/generators/lazyman/app/cases/mantis/report_issue_spec.rb +27 -0
- data/lib/lazyman/generators/lazyman/app/cases/shared/login.rb +11 -0
- data/lib/lazyman/generators/lazyman/app/cases/spec_helper.rb.tt +1 -1
- data/lib/lazyman/generators/lazyman/app/pages/baidu/baidu_page.rb.tt +0 -2
- data/lib/lazyman/generators/lazyman/app/pages/components/menu.rb +6 -0
- data/lib/lazyman/generators/lazyman/app/pages/google/google_page.rb.tt +0 -2
- data/lib/lazyman/generators/lazyman/app/pages/mantis/login_page.rb.tt +17 -0
- data/lib/lazyman/generators/lazyman/app/pages/mantis/my_view_page.rb.tt +8 -0
- data/lib/lazyman/generators/lazyman/app/pages/mantis/report_issue_page.rb.tt +26 -0
- data/lib/lazyman/generators/lazyman/app/pages/mantis/view_all_bug_page.rb.tt +22 -0
- data/lib/lazyman/generators/lazyman/app/test_data/login_user.yml +4 -0
- data/lib/lazyman/generators/lazyman/config/config.yml +1 -1
- metadata +34 -27
- data/lib/lazyman/generators/lazyman/app/cases/shared/.empty_directory +0 -0
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/lazyman.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "lazyman"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["easonhan"]
|
@@ -34,9 +34,10 @@ Gem::Specification.new do |s|
|
|
34
34
|
"lib/lazyman/errors.rb",
|
35
35
|
"lib/lazyman/ext/string.rb",
|
36
36
|
"lib/lazyman/generators/lazyman/.rspec",
|
37
|
-
"lib/lazyman/generators/lazyman/app/cases/
|
38
|
-
"lib/lazyman/generators/lazyman/app/cases/
|
39
|
-
"lib/lazyman/generators/lazyman/app/cases/
|
37
|
+
"lib/lazyman/generators/lazyman/app/cases/baidu_and_google/baidu_example_spec.rb",
|
38
|
+
"lib/lazyman/generators/lazyman/app/cases/baidu_and_google/google_example_spec.rb",
|
39
|
+
"lib/lazyman/generators/lazyman/app/cases/mantis/report_issue_spec.rb",
|
40
|
+
"lib/lazyman/generators/lazyman/app/cases/shared/login.rb",
|
40
41
|
"lib/lazyman/generators/lazyman/app/cases/spec_helper.rb.tt",
|
41
42
|
"lib/lazyman/generators/lazyman/app/matchers/.empty_directory",
|
42
43
|
"lib/lazyman/generators/lazyman/app/pages/%app_name%_navigator.rb.tt",
|
@@ -44,10 +45,16 @@ Gem::Specification.new do |s|
|
|
44
45
|
"lib/lazyman/generators/lazyman/app/pages/baidu/baidu_page.rb.tt",
|
45
46
|
"lib/lazyman/generators/lazyman/app/pages/baidu/search_result_page.rb.tt",
|
46
47
|
"lib/lazyman/generators/lazyman/app/pages/components/.empty_directory",
|
48
|
+
"lib/lazyman/generators/lazyman/app/pages/components/menu.rb",
|
47
49
|
"lib/lazyman/generators/lazyman/app/pages/google/google_page.rb.tt",
|
48
50
|
"lib/lazyman/generators/lazyman/app/pages/google/google_search_result_page.rb.tt",
|
51
|
+
"lib/lazyman/generators/lazyman/app/pages/mantis/login_page.rb.tt",
|
52
|
+
"lib/lazyman/generators/lazyman/app/pages/mantis/my_view_page.rb.tt",
|
53
|
+
"lib/lazyman/generators/lazyman/app/pages/mantis/report_issue_page.rb.tt",
|
54
|
+
"lib/lazyman/generators/lazyman/app/pages/mantis/view_all_bug_page.rb.tt",
|
49
55
|
"lib/lazyman/generators/lazyman/app/reports/.empty_directory",
|
50
56
|
"lib/lazyman/generators/lazyman/app/test_data/baidu.yml",
|
57
|
+
"lib/lazyman/generators/lazyman/app/test_data/login_user.yml",
|
51
58
|
"lib/lazyman/generators/lazyman/bin/console",
|
52
59
|
"lib/lazyman/generators/lazyman/bin/console.bat",
|
53
60
|
"lib/lazyman/generators/lazyman/bin/setup.rb.tt",
|
data/lib/lazyman/generators/lazyman/app/cases/{examples → baidu_and_google}/baidu_example_spec.rb
RENAMED
File without changes
|
data/lib/lazyman/generators/lazyman/app/cases/{examples → baidu_and_google}/google_example_spec.rb
RENAMED
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
require File.expand_path 'app/cases/spec_helper'
|
3
|
+
require File.expand_path 'app/cases/shared/login'
|
4
|
+
|
5
|
+
describe 'report issue', :mantis do
|
6
|
+
context 'login' do
|
7
|
+
include_shared 'login'
|
8
|
+
end
|
9
|
+
|
10
|
+
context 'report issue' do
|
11
|
+
|
12
|
+
it 'should create report' do
|
13
|
+
report_issue_page = $navi.goto_report_issue_page
|
14
|
+
summary = "lazyman test #{Time.now.to_s}"
|
15
|
+
desc = "description #{Time.now.to_s}"
|
16
|
+
category = 'GUI'
|
17
|
+
|
18
|
+
report_issue_page.create_issue category, summary, desc do |page|
|
19
|
+
page.check_report_stay
|
20
|
+
end
|
21
|
+
|
22
|
+
view_page = $navi.goto_view_all_bug_page
|
23
|
+
view_page.first_row[view_page.summary_column].text.should eq(summary)
|
24
|
+
end
|
25
|
+
|
26
|
+
end #context
|
27
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
shared_examples 'login' do
|
2
|
+
it 'should login' do
|
3
|
+
data = test_data('login_user')
|
4
|
+
user = data['demo']['name']
|
5
|
+
password = data['demo']['password']
|
6
|
+
|
7
|
+
login_page = $navi.goto_login_page
|
8
|
+
my_view_page = login_page.login user, password
|
9
|
+
my_view_page.report_issue?.should be_true
|
10
|
+
end
|
11
|
+
end
|
@@ -16,7 +16,7 @@ $:.unshift(File.expand_path File.join('.'))
|
|
16
16
|
RSpec.configure do |c|
|
17
17
|
c.treat_symbols_as_metadata_keys_with_true_values = true
|
18
18
|
c.run_all_when_everything_filtered = true
|
19
|
-
c.alias_example_to :
|
19
|
+
c.alias_example_to :test_case
|
20
20
|
c.alias_it_should_behave_like_to :include_shared
|
21
21
|
|
22
22
|
unless($config.tags.empty?)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
class LoginPage < <%= app_name.camelize%>Page
|
3
|
+
page_url "#{$config.host}login_page.php"
|
4
|
+
|
5
|
+
text_field 'username', name: 'username'
|
6
|
+
text_field 'password', name: 'password'
|
7
|
+
button 'login_btn', value: 'Login'
|
8
|
+
|
9
|
+
def login user, password
|
10
|
+
self.username = user
|
11
|
+
self.password = password
|
12
|
+
login_btn_element.click
|
13
|
+
|
14
|
+
turn_to MyViewPage
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
|
3
|
+
class ReportIssuePage < <%= app_name.camelize%>Page
|
4
|
+
include Menu
|
5
|
+
|
6
|
+
page_url "#{$config.host}bug_report_page.php"
|
7
|
+
|
8
|
+
select_list 'category', name: 'category_id'
|
9
|
+
text_field 'summary', name: 'summary'
|
10
|
+
text_field 'description', name: 'description'
|
11
|
+
radio_button 'view_state', name: 'view_state', value: 50
|
12
|
+
checkbox 'report_stay', name: 'report_stay'
|
13
|
+
button 'submit', value: 'Submit Report'
|
14
|
+
|
15
|
+
def create_issue category='', summary, description
|
16
|
+
#self.category = category_text_to_value(category)
|
17
|
+
self.category = category
|
18
|
+
self.summary = summary
|
19
|
+
self.description = description
|
20
|
+
#class_eval &blk if block_given?
|
21
|
+
yield self if block_given?
|
22
|
+
self.submit
|
23
|
+
turn_to ViewAllBugPage
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
|
3
|
+
class ViewAllBugPage < <%= app_name.camelize%>Page
|
4
|
+
include Menu
|
5
|
+
|
6
|
+
page_url "#{$config.host}view_all_bug_page.php"
|
7
|
+
|
8
|
+
table 'buglist', id: 'buglist'
|
9
|
+
|
10
|
+
def first_row
|
11
|
+
self.buglist_element[3]
|
12
|
+
end
|
13
|
+
|
14
|
+
def column_name_to_index(column_name)
|
15
|
+
{id: 3, category: 7, status: 9, summary: 11}[column_name]
|
16
|
+
end
|
17
|
+
|
18
|
+
def summary_column
|
19
|
+
column_name_to_index :summary
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazyman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2013-04-21 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &23800728 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.13.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *23800728
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: page-object
|
27
|
-
requirement: &
|
27
|
+
requirement: &23800440 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.8.6.1
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *23800440
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: thor
|
38
|
-
requirement: &
|
38
|
+
requirement: &23800152 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.14.6
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *23800152
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: active_support
|
49
|
-
requirement: &
|
49
|
+
requirement: &23799864 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 3.0.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *23799864
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rdoc
|
60
|
-
requirement: &
|
60
|
+
requirement: &23799576 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '3.12'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *23799576
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
|
-
requirement: &
|
71
|
+
requirement: &23799288 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.0.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *23799288
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: jeweler
|
82
|
-
requirement: &
|
82
|
+
requirement: &23799000 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 1.8.4
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *23799000
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rspec
|
93
|
-
requirement: &
|
93
|
+
requirement: &23798712 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 2.13.0
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *23798712
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: page-object
|
104
|
-
requirement: &
|
104
|
+
requirement: &23798424 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 0.8.6.1
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *23798424
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: thor
|
115
|
-
requirement: &
|
115
|
+
requirement: &23798136 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ~>
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: 0.14.6
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *23798136
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: active_support
|
126
|
-
requirement: &
|
126
|
+
requirement: &23797848 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ~>
|
@@ -131,7 +131,7 @@ dependencies:
|
|
131
131
|
version: 3.0.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *23797848
|
135
135
|
description: A test framework using watir-webdriver rspec and page-object
|
136
136
|
email: nbkhic@qq.com
|
137
137
|
executables:
|
@@ -157,9 +157,10 @@ files:
|
|
157
157
|
- lib/lazyman/errors.rb
|
158
158
|
- lib/lazyman/ext/string.rb
|
159
159
|
- lib/lazyman/generators/lazyman/.rspec
|
160
|
-
- lib/lazyman/generators/lazyman/app/cases/
|
161
|
-
- lib/lazyman/generators/lazyman/app/cases/
|
162
|
-
- lib/lazyman/generators/lazyman/app/cases/
|
160
|
+
- lib/lazyman/generators/lazyman/app/cases/baidu_and_google/baidu_example_spec.rb
|
161
|
+
- lib/lazyman/generators/lazyman/app/cases/baidu_and_google/google_example_spec.rb
|
162
|
+
- lib/lazyman/generators/lazyman/app/cases/mantis/report_issue_spec.rb
|
163
|
+
- lib/lazyman/generators/lazyman/app/cases/shared/login.rb
|
163
164
|
- lib/lazyman/generators/lazyman/app/cases/spec_helper.rb.tt
|
164
165
|
- lib/lazyman/generators/lazyman/app/matchers/.empty_directory
|
165
166
|
- lib/lazyman/generators/lazyman/app/pages/%app_name%_navigator.rb.tt
|
@@ -167,10 +168,16 @@ files:
|
|
167
168
|
- lib/lazyman/generators/lazyman/app/pages/baidu/baidu_page.rb.tt
|
168
169
|
- lib/lazyman/generators/lazyman/app/pages/baidu/search_result_page.rb.tt
|
169
170
|
- lib/lazyman/generators/lazyman/app/pages/components/.empty_directory
|
171
|
+
- lib/lazyman/generators/lazyman/app/pages/components/menu.rb
|
170
172
|
- lib/lazyman/generators/lazyman/app/pages/google/google_page.rb.tt
|
171
173
|
- lib/lazyman/generators/lazyman/app/pages/google/google_search_result_page.rb.tt
|
174
|
+
- lib/lazyman/generators/lazyman/app/pages/mantis/login_page.rb.tt
|
175
|
+
- lib/lazyman/generators/lazyman/app/pages/mantis/my_view_page.rb.tt
|
176
|
+
- lib/lazyman/generators/lazyman/app/pages/mantis/report_issue_page.rb.tt
|
177
|
+
- lib/lazyman/generators/lazyman/app/pages/mantis/view_all_bug_page.rb.tt
|
172
178
|
- lib/lazyman/generators/lazyman/app/reports/.empty_directory
|
173
179
|
- lib/lazyman/generators/lazyman/app/test_data/baidu.yml
|
180
|
+
- lib/lazyman/generators/lazyman/app/test_data/login_user.yml
|
174
181
|
- lib/lazyman/generators/lazyman/bin/console
|
175
182
|
- lib/lazyman/generators/lazyman/bin/console.bat
|
176
183
|
- lib/lazyman/generators/lazyman/bin/setup.rb.tt
|
@@ -211,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
211
218
|
version: '0'
|
212
219
|
segments:
|
213
220
|
- 0
|
214
|
-
hash:
|
221
|
+
hash: -650974257
|
215
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
216
223
|
none: false
|
217
224
|
requirements:
|
File without changes
|