Skip to content

Commit 6b3a9a9

Browse files
committed
[master] - added fix for HTML reporting. Added method for validation the grid view
1 parent 080e5ca commit 6b3a9a9

File tree

6 files changed

+232
-150
lines changed

6 files changed

+232
-150
lines changed

pom.xml

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -39,68 +39,68 @@
3939
<maven.compiler.target>1.8</maven.compiler.target>
4040
</properties>
4141

42-
<build>
43-
<plugins>
44-
<plugin>
45-
<groupId>org.apache.maven.plugins</groupId>
46-
<artifactId>maven-gpg-plugin</artifactId>
47-
<executions>
48-
<execution>
49-
<id>sign-artifacts</id>
50-
<phase>verify</phase>
51-
<goals>
52-
<goal>sign</goal>
53-
</goals>
54-
</execution>
55-
</executions>
56-
</plugin>
42+
<!--<build>-->
43+
<!--<plugins>-->
44+
<!--<plugin>-->
45+
<!--<groupId>org.apache.maven.plugins</groupId>-->
46+
<!--<artifactId>maven-gpg-plugin</artifactId>-->
47+
<!--<executions>-->
48+
<!--<execution>-->
49+
<!--<id>sign-artifacts</id>-->
50+
<!--<phase>verify</phase>-->
51+
<!--<goals>-->
52+
<!--<goal>sign</goal>-->
53+
<!--</goals>-->
54+
<!--</execution>-->
55+
<!--</executions>-->
56+
<!--</plugin>-->
5757

58-
<plugin>
59-
<groupId>org.sonatype.plugins</groupId>
60-
<artifactId>nexus-staging-maven-plugin</artifactId>
61-
<version>1.6.3</version>
62-
<extensions>true</extensions>
63-
<configuration>
64-
<serverId>ossrh</serverId>
65-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
66-
<stagingProfileId>22f8da536d8418</stagingProfileId> <!--Staging-->
67-
<!--<stagingProfileId>7edbe315063867</stagingProfileId> &lt;!&ndash;Central staging&ndash;&gt;-->
68-
<skipStagingRepositoryClose>true</skipStagingRepositoryClose>
69-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
70-
</configuration>
71-
</plugin>
58+
<!--<plugin>-->
59+
<!--<groupId>org.sonatype.plugins</groupId>-->
60+
<!--<artifactId>nexus-staging-maven-plugin</artifactId>-->
61+
<!--<version>1.6.3</version>-->
62+
<!--<extensions>true</extensions>-->
63+
<!--<configuration>-->
64+
<!--<serverId>ossrh</serverId>-->
65+
<!--<nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
66+
<!--<stagingProfileId>22f8da536d8418</stagingProfileId> &lt;!&ndash;Staging&ndash;&gt;-->
67+
<!--&lt;!&ndash;<stagingProfileId>7edbe315063867</stagingProfileId> &lt;!&ndash;Central staging&ndash;&gt;&ndash;&gt;-->
68+
<!--<skipStagingRepositoryClose>true</skipStagingRepositoryClose>-->
69+
<!--<autoReleaseAfterClose>true</autoReleaseAfterClose>-->
70+
<!--</configuration>-->
71+
<!--</plugin>-->
7272

73-
<plugin>
74-
<groupId>org.apache.maven.plugins</groupId>
75-
<artifactId>maven-source-plugin</artifactId>
76-
<executions>
77-
<execution>
78-
<id>attach-sources</id>
79-
<goals>
80-
<goal>jar</goal>
81-
</goals>
82-
</execution>
83-
</executions>
84-
</plugin>
73+
<!--<plugin>-->
74+
<!--<groupId>org.apache.maven.plugins</groupId>-->
75+
<!--<artifactId>maven-source-plugin</artifactId>-->
76+
<!--<executions>-->
77+
<!--<execution>-->
78+
<!--<id>attach-sources</id>-->
79+
<!--<goals>-->
80+
<!--<goal>jar</goal>-->
81+
<!--</goals>-->
82+
<!--</execution>-->
83+
<!--</executions>-->
84+
<!--</plugin>-->
8585

86-
<plugin>
87-
<groupId>org.apache.maven.plugins</groupId>
88-
<artifactId>maven-javadoc-plugin</artifactId>
89-
<executions>
90-
<execution>
91-
<id>attach-javadocs</id>
92-
<goals>
93-
<goal>jar</goal>
94-
</goals>
95-
</execution>
96-
</executions>
97-
<configuration>
98-
<additionalparam>-Xdoclint:none</additionalparam>
99-
</configuration>
100-
</plugin>
86+
<!--<plugin>-->
87+
<!--<groupId>org.apache.maven.plugins</groupId>-->
88+
<!--<artifactId>maven-javadoc-plugin</artifactId>-->
89+
<!--<executions>-->
90+
<!--<execution>-->
91+
<!--<id>attach-javadocs</id>-->
92+
<!--<goals>-->
93+
<!--<goal>jar</goal>-->
94+
<!--</goals>-->
95+
<!--</execution>-->
96+
<!--</executions>-->
97+
<!--<configuration>-->
98+
<!--<additionalparam>-Xdoclint:none</additionalparam>-->
99+
<!--</configuration>-->
100+
<!--</plugin>-->
101101

102-
</plugins>
103-
</build>
102+
<!--</plugins>-->
103+
<!--</build>-->
104104

105105
<distributionManagement>
106106
<snapshotRepository>
@@ -191,7 +191,7 @@
191191
<dependency>
192192
<groupId>com.webfirmframework</groupId>
193193
<artifactId>wffweb</artifactId>
194-
<version>2.1.1</version>
194+
<version>2.1.2</version>
195195
</dependency>
196196
</dependencies>
197197
</project>

src/main/java/util/general/HtmlReportBuilder.java

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private void writeReport(String reportName) throws InterruptedException, IOExcep
4444

4545
long ms = System.currentTimeMillis();
4646

47-
try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(TARGET_AUTOMOTION + reportName + ms + ".html"), StandardCharsets.UTF_8))) {
47+
try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(TARGET_AUTOMOTION + reportName.replace(" ", "") + ms + ".html"), StandardCharsets.UTF_8))) {
4848
writer.write(html.toHtmlString());
4949
} catch (IOException ex) {
5050
LOG.error("Cannot create html report: " + ex.getMessage());
@@ -82,44 +82,46 @@ private Html buildHtml() throws IOException, ParseException {
8282
File folder = new File(TARGET_AUTOMOTION_JSON);
8383
File[] listOfFiles = folder.listFiles();
8484

85-
for (File file : listOfFiles) {
86-
if (file.isFile()) {
87-
JSONParser parser = new JSONParser();
88-
Object obj = parser.parse(new FileReader(file));
89-
90-
JSONObject jsonObject = (JSONObject) obj;
91-
JSONArray details = (JSONArray) jsonObject.get(DETAILS);
92-
new H1(this,
93-
new Style("color: rgb(0,139,139); margin-top: 50px;")) {{
94-
new NoTag(this, "Element: \"" + jsonObject.get(ELEMENT_NAME) + "\"");
95-
}};
96-
new H2(this,
97-
new Style("color: rgb(255,69,0)")) {{
98-
new NoTag(this, "Failures:");
99-
}};
100-
new Ol(this) {{
101-
for (Object details : details) {
102-
JSONObject det = (JSONObject) details;
103-
JSONObject reason = (JSONObject) det.get(REASON);
104-
String numE = (String) reason.get(MESSAGE);
105-
106-
new Li(this) {{
107-
new NoTag(this, numE.toString());
108-
}};
109-
}
110-
}};
111-
new H4(this,
112-
new Style("color: rgb(105,105,105)")) {{
113-
new NoTag(this, "Time execution: " + jsonObject.get(TIME_EXECUTION));
114-
}};
115-
new P(this) {{
116-
new Img(this,
117-
new Src("img/" + jsonObject.get(SCREENSHOT)),
118-
new Alt("screenshot"),
119-
new Style("width: 96%; margin-left:2%"));
120-
}};
121-
122-
while (!file.delete());
85+
if (listOfFiles != null) {
86+
for (File file : listOfFiles) {
87+
if (file.isFile()) {
88+
JSONParser parser = new JSONParser();
89+
Object obj = parser.parse(new FileReader(file));
90+
91+
JSONObject jsonObject = (JSONObject) obj;
92+
JSONArray details = (JSONArray) jsonObject.get(DETAILS);
93+
new H1(this,
94+
new Style("color: rgb(0,139,139); margin-top: 50px;")) {{
95+
new NoTag(this, "Element: \"" + jsonObject.get(ELEMENT_NAME) + "\"");
96+
}};
97+
new H2(this,
98+
new Style("color: rgb(255,69,0)")) {{
99+
new NoTag(this, "Failures:");
100+
}};
101+
new Ol(this) {{
102+
for (Object details : details) {
103+
JSONObject det = (JSONObject) details;
104+
JSONObject reason = (JSONObject) det.get(REASON);
105+
String numE = (String) reason.get(MESSAGE);
106+
107+
new Li(this) {{
108+
new NoTag(this, numE.toString());
109+
}};
110+
}
111+
}};
112+
new H4(this,
113+
new Style("color: rgb(105,105,105)")) {{
114+
new NoTag(this, "Time execution: " + jsonObject.get(TIME_EXECUTION));
115+
}};
116+
new P(this) {{
117+
new Img(this,
118+
new Src("img/" + jsonObject.get(SCREENSHOT)),
119+
new Alt("screenshot"),
120+
new Style("width: 96%; margin-left:2%"));
121+
}};
122+
123+
while (!file.delete()) ;
124+
}
123125
}
124126
}
125127
}};

0 commit comments

Comments
 (0)