awetestlib 0.1.22-x86-mingw32 → 0.1.23-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +7 -0
- data/lib/awetestlib/html_report.rb +15 -44
- data/lib/awetestlib/logging.rb +334 -374
- data/lib/awetestlib/regression/browser.rb +61 -71
- data/lib/awetestlib/regression/drag_and_drop.rb +31 -5
- data/lib/awetestlib/regression/find.rb +21 -139
- data/lib/awetestlib/regression/legacy.rb +1175 -1
- data/lib/awetestlib/regression/runner.rb +10 -6
- data/lib/awetestlib/regression/tables.rb +71 -25
- data/lib/awetestlib/regression/user_input.rb +88 -900
- data/lib/awetestlib/regression/utilities.rb +43 -18
- data/lib/awetestlib/regression/validations.rb +165 -248
- data/lib/awetestlib/regression/waits.rb +180 -94
- data/lib/awetestlib/runner.rb +1 -0
- data/lib/awetestlib.rb +3 -1
- data/lib/version.rb +2 -2
- data/test/create_zoho_account1.rb +1 -1
- data/test/login.xls +0 -0
- data/test/login_1.rb +37 -0
- data/test/login_1a.rb +37 -0
- data/test/login_2.rb +32 -0
- data/test/zoho_exercise.rb +21 -0
- metadata +10 -4
data/.yardopts
ADDED
@@ -1,6 +1,9 @@
|
|
1
1
|
module Awetestlib
|
2
|
+
# Report generator for Awetestlib.
|
2
3
|
class HtmlReport
|
4
|
+
|
3
5
|
# Initialize the report class
|
6
|
+
# @private
|
4
7
|
def initialize(report_name)
|
5
8
|
@reportname = report_name
|
6
9
|
@reportContent1 = ''
|
@@ -8,53 +11,15 @@ module Awetestlib
|
|
8
11
|
end
|
9
12
|
|
10
13
|
# Create a report
|
14
|
+
# @private
|
11
15
|
def create_report(reportName)
|
12
16
|
# Get current time
|
13
17
|
t = Time.now
|
14
|
-
# Format the day
|
15
|
-
if(t.day.to_s.length == 1)
|
16
|
-
strDay = '0' + t.day.to_s
|
17
|
-
else
|
18
|
-
strDay = t.day.to_s
|
19
|
-
end
|
20
|
-
|
21
|
-
# Format the month
|
22
|
-
if(t.month.to_s.length == 1)
|
23
|
-
strMonth = '0' + t.month.to_s
|
24
|
-
else
|
25
|
-
strMonth = t.month.to_s
|
26
|
-
end
|
27
|
-
|
28
|
-
# Format the year
|
29
|
-
strYear = t.year.to_s
|
30
|
-
|
31
|
-
# Format the hour
|
32
|
-
if(t.hour.to_s.length == 1)
|
33
|
-
strHour = '0' + t.hour.to_s
|
34
|
-
else
|
35
|
-
strHour = t.hour.to_s
|
36
|
-
end
|
37
|
-
|
38
|
-
# Format the minutes
|
39
|
-
if(t.min.to_s.length == 1)
|
40
|
-
strMinutes = '0' + t.min.to_s
|
41
|
-
else
|
42
|
-
strMinutes = t.min.to_s
|
43
|
-
end
|
44
|
-
|
45
|
-
# Format the seconds
|
46
|
-
if(t.sec.to_s.length == 1)
|
47
|
-
strSeconds = '0' + t.sec.to_s
|
48
|
-
elsif (t.sec.to_s.length == 0)
|
49
|
-
strSeconds = '00'
|
50
|
-
else
|
51
|
-
strSeconds = t.sec.to_s
|
52
|
-
end
|
53
18
|
|
54
19
|
# Create the report name
|
55
|
-
strTime =
|
56
|
-
strNiceTime =
|
57
|
-
strTotalReport = reportName
|
20
|
+
strTime = "#{t.strftime("%Y%m%d_%H%M%S")}"
|
21
|
+
strNiceTime = "#{t.strftime("%m/%d/%Y @ %H:%M:%S")}"
|
22
|
+
strTotalReport = "#{reportName}_#{strTime}.html"
|
58
23
|
|
59
24
|
# Create the HTML report
|
60
25
|
strFile = File.open(strTotalReport, 'w')
|
@@ -135,7 +100,9 @@ module Awetestlib
|
|
135
100
|
return strTotalReport
|
136
101
|
end
|
137
102
|
|
138
|
-
|
103
|
+
# Add a row to the report
|
104
|
+
# @private
|
105
|
+
def add_to_report(step, result, level = 1)
|
139
106
|
# Format the body of the HTML report
|
140
107
|
if (result == 'PASSED')
|
141
108
|
@reportContent2 = @reportContent2 + '<tr><td class=border_left width=80%><p class=normal_text>' + step + '</p></td>'
|
@@ -143,13 +110,17 @@ module Awetestlib
|
|
143
110
|
elsif (result == 'FAILED')
|
144
111
|
@reportContent2 = @reportContent2 + '<tr><td class=border_left width=80%><p class=normal_text>' + step + '</p></td>'
|
145
112
|
@reportContent2 = @reportContent2 + '<td class=border_right width=20%><p class=result_nok>' + result + '</p></td>'
|
113
|
+
elsif level < 1
|
114
|
+
@reportContent2 = @reportContent2 + '<tr><td class=border_left width=80%><p class=normal_text>' + step + '</p></td>'
|
115
|
+
@reportContent2 = @reportContent2 + '<td class=border_right width=20%><p class=result_nok>' + result + '</p></td>'
|
146
116
|
else
|
147
117
|
@reportContent2 = @reportContent2 + '<tr><td class=mark_testlevel_left width=80%><p class=bold_large_text>' + step + '</p></td>'
|
148
118
|
@reportContent2 = @reportContent2 + '<td class=mark_testlevel_right width=20%><p class=result_nok>' + result + '</p></td>'
|
149
119
|
end
|
150
|
-
|
151
120
|
end
|
152
121
|
|
122
|
+
# Close the report HTML
|
123
|
+
# @private
|
153
124
|
def finish_report(reportName)
|
154
125
|
# Open the HTML report
|
155
126
|
strFile = File.open(reportName, 'a')
|