@@ -88,10 +88,10 @@ synchronized public static void createRequiredFolders(ISuite iSuite) {
88
88
}
89
89
90
90
/*
91
- * STEP 6: Finally create index.html page
91
+ * STEP 6: Finally create index.html page and one dashboard.html page per suite
92
92
*/
93
93
createIndexPage ();
94
-
94
+ createBlankDashboardPage ();
95
95
}
96
96
97
97
synchronized private static void copyFilesToDestination (String [] files , String destDirPath ) {
@@ -198,6 +198,37 @@ synchronized private static void createIndexPage() {
198
198
}
199
199
}
200
200
201
+ /**
202
+ * Method will create a dashboard.html page per suite. This page
203
+ * will contain only one line - "You are too quick. Please Wait for at least 1 test to end..."
204
+ * and will set to auto refresh in every 3sec.
205
+ */
206
+ synchronized private static void createBlankDashboardPage (){
207
+ for (DataSuite ds : DataMap .suiteSet ){
208
+ String dashboradHtml = REPORT_DIR + ds .getSuiteHTMLPath ();
209
+ if (new File (dashboradHtml ).exists ()) {
210
+ new File (dashboradHtml ).delete ();
211
+ }
212
+ PrintWriter pw = null ;
213
+ try {
214
+ pw = new PrintWriter (new FileOutputStream (
215
+ new File (dashboradHtml ), false ));
216
+ } catch (FileNotFoundException e ) {
217
+ }
218
+ if (pw != null ) {
219
+ pw .write ("<!DOCTYPE HTML>" + "<html>" + "<head>" + "<title>Dashboard</title>"
220
+ + "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />"
221
+ + "<meta http-equiv='refresh' content='3'>" + "</head>"
222
+ + "<body>" + "<div style='font-size: 48px;'>"
223
+ + "You are too quick. Please Wait for at least 1 test to end...</div>"
224
+ + "</body>" + "</html>" );
225
+ pw .flush ();
226
+ pw .close ();
227
+
228
+ }
229
+ }
230
+ }
231
+
201
232
synchronized private static void writeToFile (final InputStream input , final File target ){
202
233
try (OutputStream output = Files .newOutputStream (target .toPath ())){
203
234
byte [] buffer = new byte [8 * 1024 ];
0 commit comments