Skip to content

Commit d60fc45

Browse files
committed
[master] - fixed index.html
1 parent 4d0f913 commit d60fc45

File tree

2 files changed

+78
-12
lines changed

2 files changed

+78
-12
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>net.itarray</groupId>
88
<artifactId>automotion-maven-plugin</artifactId>
9-
<version>1.0.0</version>
9+
<version>1.0.1</version>
1010
<packaging>maven-plugin</packaging>
1111
<name>Automotion Maven plugin</name>
1212
<description>Library for smart visual automation testing</description>

src/main/java/net/itarray/automotion/reporting/FinalReportBuilder.java

Lines changed: 75 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
import com.webfirmframework.wffweb.tag.html.Html;
55
import com.webfirmframework.wffweb.tag.html.TitleTag;
66
import com.webfirmframework.wffweb.tag.html.attribute.Href;
7+
import com.webfirmframework.wffweb.tag.html.attribute.Src;
8+
import com.webfirmframework.wffweb.tag.html.attribute.Target;
9+
import com.webfirmframework.wffweb.tag.html.attribute.global.ClassAttribute;
710
import com.webfirmframework.wffweb.tag.html.attribute.global.Style;
11+
import com.webfirmframework.wffweb.tag.html.frames.IFrame;
812
import com.webfirmframework.wffweb.tag.html.links.A;
9-
import com.webfirmframework.wffweb.tag.html.lists.Li;
10-
import com.webfirmframework.wffweb.tag.html.lists.Ol;
1113
import com.webfirmframework.wffweb.tag.html.metainfo.Head;
14+
import com.webfirmframework.wffweb.tag.html.programming.Script;
15+
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div;
16+
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.StyleTag;
1217
import com.webfirmframework.wffweb.tag.htmlwff.NoTag;
1318
import org.apache.maven.plugin.AbstractMojo;
1419
import org.apache.maven.plugins.annotations.Mojo;
@@ -53,12 +58,37 @@ public void execute() {
5358

5459
private Html buildHtml(final List<String> files) {
5560
return new Html(null,
56-
new Style("background-color: #fff")) {{
61+
new Style("background-color: #F5F5F5")) {{
5762
super.setPrependDocType(true);
5863
new Head(this) {{
5964
new TitleTag(this) {{
6065
new NoTag(this, "Automotion report");
6166
}};
67+
new StyleTag(this) {{
68+
new NoTag(this, ".accordion {\n" +
69+
" background-color: #eee;\n" +
70+
" color: #444;\n" +
71+
" cursor: pointer;\n" +
72+
" padding: 18px;\n" +
73+
" width: 100%;\n" +
74+
" border: none;\n" +
75+
" text-align: left;\n" +
76+
" outline: none;\n" +
77+
" font-size: 15px;\n" +
78+
" transition: 0.4s;\n" +
79+
"}\n" +
80+
"\n" +
81+
".active, .accordion:hover {\n" +
82+
" background-color: #ccc; \n" +
83+
"}\n" +
84+
"\n" +
85+
".panel {\n" +
86+
" padding: 0;\n" +
87+
" min-height: 500px;\n" +
88+
" display: none;\n" +
89+
" background-color: white;\n" +
90+
"}");
91+
}};
6292
new NoTag(this, "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
6393
new NoTag(this, "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\">");
6494

@@ -68,19 +98,55 @@ private Html buildHtml(final List<String> files) {
6898
new NoTag(this, "<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\" integrity=\"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa\" crossorigin=\"anonymous\"></script>");
6999
}};
70100

71-
new Body(this) {{
72-
new Ol(this) {{
101+
new Body(this,
102+
new Style("background-color: #F5F5F5")) {{
103+
new Div(this, new ClassAttribute("container-fluid")) {{
73104
for (final String s : files) {
105+
new Div(this,
106+
new ClassAttribute("row"),
107+
new Style("background-color: #fff; padding: 10px; margin-top: 3px")) {{
108+
new Div(this,
109+
new ClassAttribute("accordion"),
110+
new Style("width: auto; color: #4d4d4d; text-align:left; font-size: 28px; font-weight: 300")) {{
111+
new NoTag(this, s);
112+
new A(this,
113+
new Style("float: right"),
114+
new ClassAttribute("btn btn-info"),
115+
new Href("html/" + s),
116+
new Target("target")
117+
){{
118+
new NoTag(this, "Fullscreen");
119+
}};
120+
}};
74121

75-
new Li(this) {{
122+
new Div(this,
123+
//new Style("background: #f5f5f5"),
124+
new ClassAttribute("panel")) {{
125+
new IFrame(this,
126+
new Style("width: 100%; height: 1000px"),
127+
new Src("html/" + s));
76128

77-
new A(this,
78-
new Href("html/" + s)) {{
79-
new NoTag(this, s);
80129
}};
81130
}};
82131
}
83132
}};
133+
134+
new Script(this) {{
135+
new NoTag(this, "var acc = document.getElementsByClassName(\"accordion\");\n" +
136+
"var i;\n" +
137+
"\n" +
138+
"for (i = 0; i < acc.length; i++) {\n" +
139+
" acc[i].addEventListener(\"click\", function() {\n" +
140+
" this.classList.toggle(\"active\");\n" +
141+
" var panel = this.nextElementSibling;\n" +
142+
" if (panel.style.display === \"block\") {\n" +
143+
" panel.style.display = \"none\";\n" +
144+
" } else {\n" +
145+
" panel.style.display = \"block\";\n" +
146+
" }\n" +
147+
" });\n" +
148+
"}");
149+
}};
84150
}};
85151
}};
86152
}

0 commit comments

Comments
 (0)