list = new ArrayList<>();
45 | try {
46 | InputStream inputStream = process.getInputStream();
47 | BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
48 | String line;
49 | while ((line = reader.readLine()) != null) {
50 | if (filter.filt(line)) {
51 | list.add(line);
52 | }
53 | }
54 | process.waitFor();
55 | inputStream.close();
56 | reader.close();
57 | process.destroy();
58 | } catch (Exception e) {
59 | e.printStackTrace();
60 | Log.e("出错:" + e.getMessage());
61 | }
62 | return list;
63 | }
64 |
65 |
66 | public static Timer execAsync(final String cmd, final AsyncInvoke syncInvoke, int interval, final Filter filter) {
67 | Timer timer = new Timer();
68 | TimerTask timerTask = new TimerTask() {
69 | @Override
70 | public void run() {
71 | try {
72 | // Log.d("cpu start");
73 | // Log.d("exec " + cmd);
74 | Process process = Runtime.getRuntime().exec(cmd);
75 | InputStream inputStream = process.getInputStream();
76 | BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
77 | String line;
78 | boolean isGetCpu = false;
79 | while ((line = reader.readLine()) != null) {
80 | if (filter.filt(line)) {
81 | isGetCpu = true;
82 | if (syncInvoke != null) syncInvoke.invoke(line);
83 | }
84 | }
85 | if (!isGetCpu && syncInvoke != null) {
86 | syncInvoke.invoke(Constant.APP_NOT_STARTING);
87 | }
88 | process.waitFor();
89 | inputStream.close();
90 | reader.close();
91 | process.destroy();
92 | } catch (Exception e) {
93 | e.printStackTrace();
94 | Log.e("出错:" + e.getMessage());
95 | }
96 | }
97 | };
98 | if (interval > 0)
99 | timer.schedule(timerTask, 0, interval);
100 | else
101 | timer.schedule(timerTask, 0);
102 | return timer;
103 | }
104 |
105 | public interface AsyncInvoke {
106 | void invoke(String line);
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/fastautotest/src/main/java/yph/utils/SleepUtil.java:
--------------------------------------------------------------------------------
1 | package yph.utils;
2 |
3 | /**
4 | * Created by _yph on 2018/3/25 0025.
5 | */
6 |
7 | public class SleepUtil {
8 | public static void s(long ms){
9 | try {
10 | Thread.sleep(ms);
11 | } catch (InterruptedException e) {
12 | e.printStackTrace();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/fastautotest/src/main/java/yph/utils/SystemEnvUtil.java:
--------------------------------------------------------------------------------
1 | package yph.utils;
2 |
3 | import org.apache.commons.io.FileUtils;
4 |
5 | import java.io.*;
6 | import java.util.Arrays;
7 |
8 | /**
9 | * Created by _yph on 2018/5/7 0007.
10 | */
11 | public class SystemEnvUtil {
12 |
13 | private static String[] adbFiles = {"adb.exe", "AdbWinApi.dll", "AdbWinUsbApi.dll"};
14 |
15 | public static String getResCopyAdb() {
16 | try {
17 | for (String adbFile : adbFiles) {
18 | fileCopy("/adb/"+adbFile, "/adb/"+adbFile);
19 | }
20 | } catch (Exception e) {
21 | e.printStackTrace();
22 | throw new IllegalStateException("copy adb失败,请手动copy " +
23 | Arrays.asList(adbFiles).toString() + " 至项目根目录adb文件夹下");
24 | }
25 | return "/adb/" + adbFiles[0];
26 | }
27 |
28 | public static String getCopyAdb() {
29 | String destAdb = "adb/";
30 | for (int i = 0; i < adbFiles.length; i++) {
31 | if (!new File(destAdb + adbFiles[i]).exists())
32 | break;
33 | else if (i == adbFiles.length - 1)
34 | return destAdb + adbFiles[0];
35 | }
36 |
37 | String oriAdb = getSystemAdb();
38 | if (oriAdb == null) {
39 | throw new IllegalStateException("not set adb environment");
40 | } else {
41 | copyAdb(oriAdb + "/", destAdb);
42 | }
43 | return destAdb + adbFiles[0];
44 | }
45 |
46 | private static String getSystemAdb() {
47 | String pathString = System.getenv("Path");
48 | String[] arr = pathString.split(";");
49 | for (String s : arr) {
50 | if (s.contains("\\platform-tools")) {
51 | return s;
52 | }
53 | }
54 | String androidHome = System.getenv("ANDROID_HOME");
55 | if (androidHome != null) {
56 | return androidHome + "/platform-tools";
57 | }
58 | return null;
59 | }
60 |
61 | private static void copyAdb(String oriAdb, String destAdb) {
62 | try {
63 | for (String adbFile : adbFiles) {
64 | FileUtils.copyFile(new File(oriAdb + adbFile), new File(destAdb + adbFile));
65 | }
66 | } catch (IOException e) {
67 | e.printStackTrace();
68 | throw new IllegalStateException("copy adb fail,请手动copy " +
69 | Arrays.asList(adbFiles).toString() + " 至项目根目录adb文件夹下");
70 | }
71 | }
72 |
73 | public static void fileCopy(String srcFilePath, String destFilePath) throws Exception {
74 | File destFile = new File(destFilePath);
75 | FileUtils.forceMkdirParent(destFile);
76 | BufferedInputStream fis = new BufferedInputStream(ClassLoader.getSystemResourceAsStream(srcFilePath));
77 | FileOutputStream fos = new FileOutputStream(destFile);
78 | byte[] buf = new byte[1024];
79 | int c;
80 | while ((c = fis.read(buf)) != -1) {
81 | fos.write(buf, 0, c);
82 | }
83 | fis.close();
84 | fos.close();
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/fastautotest/src/main/java/yph/utils/TimeUtil.java:
--------------------------------------------------------------------------------
1 | package yph.utils;
2 |
3 |
4 | import java.text.DateFormat;
5 | import java.text.ParseException;
6 | import java.text.SimpleDateFormat;
7 | import java.util.Calendar;
8 | import java.util.Date;
9 | import java.util.Locale;
10 |
11 | /**
12 | * Created by _yph on 2016/2/11 0011.
13 | */
14 | public class TimeUtil {
15 |
16 | //format : "yyyy-MM-dd HH:mm:ss"
17 | public static String getTime(String format) {
18 | Date curDate = new Date(System.currentTimeMillis());// 获取当前时间
19 | return new SimpleDateFormat(format).format(curDate);
20 | }
21 |
22 | public static String getTime() {
23 | Date curDate = new Date(System.currentTimeMillis());// 获取当前时间
24 | return new SimpleDateFormat("yyyyMMddHHmmss").format(curDate);
25 | }
26 |
27 | public static String getTimeAndAddOne(String format, int i) {
28 | return addOne(new Date(System.currentTimeMillis()), format, i);
29 | }
30 |
31 | public static String addOne(Date curDate, String format, int i) {
32 | Calendar cal = Calendar.getInstance();
33 | cal.setTime(curDate);
34 | cal.add(i, 1);
35 | return new SimpleDateFormat(format).format(cal.getTime());
36 | }
37 |
38 | public static String timeP(long oldtime) {
39 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
40 | return sdf.format(new Date(oldtime));
41 | }
42 |
43 | public static long timeSubtract(String time2) {
44 | return timeSubtract(getTime("yyyy-MM-dd HH:mm:ss"), time2);
45 | }
46 |
47 | public static long timeSubtract(String time1, String time2) {
48 | DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
49 | try {
50 | Date d1 = df.parse(time1);
51 | Date d2 = df.parse(time2);
52 | long diff = d1.getTime() - d2.getTime();//这样得到的差值是微秒级别
53 | return diff/(1000 * 60);
54 | // System.out.println("" +diff/(1000 * 60));
55 | // long days = diff / (1000 * 60 * 60 * 24);
56 | // long hours = (diff - days * (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
57 | // long minutes = (diff - days * (1000 * 60 * 60 * 24) - hours * (1000 * 60 * 60)) / (1000 * 60);
58 | // System.out.println("" + days + "天" + hours + "小时" + minutes + "分");
59 | } catch (Exception e) {
60 | return -1;
61 | }
62 | }
63 |
64 | public static String getWeek(String str) {
65 | SimpleDateFormat sdf = new SimpleDateFormat("EEEE");
66 | String week = sdf.format(parseDate(str, "yyyy-MM-dd HH:mm"));
67 | return week;
68 | }
69 |
70 | //根据日期取得星期几
71 | public static String getWeek_(String str) {
72 | SimpleDateFormat sdf = new SimpleDateFormat("EEEE");
73 | String week = sdf.format(parseDate(str, "yyyy-MM-dd"));
74 | return week;
75 | }
76 |
77 | public static int daysOfTwo(Date fDate, Date oDate) {
78 |
79 | Calendar aCalendar = Calendar.getInstance();
80 |
81 | aCalendar.setTime(fDate);
82 |
83 | int day1 = aCalendar.get(Calendar.DAY_OF_YEAR);
84 |
85 | aCalendar.setTime(oDate);
86 |
87 | int day2 = aCalendar.get(Calendar.DAY_OF_YEAR);
88 |
89 | return day2 - day1;
90 |
91 | }
92 |
93 | /**
94 | * String转换为时间
95 | *
96 | * @param str
97 | * @return
98 | */
99 | public static Date parseDate(String str, String format) {
100 | SimpleDateFormat dateFormat = new SimpleDateFormat(format);
101 | Date addTime = null;
102 | try {
103 | addTime = dateFormat.parse(str);
104 | } catch (ParseException e) {
105 | e.printStackTrace();
106 | }
107 | return addTime;
108 | }
109 |
110 | /**
111 | * 传入的时间在现在时间之前,注:不能比較只有 時分 的情況
112 | */
113 | public static boolean isTimeBeforeNow(String str, String format) {
114 | return parseDate(str, format).before(new Date(System.currentTimeMillis()));
115 | }
116 |
117 | /**
118 | * 传入的时间在现在时间之后,注:不能比較只有 時分 的情況
119 | */
120 | public static boolean isTimeAfterNow(String str, String format) {
121 | return parseDate(str, format).after(new Date(System.currentTimeMillis()));
122 | }
123 |
124 | /**
125 | * 将日期转换为字符串
126 | *
127 | * @param date
128 | * @return
129 | */
130 | public static String ParseDateToString(Date date) {
131 | return ParseDateToString(date, "yyyy-MM-dd HH:mm:ss");
132 | }
133 |
134 | /**
135 | * 将日期转换为字符串(重载)
136 | *
137 | * @param date
138 | * @param format:时间格式,必须符合yyyy-MM-dd HH:mm:ss
139 | * @return
140 | */
141 | public static String ParseDateToString(Date date, String format) {
142 | SimpleDateFormat dateFormat = new SimpleDateFormat(format);
143 |
144 | return dateFormat.format(date);
145 | }
146 |
147 | /**
148 | * 将UMT时间转换为本地时间
149 | *
150 | * @param str
151 | * @return
152 | * @throws ParseException
153 | */
154 | public static Date ParseUTCDate(String str) {
155 | //格式化2012-03-04T23:42:00+08:00
156 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.CHINA);
157 | try {
158 | Date date = formatter.parse(str);
159 | return date;
160 | } catch (ParseException e) {
161 | //格式化Sat, 17 Mar 2012 11:37:13 +0000
162 | //Sat, 17 Mar 2012 22:13:41 +0800
163 | try {
164 | SimpleDateFormat formatter2 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.CHINA);
165 | Date date2 = formatter2.parse(str);
166 |
167 | return date2;
168 | } catch (ParseException ex) {
169 | return null;
170 | }
171 | }
172 | }
173 |
174 | /**
175 | * 将时间转换为中文
176 | *
177 | * @param datetime
178 | * @return
179 | */
180 | public static String DateToChineseString(Date datetime) {
181 | Date today = new Date();
182 | long seconds = (today.getTime() - datetime.getTime()) / 1000;
183 |
184 | long year = seconds / (24 * 60 * 60 * 30 * 12);// 相差年数
185 | long month = seconds / (24 * 60 * 60 * 30);//相差月数
186 | long date = seconds / (24 * 60 * 60); //相差的天数
187 | long hour = (seconds - date * 24 * 60 * 60) / (60 * 60);//相差的小时数
188 | long minute = (seconds - date * 24 * 60 * 60 - hour * 60 * 60) / (60);//相差的分钟数
189 | long second = (seconds - date * 24 * 60 * 60 - hour * 60 * 60 - minute * 60);//相差的秒数
190 |
191 | if (year > 0) {
192 | return year + "年前";
193 | }
194 | if (month > 0) {
195 | return month + "月前";
196 | }
197 | if (date > 0) {
198 | return date + "天前";
199 | }
200 | if (hour > 0) {
201 | return hour + "小时前";
202 | }
203 | if (minute > 0) {
204 | return minute + "分钟前";
205 | }
206 | if (second > 0) {
207 | return second + "秒前";
208 | }
209 | return "未知时间";
210 | }
211 |
212 | /**
213 | * 将时间转换为分钟 如02:00 :01转换为120
214 | */
215 | public static String timeToMinute(String time) {
216 | String sArray[] = time.split(":");
217 | return Integer.valueOf(sArray[0]) * 60 + Integer.valueOf(sArray[1]) + "";
218 | }
219 |
220 | /**
221 | * 将时间转换为分钟 如02:00 :01转换为120
222 | */
223 | public static String timeTosecond(String time) {
224 | String sArray[] = time.split(":");
225 | return Integer.valueOf(sArray[0]) * 360 + Integer.valueOf(sArray[1]) * 60 + Integer.valueOf(sArray[2]) + "";
226 | }
227 |
228 | /**
229 | * 根据年 月 获取对应的月份 天数
230 | */
231 | public static int getDaysByYearMonth(String year, String month) {
232 |
233 | Calendar a = Calendar.getInstance();
234 | a.set(Calendar.YEAR, Integer.valueOf(year));
235 | a.set(Calendar.MONTH, Integer.valueOf(month) - 1);
236 | a.set(Calendar.DATE, 1);
237 | a.roll(Calendar.DATE, -1);
238 | int maxDate = a.get(Calendar.DATE);
239 | return maxDate;
240 | }
241 | }
242 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/messages/reportng.properties:
--------------------------------------------------------------------------------
1 | atTime=at
2 | causedBy=Caused by
3 | chronology=Chronology
4 | clickToExpandCollapse=Click to expand/collapse
5 | coverageReport=Coverage Report
6 | dependsOnGroups=Depends on group(s)
7 | dependsOnMethods=Depends on method(s)
8 | duration=Duration
9 | failed=Failed
10 | failed.tooltip=Some tests failed.
11 | failedConfiguration=Failed Configuration
12 | failedTests=Failed Tests
13 | generatedBy=Generated by TestNG with ReportNG
14 | groups=Groups
15 | groupsFor=Groups for
16 | logOutput=Log Output
17 | logOutput.description=Combined output from all calls to the log methods of the TestNG Reporter.
18 | method=Method
19 | methodArguments=Method arguments
20 | notApplicable=N/A
21 | onDate=on
22 | overview=Overview
23 | passed=Passed
24 | passed.tooltip=All tests passed.
25 | passedTests=Passed Tests
26 | passRate=Pass Rate
27 | skipped=Skipped
28 | skipped.reason=Reason
29 | skipped.tooltip=All executed tests passed but some tests were skipped.
30 | skippedConfiguration=Skipped Configuration
31 | skippedTests=Skipped Tests
32 | startTime=Start Time
33 | suites=Suites
34 | testDuration=Test duration
35 | thread=Thread
36 | total=Total
37 | log=Log Info
38 | screenshot=Screen Shot
39 | authod=Authod
40 | runcounts=RunCounts
41 | scanPerformance=ScanPerformance
42 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/messages/reportng_fr.properties:
--------------------------------------------------------------------------------
1 | atTime=à
2 | causedBy=Causés par
3 | chronology=Chronologie
4 | clickToExpandCollapse=Cliquez pour afficher/cacher
5 | coverageReport=Couverture de Test
6 | dependsOnGroups=Dépend des groupes
7 | dependsOnMethods=Dépend des méthodes
8 | duration=Durée
9 | failed=Échoué
10 | failed.tooltip=Quelques tests ont échoué.
11 | failedConfiguration=Configuration Échouée
12 | failedTests=Tests Échoués
13 | generatedBy=Générés par TestNG avec ReportNG
14 | groups=Groupes
15 | groupsFor=Groupes pour
16 | logOutput=Sortie de Journal
17 | logOutput.description=Le sortie combinée de toutes invocations des méthodes de la TestNG Reporter.
18 | method=Méthode
19 | methodArguments=Arguments de la méthode
20 | notApplicable=Néant
21 | onDate=du
22 | overview=Aperçu
23 | passed=Réussi
24 | passed.tooltip=Tous les tests ont réussi.
25 | passedTests=Tests Réussis
26 | passRate=Taux de Réussite
27 | skipped=Ignoré
28 | skipped.reason=Raison
29 | skipped.tooltip=Quelques tests ont été ignorées.
30 | skippedConfiguration=Configuration Ignorée
31 | skippedTests=Tests Ignorés
32 | suites=Suites
33 | testDuration=Durée de test
34 | total=Total
35 | authod=Authod
36 | runcounts=RunCounts
37 | scanPerformance=ScanPerformance
38 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/messages/reportng_pt.properties:
--------------------------------------------------------------------------------
1 | atTime=às
2 | causedBy=Causado por
3 | chronology=Cronologia
4 | clickToExpandCollapse=Clique para expandir/encolher
5 | coverageReport=Relatòrio de cobertura
6 | dependsOnGroups=Depende dos grupo(s)
7 | dependsOnMethods=Depende dos método(s)
8 | duration=Duração
9 | failed=Falha
10 | failed.tooltip=Alguns testes falharam.
11 | failedConfiguration=Configuração dos testes com Falha
12 | failedTests=Testes com Falha
13 | generatedBy=Gerado pelo TestNG com o ReportNG
14 | groups=Grupos
15 | groupsFor=Grupos para
16 | logOutput=Saída do Log
17 | logOutput.description=Saída de todas as chamadas aos métodos de log do TestNG Reporter.
18 | method=Método
19 | methodArguments=Argumentos do método
20 | notApplicable=N/D
21 | onDate=em
22 | overview=Resumo
23 | passed=Sucesso
24 | passed.tooltip=Todos os testes passaram.
25 | passedTests=Testes com Sucesso
26 | passRate=Taxa de sucesso
27 | skipped=Não executado
28 | skipped.reason=Razão
29 | skipped.tooltip=Todos os testes executados passaram, mas alguns não foram executados.
30 | skippedConfiguration=Configuração dos testes Não Executados
31 | skippedTests=Testes não executados
32 | suites=Suítes
33 | testDuration=Duração do teste
34 | total=Total
35 | authod=Authod
36 | runcounts=RunCounts
37 | scanPerformance=ScanPerformance
38 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/messages/reportng_zh_CN.properties:
--------------------------------------------------------------------------------
1 | atTime=at
2 | causedBy=Caused by
3 | chronology=Chronology
4 | clickToExpandCollapse=Click to expand/collapse
5 | coverageReport=Coverage Report
6 | dependsOnGroups=Depends on group(s)
7 | dependsOnMethods=Depends on method(s)
8 | duration=\u8017\u65f6
9 | failed=\u5931\u8d25
10 | failed.tooltip=Some tests failed.
11 | failedConfiguration=Failed Configuration
12 | failedTests=\u5931\u8d25\u7684\u6d4b\u8bd5
13 | generatedBy=Generated by TestNG with ReportNG
14 | groups=Groups
15 | groupsFor=Groups for
16 | logOutput=Log Output
17 | logOutput.description=Combined output from all calls to the log methods of the TestNG Reporter.
18 | method=Method
19 | methodArguments=Method arguments
20 | notApplicable=N/A
21 | onDate=on
22 | overview=\u603b\u89c8
23 | passed=\u901a\u8fc7
24 | passed.tooltip=All tests passed.
25 | passedTests=\u901a\u8fc7\u7684\u6d4b\u8bd5
26 | passRate=\u901a\u8fc7\u7387
27 | skipped=\u8df3\u8fc7
28 | skipped.reason=Reason
29 | skipped.tooltip=All executed tests passed but some tests were skipped.
30 | skippedConfiguration=Skipped Configuration
31 | skippedTests=\u5df2\u8df3\u8fc7\u7684\u6d4b\u8bd5
32 | startTime=\u5f00\u59cb\u65f6\u95f4
33 | suites=Suites
34 | testDuration=Test duration
35 | thread=Thread
36 | total=\u5168\u90e8
37 | log=Log
38 | screenshot=\u622a\u56fe
39 | authod=\u4f5c\u8005
40 | runcounts=\u6267\u884c\u6b21\u6570
41 | scanPerformance=\u67e5\u770b\u6027\u80fd\u8d70\u52bf\u56fe
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/class-results.html.vm:
--------------------------------------------------------------------------------
1 | ## This macro formats the results (whether passed, skipped or failed) of the test
2 | ## methods in a single class for inclusion in the HTML report. It assumes that the
3 | ## the results for the class are in a variable called $classResults. $id is a page
4 | ## scope variable that is used to assign unique identifiers to divs.
5 |
6 | #foreach ($testResult in $classResults)
7 |
8 |
9 | #set ($testInstanceName = "")
10 | #if ($testResult.testName)
11 | #set ($testInstanceName = " ($testResult.testName)")
12 | #end
13 | #if ($testResult.method.description && $testResult.method.description.length() > 0)
14 | $testResult.name$testInstanceName ($testResult.method.description)
15 | #else
16 | $testResult.name$testInstanceName
17 | #end
18 | |
19 |
20 | $utils.formatDuration($testResult.startMillis, $testResult.endMillis)s
21 | |
22 |
23 | $utils.getAuthod($testResult)
24 | |
25 |
26 | $utils.getRunCounts($testResult)
27 | |
28 |
29 | ## Display the dependencies for skipped test methods.
30 | #if ($testResult.status == 3) ## 3 means skipped.
31 | #if( $utils.hasDependentGroups($testResult) )
32 | $messages.getString("dependsOnGroups"):
33 | $utils.getDependentGroups($testResult)
34 |
35 | #end
36 | #if ($utils.hasDependentMethods($testResult))
37 | $messages.getString("dependsOnMethods"):
38 | $utils.getDependentMethods($testResult)
39 | #end
40 | #if ($utils.hasSkipException($testResult))
41 | $messages.getString("skipped.reason"):
42 | $utils.getSkipExceptionMessage($testResult)
43 | #end
44 | #end
45 |
46 | #if ($utils.hasArguments($testResult))
47 | $messages.getString("methodArguments"): $utils.getArguments($testResult)
48 | #end
49 |
50 | ## Show logger output for the test.
51 | #set ($output = $utils.getTestOutputWithoutRunCount($testResult))
52 | #if ($output.size() > 0)
53 |
54 | #foreach( $line in $output )
55 | #if ($meta.shouldEscapeOutput())
56 | $utils.escapeHTMLString($utils.removeImage($line))
57 | #else
58 | $utils.removeImage($line)
59 | #end
60 | #end
61 |
62 | #end
63 |
64 |
65 | #if ($testResult.throwable && ( $testResult.status == 2 || $meta.shouldShowExpectedExceptions()))
66 | $utils.escapeHTMLString( $testResult.throwable.toString() )
67 |
68 | #foreach ($element in $testResult.throwable.stackTrace)
69 | $utils.escapeHTMLString( $element.toString() )
70 | #end
71 | #set ($causes = $utils.getCauses($testResult.throwable))
72 | #foreach ($throwable in $causes)
73 | #set ($id = $id + 1)
74 | $messages.getString("causedBy"): $utils.escapeHTMLString( $throwable.toString() )
75 |
76 | #foreach ($element in $throwable.stackTrace)
77 | $utils.escapeHTMLString($element.toString())
78 | #end
79 |
80 | #end
81 |
82 | #end
83 | #set ($id = $id + 1)
84 | |
85 |
86 | #set ($output = $utils.getTestOutput($testResult))
87 | #if ($output.size() > 0)
88 |
89 | #foreach( $line in $output )
90 | #if ($meta.shouldEscapeOutput())
91 | $utils.escapeHTMLString($utils.getImageString($line))
92 | #else
93 | $utils.getImageString($line)
94 | #end
95 | #end
96 |
97 | #end
98 | |
99 |
100 | #end
101 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/groups.html.vm:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | $meta.reportTitle - $suite.name - $messages.getString("groups")
7 |
8 |
9 |
10 | #if ($meta.stylesheetPath)
11 |
12 | #end
13 |
14 |
15 | $messages.getString("groupsFor") $suite.name
16 |
17 |
18 | #foreach ($group in $groups.keySet())
19 |
20 | $group |
21 |
22 | #foreach ($test in $groups.get($group))
23 |
24 | ${test.realClass.name}.${test.methodName} |
25 |
26 | #end
27 | #end
28 |
29 |
30 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/index.html.vm:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | $meta.reportTitle
7 |
8 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/output.html.vm:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | $meta.reportTitle - $messages.getString("logOutput")
7 |
8 |
9 |
10 | #if ($meta.stylesheetPath)
11 |
12 | #end
13 |
14 |
15 | $messages.getString("logOutput")
16 |
17 | $messages.getString("logOutput.description")
18 |
19 |
20 |
21 | #foreach ($line in $utils.allOutput)
22 | #if ($meta.shouldEscapeOutput())
23 | $utils.escapeHTMLString($line)
24 | #else
25 | $line
26 | #end
27 | #end
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/overview.html.vm:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | $meta.reportTitle - $messages.getString("overview")
7 |
8 |
9 |
10 | #if ($meta.stylesheetPath)
11 |
12 | #end
13 |
14 |
15 |
16 |
17 |
18 | FastAutoTest(Power By yph)
19 | $messages.getString("generatedBy")
20 | $messages.getString("atTime") $meta.reportTime $messages.getString("onDate") $meta.reportDate
21 |
$meta.user / $meta.javaInfo / $meta.platform
22 |
23 |
24 | $meta.reportTitle
25 | #if (!$utils.allOutput.empty)
26 |
27 | $messages.getString("logOutput")
28 | #if ($meta.coverageLink)
29 | · $messages.getString("coverageReport")
30 | #end
31 |
32 | #end
33 |
46 |
47 | #foreach ($suite in $suites)
48 | #set($tempName = $suite.name.replace(' ',''))
49 |
50 | #end
51 |
52 | #foreach ($suite in $suites)
53 |
54 | #set ($suiteId = $velocityCount)
55 | #set ($totalTests = 0)
56 | #set ($totalPassed = 0)
57 | #set ($totalSkipped = 0)
58 | #set ($totalFailed = 0)
59 |
60 |
71 |
72 |
73 | |
74 | $messages.getString("duration") |
75 | $messages.getString("passed") |
76 | $messages.getString("skipped") |
77 | $messages.getString("failed") |
78 | $messages.getString("passRate") |
79 |
80 | #foreach ($result in $suite.results)
81 | #set ($notPassedTests = $result.testContext.skippedTests.size() + $result.testContext.failedTests.size())
82 | #set ($total = $result.testContext.passedTests.size() + $notPassedTests)
83 | #set ($totalTests = $totalTests + $total)
84 | #set ($totalPassed = $totalPassed + $result.testContext.passedTests.size())
85 | #set ($totalSkipped = $totalSkipped + $result.testContext.skippedTests.size())
86 | #set ($totalFailed = $totalFailed + $result.testContext.failedTests.size())
87 | #set ($failuresExist = $result.testContext.failedTests.size()>0 || $result.testContext.failedConfigurations.size()>0)
88 |
89 | #if (($onlyReportFailures && $failuresExist) || (!$onlyReportFailures))
90 |
91 |
92 | ${result.testContext.name}
93 | |
94 |
95 | $utils.formatDuration($utils.getDuration($result.testContext))s
96 | |
97 |
98 | #if ($result.testContext.passedTests.size() > 0)
99 | $result.testContext.passedTests.size() |
100 | #else
101 | 0 |
102 | #end
103 |
104 | #if ($result.testContext.skippedTests.size() > 0)
105 | $result.testContext.skippedTests.size() |
106 | #else
107 | 0 |
108 | #end
109 |
110 | #if ($result.testContext.failedTests.size() > 0)
111 | $result.testContext.failedTests.size() |
112 | #else
113 | 0 |
114 | #end
115 |
116 |
117 | #if ($total > 0)
118 | #set ($passes = $total - $notPassedTests)
119 | $utils.formatPercentage($passes, $total)
120 | #else
121 | $messages.getString("notApplicable")
122 | #end
123 | |
124 |
125 | #end
126 | #end
127 |
128 |
129 | $messages.getString("total")$messages.getString("scanPerformance") |
130 | |
131 | #if ($totalPassed > 0)
132 | $totalPassed |
133 | #else
134 | 0 |
135 | #end
136 |
137 | #if ($totalSkipped > 0)
138 | $totalSkipped |
139 | #else
140 | 0 |
141 | #end
142 |
143 | #if ($totalFailed > 0)
144 | $totalFailed |
145 | #else
146 | 0 |
147 | #end
148 |
149 |
150 | #if ($totalTests > 0)
151 | #set ($totalPasses = $totalTests - $totalSkipped - $totalFailed)
152 | $utils.formatPercentage($totalPasses, $totalTests)
153 | #else
154 | $messages.getString("notApplicable")
155 | #end
156 | |
157 |
158 |
159 |
160 | #end
161 |
169 |
170 |
171 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/performance.html.vm:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 | $meta.reportTitle - $messages.getString("scanPerformance")
8 |
9 |
10 |
11 | #if ($meta.stylesheetPath)
12 |
13 | #end
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/reportng.css:
--------------------------------------------------------------------------------
1 | * {padding: 0; margin: 0;}
2 | a {color: #006699;}
3 | a:visited {color: #003366;}
4 | body {font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; line-height: 1.8em; font-size: 62.5%; margin: 1.8em 1em;}
5 | h1 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 2.7em; margin-bottom: 0.6667em;}
6 | h2 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 1.8em; margin-bottom: 0;}
7 | p {font-size: 1.3em;}
8 | td {font-size: 1.3em;}
9 |
10 | .header {font-size: 1.4em; font-weight: bold; text-align: left;}
11 | .passed {background-color: #44aa44;}
12 | .skipped {background-color: #ffaa00;}
13 | .failed {background-color: #ff4444;}
14 | .failedConfig {background-color: #800000; color: #ffffff}
15 | .skippedConfig {background-color: #cc6600; color: #ffffff}
16 | .totalLabel {font-weight: bold; background-color: #ffffff;}
17 |
18 | .suite {background-color: #999999; font-weight: bold;}
19 | .test {background-color: #eeeeee; padding-left: 2em;}
20 | .test .passed {background-color: #88ee88;}
21 | .test .skipped {background-color: #ffff77;}
22 | .test .failed {background-color: #ff8888;}
23 | .group {background-color: #cccccc; color: #000000; font-weight: bold;}
24 | .suiteLinks {float: right; font-weight: normal; vertical-align: middle;}
25 | .suiteLinks a {color: #ffffff; margin-left: .5em;}
26 | .passRate {font-weight: bold; text-align: right;}
27 | .duration {text-align: left;}
28 | .thread {white-space: nowrap;}
29 |
30 | .resultsTable {border: 0; width: 100%; margin-top: 1.8em; line-height: 1.7em; border-spacing: 0.1em;}
31 | .resultsTable .method {width: 10em;}
32 | .resultsTable .duration {width: 4em;}
33 | .resultsTable .authod {width: 3em;}
34 | .resultsTable .runcounts {width: 4em;}
35 | .resultsTable .screenshot {width: 4em;}
36 | .resultsTable td {vertical-align: top; padding: 0 1em;}
37 | .resultsTable th {padding: 0 .5em;}
38 | .number {text-align: right;}
39 | .zero {font-weight: normal;}
40 | .columnHeadings {font-size: 1em;}
41 | .columnHeadings th {font-weight: normal;}
42 |
43 | .configTable {border: 1px solid #800000; color: #800000; margin-bottom: 1.5em;}
44 |
45 | #sidebarHeader {padding: 1.8em 1em; margin: 0 -1em 1.8em -1em;}
46 | #suites {line-height: 1.7em; border-spacing: 0.1em; width: 100%;}
47 | .tests {display: table-row-group;}
48 | .header.suite {cursor: pointer; clear: right; height: 1.214em; margin-top: 1px;}
49 | div.test {margin-top: 0.1em; clear: right; font-size: 1.3em;}
50 |
51 | /* The +/- toggle used in the navigation frame. */
52 | .toggle {font-family: monospace; font-weight: bold; padding-left: 2px; padding-right: 5px; color: #777777;}
53 | .successIndicator {float: right; font-family: monospace; font-weight: bold; padding-right: 2px; color: #44aa44;}
54 | .skipIndicator {float: right; font-family: monospace; font-weight: bold; padding-right: 2px; color: #ffaa00;}
55 | .failureIndicator {float: right; font-family: monospace; font-weight: bold; padding-right: 2px; color: #ff4444;}
56 |
57 |
58 | /* These classes are for information about an individual test result. */
59 | .result {font-size: 1.1em; vertical-align: middle;}
60 | .dependency {font-family: Lucida Console, Monaco, Courier New, monospace; font-weight: bold;}
61 | .arguments {font-family: Lucida Console, Monaco, Courier New, monospace; font-weight: bold;}
62 | .testOutput {font-family: Lucida Console, Monaco, Courier New, monospace; color: #666666;}
63 | .stackTrace {font-size: 0.9em; line-height: 1.2em; margin-left: 2em; display: none;}
64 | .stackTrace .stackTrace {font-size: inherit;}
65 |
66 | .description {border-bottom: 1px dotted #006699;}
67 |
68 | #meta {font-size: 1em; text-align: right; float: right;}
69 | #systemInfo {color: #666666;}
70 |
71 | /* Reporter log output (individual test ouput is style by "testOutput" above). */
72 | #log {font-family: Lucida Console, Monaco, Courier New, monospace; font-size: 1.3em; margin-top: 1.8em;}
73 |
74 | .overviewTable {width: 100%; margin-top: 1.8em; line-height: 1.7em; border-spacing: 0.1em;}
75 | .overviewTable td {padding: 0 1em;}
76 | .overviewTable th {padding: 0 .5em;}
77 | .overviewTable .duration {width: 6em;}
78 | .overviewTable .passRate {width: 6em;}
79 | .overviewTable .number {width: 5em;}
80 | .overviewTable tr {height: 1.6em;}
81 |
82 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/reportng.js:
--------------------------------------------------------------------------------
1 | function toggleElement(elementId, displayStyle) {
2 | var element = document.getElementById(elementId);
3 | var current = element.currentStyle ?
4 | element.currentStyle['display'] :
5 | document.defaultView.getComputedStyle(element, null).getPropertyValue('display');
6 | element.style.display = (current == 'none' ? displayStyle : 'none');
7 | }
8 |
9 | function toggle(toggleId) {
10 | var toggle = document.getElementById ? document.getElementById(toggleId) : document.all[toggleId];
11 | toggle.textContent = toggle.innerHTML == '\u25b6' ? '\u25bc' : '\u25b6';
12 | }
13 |
14 | function imgShow(outerdiv, innerdiv, bigimg, _this) {
15 | var src = _this.attr("src"); //获取当前点击的pimg元素中的src属性
16 | $(bigimg).attr("src", src); //设置#bigimg元素的src属性
17 |
18 | /*获取当前点击图片的真实大小,并显示弹出层及大图*/
19 | $("
").attr("src", src).load(function() {
20 | var windowW = $(window).width() > window.screen.availWidth ? document.body.clientWidth : $(window).width(); //获取当前窗口宽度
21 | var windowH = $(window).height() > window.screen.availHeight ? document.body.clientHeight : $(window).height(); //获取当前窗口高度
22 | var realWidth = this.width; //获取图片真实宽度
23 | var realHeight = this.height; //获取图片真实高度
24 | var imgWidth, imgHeight;
25 | var scale = 1; //缩放尺寸,当图片真实宽度和高度大于窗口宽度和高度时进行缩放
26 |
27 | if(realHeight > windowH * scale) { //判断图片高度
28 | imgHeight = windowH * scale; //如大于窗口高度,图片高度进行缩放
29 | imgWidth = imgHeight / realHeight * realWidth; //等比例缩放宽度
30 | if(imgWidth > windowW * scale) { //如宽度扔大于窗口宽度
31 | imgWidth = windowW * scale; //再对宽度进行缩放
32 | }
33 | } else if(realWidth > windowW * scale) { //如图片高度合适,判断图片宽度
34 | imgWidth = windowW * scale; //如大于窗口宽度,图片宽度进行缩放
35 | imgHeight = imgWidth / realWidth * realHeight; //等比例缩放高度
36 | } else { //如果图片真实高度和宽度都符合要求,高宽不变
37 | imgWidth = realWidth;
38 | imgHeight = realHeight;
39 | }
40 | $(bigimg).css("width", imgWidth); //以最终的宽度对图片缩放
41 |
42 | var w = (windowW - imgWidth) / 2; //计算图片与窗口左边距
43 | var h = (windowH - imgHeight) / 2; //计算图片与窗口上边距
44 | $(innerdiv).css({
45 | "top": h,
46 | "left": w
47 | }); //设置#innerdiv的top和left属性
48 | $(outerdiv).fadeIn("fast"); //淡入显示#outerdiv及.pimg
49 | });
50 |
51 | $(outerdiv).click(function() { //再次点击淡出消失弹出层
52 | $(this).fadeOut("fast");
53 | });
54 | }
55 |
56 | function showCircleChart(render, title) {
57 | pcount = document.getElementById(title + "tpn").innerHTML;
58 | fcount = document.getElementById(title + "tfn").innerHTML;
59 | scount = document.getElementById(title + "tsn").innerHTML;
60 | var chart = iChart.create({
61 | render: render,
62 | width: 340,
63 | height: 260,
64 | background_color: "#fefefe",
65 | gradient: false,
66 | color_factor: 0.2,
67 | border: {
68 | color: "BCBCBC",
69 | width: 0
70 | },
71 | align: "top|center",
72 | offsetx: 0,
73 | offsety: 0,
74 | sub_option: {
75 | border: {
76 | color: "#BCBCBC",
77 | width: 1
78 | },
79 | label: {
80 | fontweight: 500,
81 | fontsize: 11,
82 | color: "#4572a7",
83 | sign: "square",
84 | sign_size: 12,
85 | border: {
86 | color: "#BCBCBC",
87 | width: 1
88 | }
89 | }
90 | },
91 | shadow: true,
92 | shadow_color: "#666666",
93 | shadow_blur: 2,
94 | showpercent: false,
95 | column_width: "70%",
96 | bar_height: "70%",
97 | radius: "90%",
98 | title: {
99 | text: title,
100 | color: '#3e576f'
101 | },
102 | subtitle: {
103 | text: "",
104 | color: "#111111",
105 | fontsize: 16,
106 | font: "微软雅黑",
107 | textAlign: "center",
108 | height: 20,
109 | offsetx: 0,
110 | offsety: 0
111 | },
112 | footnote: {
113 | text: "",
114 | color: "#111111",
115 | fontsize: 12,
116 | font: "微软雅黑",
117 | textAlign: "right",
118 | height: 20,
119 | offsetx: 0,
120 | offsety: 0
121 | },
122 | legend: {
123 | enable: false,
124 | background_color: "#fefefe",
125 | color: "#333333",
126 | fontsize: 12,
127 | border: {
128 | color: "#BCBCBC",
129 | width: 1
130 | },
131 | column: 1,
132 | align: "right",
133 | valign: "center",
134 | offsetx: 0,
135 | offsety: 0
136 | },
137 | coordinate: {
138 | width: "80%",
139 | height: "84%",
140 | background_color: "#ffffff",
141 | axis: {
142 | color: "#a5acb8",
143 | width: [1, "", 1, ""]
144 | },
145 | grid_color: "#d9d9d9",
146 | label: {
147 | fontweight: 500,
148 | color: "#666666",
149 | fontsize: 11
150 | }
151 | },
152 | label: {
153 | fontweight: 500,
154 | color: "#666666",
155 | fontsize: 11
156 | },
157 | type: "pie2d",
158 | data: [{
159 | name: "Passed",
160 | value: pcount,
161 | color: "#44aa44"
162 | }, {
163 | name: "Failed",
164 | value: fcount,
165 | color: "#ff4444"
166 | }, {
167 | name: "Skipped",
168 | value: scount,
169 | color: "#FFD700"
170 | }]
171 | });
172 | chart.draw();
173 | }
174 |
175 | function showLineChart(render, title, subtitle,unit, value ,stack) {
176 | var data = [{
177 | name: 'PV',
178 | value: value,
179 | color: '#ec4646',
180 | line_width: 2
181 | }];
182 | var chartWidth;
183 | if(value.length<100){
184 | chartWidth = 1000
185 | }else{
186 | chartWidth = value.length*10
187 | }
188 | var coordinateWidth = chartWidth-60;
189 | var chart = new iChart.LineBasic2D({
190 | render: render,
191 | data: data,
192 | align: 'right',
193 | title: {
194 | text: title,
195 | font: '微软雅黑',
196 | fontsize: 24,
197 | color: '#b4b4b4'
198 | },
199 | subtitle : {
200 | text:subtitle,
201 | font : '微软雅黑',
202 | fontsize: 12,
203 | color:'#b4b4b4'
204 | },
205 | width: chartWidth,
206 | height: 330,
207 | shadow: true,
208 | shadow_color: '#202020',
209 | shadow_blur: 8,
210 | shadow_offsetx: 0,
211 | shadow_offsety: 0,
212 | background_color: '#2e2e2e',
213 | tip: {
214 | enable: true,
215 | shadow: true,
216 | listeners: {
217 | //tip:提示框对象、name:数据名称、value:数据值、text:当前文本、i:数据点的索引
218 | parseText: function(tip, name, value, text, i) {
219 | return ""+stack[i]+"
";
220 | }
221 | }
222 | },
223 | crosshair: {
224 | enable: true,
225 | line_color: '#ec4646'
226 | },
227 | sub_option: {
228 | smooth: true,
229 | label: false,
230 | hollow: false,
231 | hollow_inside: false,
232 | point_size: 8
233 | },
234 | coordinate: {
235 | width: coordinateWidth,
236 | height: 240,
237 | striped_factor: 0.18,
238 | grid_color: '#4e4e4e',
239 | axis: {
240 | color: '#252525',
241 | width: [0, 0, 4, 4]
242 | },
243 | scale: [{
244 | position: 'left',
245 | start_scale: 0,
246 | end_scale: 100,
247 | scale_space: 10,
248 | scale_size: 2,
249 | scale_enable: false,
250 | label: {
251 | color: '#9d987a',
252 | font: '微软雅黑',
253 | fontsize: 11,
254 | fontweight: 600
255 | },
256 | scale_color: '#9f9f9f'
257 | }]
258 | }
259 | });
260 | chart.plugin(new iChart.Custom({
261 | drawFn: function() {
262 | //计算位置
263 | var coo = chart.getCoordinate(),
264 | x = coo.get('originx'),
265 | y = coo.get('originy'),
266 | w = coo.width,
267 | h = coo.height;
268 | //在左上侧的位置,渲染一个单位的文字
269 | chart.target.textAlign('start')
270 | .textFont('600 11px 微软雅黑')
271 | .fillText(unit, x - 40, y - 12, false, '#9d987a')
272 | .textBaseline('top');
273 |
274 | }
275 | }));
276 | //开始画图
277 | chart.draw();
278 | }
279 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/results.html.vm:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | $meta.reportTitle - $result.testContext.name
7 |
8 |
9 |
10 | #if ($meta.stylesheetPath)
11 |
12 | #end
13 |
14 |
15 |
16 |
17 | $result.testContext.name
18 |
19 | $messages.getString("testDuration"): $utils.formatDuration($utils.getDuration($result.testContext))s
20 |
21 |
22 | #set ($id = 0)
23 | #if ($failedConfigurations.size() > 0)
24 |
25 |
26 | #set ($id = 0)
27 | #foreach ($testClass in $failedConfigurations.keySet())
28 |
29 | $testClass.name |
30 |
31 | #set ($classResults = $failedConfigurations.get($testClass))
32 | #parse("org/uncommons/reportng/templates/html/class-results.html.vm")
33 | #end
34 |
35 | #if ($skippedConfigurations.size() > 0)
36 | |
37 |
38 | #set ($id = 0)
39 | #foreach ($testClass in $skippedConfigurations.keySet())
40 |
41 | $testClass.name |
42 |
43 | #set ($classResults = $skippedConfigurations.get($testClass))
44 | #parse ("org/uncommons/reportng/templates/html/class-results.html.vm")
45 | #end
46 | #end
47 |
48 | #end
49 |
50 |
51 | #if ($failedTests.size() > 0)
52 |
53 |
54 | #foreach ($testClass in $failedTests.keySet())
55 |
56 | $testClass.name |
57 | $messages.getString("duration") |
58 | $messages.getString("authod") |
59 | $messages.getString("runcounts") |
60 | $messages.getString("log") |
61 | $messages.getString("screenshot") |
62 |
63 | #set ($classResults = $failedTests.get($testClass))
64 | #parse ("org/uncommons/reportng/templates/html/class-results.html.vm")
65 | #end
66 |
67 | #end
68 |
69 | #if ($skippedTests.size() > 0)
70 |
71 |
72 | #foreach ($testClass in $skippedTests.keySet())
73 |
74 | $testClass.name |
75 | $messages.getString("duration") |
76 | $messages.getString("authod") |
77 | $messages.getString("runcounts") |
78 | $messages.getString("log") |
79 | |
80 | #set ($classResults = $skippedTests.get($testClass))
81 | #parse ("org/uncommons/reportng/templates/html/class-results.html.vm")
82 | #end
83 |
84 | #end
85 |
86 | #if ($passedTests.size() > 0)
87 |
88 |
89 | #foreach ($testClass in $passedTests.keySet())
90 |
91 | $testClass.name |
92 | $messages.getString("duration") |
93 | $messages.getString("authod") |
94 | $messages.getString("runcounts") |
95 | $messages.getString("log") |
96 | |
97 |
98 | #set ($classResults = $passedTests.get($testClass))
99 | #parse ("org/uncommons/reportng/templates/html/class-results.html.vm")
100 | #end
101 |
102 | #end
103 |
104 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/html/suites.html.vm:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | $meta.reportTitle - $messages.getString("suites")
7 |
8 |
9 |
10 | #if ($meta.stylesheetPath)
11 |
12 | #end
13 |
14 |
15 |
16 |
17 |
29 |
30 | #foreach ($suite in $suites)
31 |
32 |
33 |
36 |
37 |
38 |
39 | #set ($suiteId = $velocityCount)
40 | #foreach ($result in $suite.results)
41 | #set ($failuresExist = $result.testContext.failedTests.size()>0 || $result.testContext.failedConfigurations.size()>0)
42 |
43 | #if (($onlyReportFailures && $failuresExist) || (!$onlyReportFailures))
44 |
45 |
46 | #if ($result.testContext.failedTests.size() > 0)
47 | ✘
48 | #else
49 | #if ($result.testContext.skippedTests.size() > 0)
50 | ✔
51 | #else
52 | ✔
53 | #end
54 | #end
55 | $result.testContext.name
56 | |
57 |
58 | #end
59 | #end
60 |
61 | #end
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/fastautotest/src/main/resources/org/uncommons/reportng/templates/xml/results.xml.vm:
--------------------------------------------------------------------------------
1 |
2 | #set ($totalTests = $results.passedTests.size() + $results.skippedTests.size() + $results.failedTests.size())
3 |
9 |
10 | #foreach ($testResult in $results.failedTests)
11 | #if ($testResult.testName)
12 |
13 | #else
14 |
15 | #end
16 | #if ($testResult.throwable)
17 |
24 |
35 |
36 |
37 | #else
38 |
45 | #end
46 |
47 | #end
48 |
49 | #foreach ($testResult in $results.skippedTests)
50 | #if ($testResult.testName)
51 |
52 | #else
53 |
54 | #end
55 |
56 |
57 | #end
58 |
59 | #foreach ($testResult in $results.passedTests)
60 | #if ($testResult.testName)
61 |
62 | #else
63 |
64 | #end
65 | #end
66 |
67 |
68 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/y-grey/FastAutoTest/1750b0a316a739be823702cc9777d82fd3ea38dd/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Oct 07 19:17:31 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':fastautotest'
--------------------------------------------------------------------------------