Skip to content

Commit dfebcb3

Browse files
Kate IvanovaiText-CI
authored andcommitted
Move HTML_Lists tests
DEVSIX-3035
1 parent aeb45e4 commit dfebcb3

File tree

7 files changed

+325
-0
lines changed

7 files changed

+325
-0
lines changed

src/test/java/com/itextpdf/html2pdf/element/ListTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ This file is part of the iText (R) project.
4646
import com.itextpdf.html2pdf.HtmlConverter;
4747
import com.itextpdf.html2pdf.LogMessageConstant;
4848
import com.itextpdf.html2pdf.resolver.font.DefaultFontProvider;
49+
import com.itextpdf.io.util.MessageFormatUtil;
4950
import com.itextpdf.kernel.pdf.PdfAConformanceLevel;
5051
import com.itextpdf.kernel.pdf.PdfOutputIntent;
5152
import com.itextpdf.kernel.pdf.PdfWriter;
@@ -60,8 +61,10 @@ This file is part of the iText (R) project.
6061
import org.junit.Assert;
6162
import org.junit.BeforeClass;
6263
import org.junit.Ignore;
64+
import org.junit.Rule;
6365
import org.junit.Test;
6466
import org.junit.experimental.categories.Category;
67+
import org.junit.rules.ExpectedException;
6568

6669
import java.io.File;
6770
import java.io.FileInputStream;
@@ -74,6 +77,9 @@ public class ListTest extends ExtendedITextTest {
7477
public static final String sourceFolder = "./src/test/resources/com/itextpdf/html2pdf/element/ListTest/";
7578
public static final String destinationFolder = "./target/test/com/itextpdf/html2pdf/element/ListTest/";
7679

80+
@Rule
81+
public ExpectedException junitExpectedException = ExpectedException.none();
82+
7783
@BeforeClass
7884
public static void beforeClass() {
7985
createOrClearDestinationFolder(destinationFolder);
@@ -209,6 +215,27 @@ public void listItemAbsolutePositionTest() throws IOException, InterruptedExcept
209215
runTest("list-item-absolute");
210216
}
211217

218+
@Test
219+
//TODO: update after fix of DEVSIX-2537
220+
//http://www.timrivera.com/tests/ol-start.html
221+
public void checkOrderedListStartAndValue() throws IOException, InterruptedException {
222+
runTest("checkOrderedListStartAndValue");
223+
}
224+
@Test
225+
//TODO: update after fix of DEVSIX-2538
226+
public void checkOrderedListNestedLists() throws IOException, InterruptedException {
227+
junitExpectedException.expect(IllegalArgumentException.class);
228+
junitExpectedException.expectMessage(MessageFormatUtil.format("The parameter must be a positive integer"));
229+
runTest("checkOrderedListNestedLists");
230+
}
231+
232+
@Test
233+
@LogMessages(messages = {@LogMessage(messageTemplate = LogMessageConstant.NO_WORKER_FOUND_FOR_TAG, count = 6)})
234+
//TODO: update after DEVSIX-2093, DEVSIX-2092, DEVSIX-2091 fixes
235+
public void listsWithInlineChildren() throws IOException, InterruptedException {
236+
runTest("listsWithInlineChildren");
237+
}
238+
212239
@Test
213240
@LogMessages(messages = {@LogMessage(messageTemplate = LogMessageConstant.NOT_SUPPORTED_LIST_STYLE_TYPE, count = 32)})
214241
public void listToPdfaTest() throws IOException, InterruptedException {
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Check different lists start and value attributes</title>
6+
<style>
7+
div {
8+
background: #ccc;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<h3>Check different NESTED OL lists start and value attributes </h3>
14+
15+
<div>Nested ols: <b>start="1111111" type="1"</b> for parent,</div>
16+
<div><b>ol start="1" type="a" reversed</b> for 3rd nested,</div>
17+
<div><b>ol start="1111111" type="1"</b> for 3-3 nested,</div>
18+
<div> <b>ol start="-7" type="A"</b> for 5th nested</div>
19+
<ol start="1111111" type="1">
20+
<li>one</li>
21+
<li>two</li>
22+
<li>three</li>
23+
<ol start="1" type="a" reversed>
24+
<li>three-one</li>
25+
<li>three-two</li>
26+
<li>three-three</li>
27+
<ol start="1111111" type="1">
28+
<li>three-three-one</li>
29+
<li>three-three-two</li>
30+
<li>three-three-three</li>
31+
</ol>
32+
</ol>
33+
<li>four</li>
34+
<li>five</li>
35+
<ol start="-7" type="A">
36+
<li>three-one</li>
37+
<li>three-two</li>
38+
</ol>
39+
</ol>
40+
</body>
41+
</html>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Check different lists start and value attributes</title>
6+
<style>
7+
div {
8+
background: #ccc;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<h3>Check different OL lists start and value attributes</h3>
14+
15+
<div>ol start="1" type="A"</div>
16+
<ol start="3" type="A">
17+
<li>one</li>
18+
<li>two</li>
19+
<li>three</li>
20+
</ol>
21+
<div>ol start="3" type="A" reversed</div>
22+
<ol start="3" type="A" reversed>
23+
<li>one</li>
24+
<li>two</li>
25+
<li>three</li>
26+
</ol>
27+
<div>ol start="-10" type="I"</div>
28+
<ol start="-10" type="I">
29+
<li>one</li>
30+
<li>two</li>
31+
<li>three</li>
32+
</ol>
33+
<div>ol start="1111111" type="i"</div>
34+
<ol start="1111111" type="i">
35+
<li>one</li>
36+
<li>two</li>
37+
<li>three</li>
38+
</ol>
39+
<div> start="1111111" type="1" with li value="9" for 3rd and li value="-10" for 5th</div>
40+
<ol start="1111111" type="1">
41+
<li>one</li>
42+
<li>two</li>
43+
<li value="9">three</li>
44+
<li>four</li>
45+
<li value="-10">five</li>
46+
</ol>
47+
48+
<div>Reveresed: start="1111111" type="1" reversed with li value="9" for 3rd and li value="-10" for 5th</div>
49+
<ol start="1111111" type="1" reversed>
50+
<li>one</li>
51+
<li>two</li>
52+
<li value="9">three</li>
53+
<li>four</li>
54+
<li value="-10">five</li>
55+
<li>six</li>
56+
<li>seven</li>
57+
</ol>
58+
</body>
59+
</html>
Binary file not shown.
Binary file not shown.
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Title with <br><br><br>3 br</title>
5+
<style>
6+
div {
7+
background-color: grey;
8+
}
9+
br {
10+
background-color: yellow;
11+
}
12+
th {
13+
background-color: green;
14+
}
15+
tr {
16+
background-color: magenta;
17+
}
18+
table {
19+
background-color: orange;
20+
}
21+
li {
22+
background-color: rgba(0, 255, 0, 0.3);
23+
}
24+
span {
25+
background-color: magenta;
26+
}
27+
p {
28+
background-color: rgba(255, 255, 0, 0.3);
29+
}
30+
</style>
31+
</head>
32+
<body>
33+
34+
<table>
35+
<tr>
36+
<td>
37+
<ol>
38+
<li>0 Line breaks: Test</li>
39+
<li>1 Line break:<br>Test</li>
40+
<li>2 Line breaks:<br><br>Test</li>
41+
<li>3 Line breaks:<br><br><br>Test</li>
42+
<li><b>3 Line breaks:<br><br><br>Test</b></li>
43+
</ol>
44+
</td>
45+
<td>
46+
<ul>
47+
<li>0 Line breaks: Test</li>
48+
<li>1 Line break:<br>Test</li>
49+
<li>2 Line breaks:<br><br>Test</li>
50+
<li>3 Line breaks:<br><br><br>Test</li>
51+
<li><b>3 Line breaks:<br><br><br>Test</b></li>
52+
</ul>
53+
</td>
54+
<td>
55+
<dl>
56+
<dt>0 Line breaks: Test</dt>
57+
<dd>0 Line breaks: Test</dd>
58+
<dt>1 Line break:<br>Test</dt>
59+
<dd>1 Line break:<br>Test</dd>
60+
<dt>2 Line breaks:<br><br>Test</dt>
61+
<dd>2 Line breaks:<br><br>Test</dd>
62+
<dt>3 Line break:<br><br><br>Test</dt>
63+
<dd><strike>3 Line break:<br><br><br>Test</strike></dd>
64+
</dl>
65+
</td>
66+
</tr>
67+
</table>
68+
<ul>
69+
<li>Here
70+
<bdi>Three line breaks<br><br><br>inside BDI</bdi>
71+
test inside LI
72+
</li>
73+
<li>Here <bdo dir="rtl">Three line breaks<br><br><br>inside BDO</bdo> test inside LI</li>
74+
<li>Here <bdo dir="ltr">Three line breaks<br><br><br>inside BDO</bdo> test inside LI</li>
75+
</ul>
76+
Here
77+
<bdi>Three line breaks<br><br><br>inside BDI</bdi>
78+
test
79+
Here <bdo dir="rtl">Three line breaks<br><br><br>inside BDO RTL</bdo> test
80+
Here <bdo dir="ltr">Three line breaks<br><br><br>inside BDO LTR</bdo> test
81+
<span>Three line breaks<br><br><br>inside SPAN</span>
82+
<p>Three line breaks<br><br><br>inside P</p>
83+
<div>Line breaks in ABBR</div>
84+
<abbr title="Some Abbrev Here">SA<br><br><br>H</abbr>
85+
<div>Line breaks in a tag</div>
86+
<table>
87+
<tr>
88+
<td>
89+
Here <a style="display: block;">Three line breaks<br><br><br>inside A</a>
90+
</td>
91+
<td>
92+
Here <a style="display: inline;">Three line breaks<br><br><br>inside A</a>
93+
</td>
94+
</tr>
95+
96+
</table>
97+
<div>Three line breaks<br><br><br>inside DIV</div>
98+
<h1>Three line breaks<br><br><br>inside H1</h1>
99+
<link>
100+
Three line breaks<br><br><br>inside LINK</link>
101+
<pre>Three line breaks<br><br><br>inside PRE</pre>
102+
<table>
103+
<tr>
104+
<td><p>Three line breaks<br><br><br>inside P</p></td>
105+
<td><b>Three line breaks<br><br><br>inside B</b></td>
106+
<td><p><b>Three line breaks<br><br><br>inside B inside P</b></p></td>
107+
<td>
108+
<div><b>Three line breaks<br><br><br>inside B inside DIV</b></div>
109+
</td>
110+
</tr>
111+
<tr>
112+
<td><big>Three line breaks<br><br><br>inside BIG</big></td>
113+
<td>
114+
<small>Three line breaks<br><br><br>inside SMALL</small>
115+
</td>
116+
<td><p><i>Three line breaks<br><br><br>inside I inside P</i></p></td>
117+
<td>
118+
<div>
119+
<small>Three line breaks<br><br><br>inside SMALL inside DIV</small>
120+
</div>
121+
</td>
122+
</tr>
123+
<tr>
124+
<td><span><big>Three line breaks<br><br><br>inside BIG inside SPAN</big></span></td>
125+
<td><span>Three line breaks<br><br><br>inside SPAN inside TD</span></td>
126+
<td><p><strong>Three line breaks<br><br><br>inside STRONG inside P</strong></p></td>
127+
<td>
128+
<div><strong>Three line breaks<br><br><br>inside STRONG inside DIV</strong></div>
129+
</td>
130+
</tr>
131+
<tr>
132+
<td><span><code>Three line breaks<br><br><br>inside CODE inside SPAN</code></span></td>
133+
<td><code>Three line breaks<br><br><br>inside CODE</code></td>
134+
<td><cite>Three line breaks<br><br><br>inside CITE</cite></td>
135+
<td><div><dfn>Three line breaks<br><br><br>inside DFN inside DIV</dfn></div></td>
136+
</tr>
137+
</table>
138+
139+
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
140+
141+
<map name="planetmap"><br><br><br>
142+
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun">
143+
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
144+
<area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
145+
</map>
146+
<select>
147+
<br><br><br>
148+
<option>THREE LINE BREAKS<br><br><br>inside OPTION</option>
149+
<br><br><br>
150+
<option selected>Three line breaks<br><br><br>inside OPTION</option>
151+
</select>
152+
<table>
153+
<tr>
154+
<th scope="col">Three line breaks<br><br><br>inside TH</th>
155+
Three line breaks<br><br><br>inside TABLE NO STRUCTURE
156+
<th scope="col">Three line breaks<br><br><br>inside TH</th>
157+
</tr>
158+
Three line breaks<br><br><br>inside
159+
<tr>
160+
<td>Three line breaks<br><br><br>inside TD</td>
161+
Three line breaks<br><br><br>inside TABLE NO STRUCTURE
162+
<td>Three line breaks<br><br><br>inside TD</td>
163+
</tr>
164+
</table>
165+
<br><br>
166+
<table>
167+
<thead>
168+
<td>Three line breaks<br><br><br>inside TD inside THEAD</td>
169+
Three line breaks<br><br><br>inside THEAD NO STRUCTURE
170+
<td>Three line breaks<br><br><br>inside TD inside THEAD</td>
171+
</thead>
172+
Three line breaks<br><br><br>inside TABLE NO STRUCTURE
173+
<tr>
174+
<td>Three line breaks<br><br><br>inside</td>
175+
Three line breaks<br><br><br>inside NO STRUCTURE
176+
<td>Three line breaks<br><br><br>inside</td>
177+
</tr>
178+
<tfoot>
179+
<td>Three line breaks<br><br><br>inside TD inside TFOOT</td>
180+
Three line breaks<br><br><br>inside TFOOT NO STRUCTURE
181+
<td>Three line breaks<br><br><br> inside TD inside TFOOT</td>
182+
</tfoot>
183+
</table>
184+
<br>
185+
<button>Three line breaks<br><br><br>inside BUTTON</button>
186+
<br>
187+
<textarea>Three line breaks<br><br><br>inside TEXTAREA</textarea>
188+
<br>
189+
<input placeholder="Three line breaks <br><br><br>inside PLACEHOLDER">
190+
<br>
191+
<samp>Three line breaks<br><br><br>inside SAMP</samp>
192+
<br>
193+
Here
194+
<del>Three line breaks<br><br><br>inside DEL</del>
195+
<ins>Three line breaks<br><br><br>inside INS</ins>
196+
!
197+
</body>
198+
</html>
4.13 KB
Loading

0 commit comments

Comments
 (0)