File tree Expand file tree Collapse file tree 8 files changed +44
-11
lines changed
java/com/aventstack/extentreports/reporter/configuration
com/aventstack/extentreports/view Expand file tree Collapse file tree 8 files changed +44
-11
lines changed Original file line number Diff line number Diff line change 1+ package com .aventstack .extentreports .reporter .configuration ;
2+
3+ /**
4+ * Allows selecting a CDN/resource loader for your FileReporter
5+ *
6+ * Note: Some hosts do not allow loading resources via HTTPS protocol:
7+ *
8+ * <ul>
9+ * <li>ExtentReports</li>
10+ * </ul>
11+ *
12+ */
13+ public enum ResourceCDN {
14+ GITHUB ,
15+ EXTENTREPORTS
16+ }
Original file line number Diff line number Diff line change @@ -85,4 +85,12 @@ public void setAutoCreateRelativePathMedia(boolean v) {
8585 usedConfigs .put ("autoCreateRelativePathMedia" , String .valueOf (v ));
8686 }
8787
88+ /**
89+ * Allows selecting a CDN/resource loader for your FileReporter
90+ *
91+ * @param resourceCDN the {@link ResourceCDN}
92+ */
93+ public void setResourceCDN (ResourceCDN resourceCDN ) {
94+ usedConfigs .put ("resourceCDN" , String .valueOf (resourceCDN ).toLowerCase ());
95+ }
8896}
Original file line number Diff line number Diff line change 1+ <#assign resourceCDN=config.getValue('resourceCDN') cdnURI="cdn.rawgit.com/extent-framework/extent-github-cdn/" csscommit="2bfb90a" jscommit="543bfe2" iconcommit="d74480e" >
2+ <#if resourceCDN=="extentreports" >
3+ <#assign cdnURI="extentreports.com/resx" csscommit="" jscommit="" iconcommit="" >
4+ </#if >
5+
16<head >
27 <meta charset =" utf-8" >
38 <meta name =" viewport" content =" width=device-width, initial-scale=1, shrink-to-fit=no" >
49 <title >${config.getValue("documentTitle") } </title >
5- <link rel =" apple-touch-icon" href =" https://cdn.rawgit.com/extent-framework/extent-github-cdn/d74480e /commons/img/logo.png" >
6- <link rel =" shortcut icon" href =" https://cdn.rawgit.com/extent-framework/extent-github-cdn/d74480e /commons/img/logo.png" >
7- <link href =" https://cdn.rawgit.com/extent-framework/extent-github-cdn/2bfb90a /spark/css/style.css" rel =" stylesheet" />
10+ <link rel =" apple-touch-icon" href =" https://${cdnURI}${iconcommit} /commons/img/logo.png" >
11+ <link rel =" shortcut icon" href =" https://${cdnURI}${iconcommit} /commons/img/logo.png" >
12+ <link href =" https://${cdnURI}${csscommit} /spark/css/style.css" rel =" stylesheet" />
813 <link href =" https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel =" stylesheet" >
914</head >
Original file line number Diff line number Diff line change 1- <script src =" https://cdn.rawgit.com/extent-framework/extent-github-cdn/543bfe2 /spark/js/script.js" ></script >
1+ <script src =" https://${cdnURI}${jscommit} /spark/js/script.js" ></script >
22<#if config.containsKey("scripts") && config.getValue("scripts")?has_content >
33<#include "../commons/commons-inject-js.ftl" >
44</#if >
Original file line number Diff line number Diff line change 1- <#assign timeStampFormat = config.getValue('timeStampFormat') >
2- <#assign cdn = config.getValue('cdn') >
3-
41<head >
52 <meta charset =' ${ config.getValue(' encoding ' ) }' />
63 <meta name =' description' content =' ' />
107
118 <link href =' ${ config.getValue(' protocol ' ) }://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600' rel =' stylesheet' type =' text/css' />
129 <link href =" ${ config.getValue('protocol') }://fonts.googleapis.com/icon?family=Material+Icons" rel =" stylesheet" />
13- <link href =' ${ config.getValue(' protocol ' ) }://cdn.rawgit.com/extent-framework/extent-github-cdn/8644a9c /v3html/css/extent.css' type =' text/css' rel =' stylesheet' />
10+ <link href =' ${ config.getValue(' protocol ' ) }://${cdnURI}${csscommit} /v3html/css/extent.css' type =' text/css' rel =' stylesheet' />
1411
1512 <title >${ config.getValue('documentTitle') }</title >
1613
Original file line number Diff line number Diff line change 3535<#assign parentLabel='suite(s)' childLabel='test(s)' grandChildLabel='method(s)' >
3636</#if >
3737</#if >
38+
39+ <#assign timeStampFormat = config.getValue('timeStampFormat') >
40+ <#assign resourceCDN=config.getValue('resourceCDN') cdnURI="cdn.rawgit.com/extent-framework/extent-github-cdn/" csscommit="8644a9c" jscommit="c23457b" >
41+ <#if resourceCDN=="extentreports" >
42+ <#assign cdnURI="extentreports.com/resx" csscommit="" jscommit="" >
43+ </#if >
44+
3845<!DOCTYPE html>
3946<html >
4047 <#include 'v3-html-head.ftl' >
108115 < #if config .getValue (' offline' )? string == ' true' >
109116 < script src= ' extent/js/extent.js' type= ' text/javascript' >< / script>
110117 < #else >
111- < script src= ' ${ config.getValue(' protocol' ) }://cdn.rawgit.com/extent-framework/extent-github-cdn/c23457b /v3html/js/extent.js' type= ' text/javascript' >< / script>
118+ < script src= ' ${ config.getValue(' protocol' ) }://${cdnURI}${jscommit} /v3html/js/extent.js' type= ' text/javascript' >< / script>
112119 < / #if >
113120 < #assign hide= (chartVisibleOnOpen== ' true' )? then (false , true )>
114121 < #if hide>
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ chartVisibilityOnOpen=true
66documentTitle =ExtentReports
77reportName =ExtentReports
88offline =false
9- cdn =github
9+ resourceCDN =github
1010timeStampFormat =MMM d, yyyy hh:mm:ss a
1111enableCategoryView =true
1212enableExceptionView =true
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ chartVisibilityOnOpen=true
66documentTitle =ExtentReports
77reportName =ExtentReports
88offline =false
9- cdn =github
9+ resourceCDN =github
1010timeStampFormat =MMM d, yyyy hh:mm:ss a
1111enableCategoryView =true
1212enableExceptionView =true
You can’t perform that action at this time.
0 commit comments