1+ package com .itextpdf .html2pdf .css ;
2+
3+ import com .itextpdf .html2pdf .ConverterProperties ;
4+ import com .itextpdf .html2pdf .ExtendedHtmlConversionITextTest ;
5+ import com .itextpdf .html2pdf .HtmlConverter ;
6+ import com .itextpdf .kernel .utils .CompareTool ;
7+ import com .itextpdf .test .annotations .LogMessage ;
8+ import com .itextpdf .test .annotations .LogMessages ;
9+ import com .itextpdf .test .annotations .type .IntegrationTest ;
10+ import org .junit .Assert ;
11+ import org .junit .BeforeClass ;
12+ import org .junit .Test ;
13+ import org .junit .experimental .categories .Category ;
14+
15+ import java .io .File ;
16+ import java .io .IOException ;
17+
18+ @ Category (IntegrationTest .class )
19+ public class VisibilityTest extends ExtendedHtmlConversionITextTest {
20+ public static final String sourceFolder = "./src/test/resources/com/itextpdf/html2pdf/css/VisibilityTest/" ;
21+ public static final String destinationFolder = "./target/test/com/itextpdf/html2pdf/css/VisibilityTest/" ;
22+
23+ @ BeforeClass
24+ public static void beforeClass () {
25+ createDestinationFolder (destinationFolder );
26+ }
27+
28+ @ Test
29+ //TODO update cmp-file after DEVSIX-2090 done
30+ public void visiblePropertyLastPageTest () throws IOException , InterruptedException {
31+ convertToPdfAndCompare ("visiblePropertyLastPageTest" , sourceFolder , destinationFolder );
32+ }
33+
34+ @ Test
35+ //TODO update cmp-file after DEVSIX-2090 done
36+ public void visiblePropertyTableTest () throws IOException , InterruptedException {
37+ convertToPdfAndCompare ("visiblePropertyTableTest" , sourceFolder , destinationFolder );
38+ }
39+
40+ @ Test
41+ //TODO update cmp-file after DEVSIX-2090 done
42+ public void visiblePropertySvgTest () throws IOException , InterruptedException {
43+ convertToPdfAndCompare ("visiblePropertySvgTest" , sourceFolder , destinationFolder );
44+ }
45+
46+ @ Test
47+ //TODO update cmp-file after DEVSIX-2090 done
48+ public void visiblePropertyLinkTest () throws IOException , InterruptedException {
49+ convertToPdfAndCompare ("visiblePropertyLinkTest" , sourceFolder , destinationFolder );
50+ }
51+
52+ @ Test
53+ //TODO update cmp-file after DEVSIX-2090 done
54+ public void visiblePropertyImagesTest () throws IOException , InterruptedException {
55+ convertToPdfAndCompare ("visiblePropertyImagesTest" , sourceFolder , destinationFolder );
56+ }
57+
58+ @ Test
59+ //TODO update cmp-file after DEVSIX-2090 done
60+ public void visiblePropertyInFormsTest () throws IOException , InterruptedException {
61+ convertToPdfAndCompare ("visiblePropertyInFormsTest" , sourceFolder , destinationFolder );
62+ }
63+
64+ @ Test
65+ //TODO update cmp-file after DEVSIX-2090 done
66+ public void visiblePropertyInFormFieldTest () throws IOException , InterruptedException {
67+ convertToPdfAndCompare ("visiblePropertyInFormFieldTest" , sourceFolder , destinationFolder );
68+ }
69+
70+ @ Test
71+ //TODO update cmp-file after DEVSIX-2090 done
72+ public void visiblePropertyInFormRadioButtonTest () throws IOException , InterruptedException {
73+ convertToPdfAndCompare ("visiblePropertyInFormRadioButtonTest" , sourceFolder , destinationFolder );
74+ }
75+
76+ @ Test
77+ @ LogMessages (messages = {@ LogMessage
78+ (messageTemplate = com .itextpdf .html2pdf .LogMessageConstant .ACROFORM_NOT_SUPPORTED_FOR_SELECT )})
79+ //TODO update cmp-file after DEVSIX-2090 and DEVSIX-1901 done
80+ public void visiblePropertyInFormDropdownListTest () throws IOException , InterruptedException {
81+ String htmlFile = sourceFolder + "visiblePropertyInFormDropdownListTest.html" ;
82+ String outAcroPdf = destinationFolder + "visiblePropertyInFormDropdownListTest.pdf" ;
83+
84+ ConverterProperties properties = new ConverterProperties ();
85+ properties .setCreateAcroForm (true );
86+ HtmlConverter .convertToPdf (new File (htmlFile ), new File (outAcroPdf ), properties );
87+ Assert .assertNull (new CompareTool ().compareByContent (outAcroPdf , sourceFolder +
88+ "cmp_visiblePropertyInFormDropdownListTest.pdf" , destinationFolder , "diff_dropdown" ));
89+ }
90+
91+ @ Test
92+ //TODO update cmp-file after DEVSIX-2090 done
93+ public void visiblePropertyInFormCheckBoxTest () throws IOException , InterruptedException {
94+ convertToPdfAndCompare ("visiblePropertyInFormCheckBoxTest" , sourceFolder , destinationFolder );
95+ }
96+
97+ @ Test
98+ //TODO update cmp-file after DEVSIX-2090 done
99+ public void visiblePropertyDivTest () throws IOException , InterruptedException {
100+ convertToPdfAndCompare ("visiblePropertyDivTest" , sourceFolder , destinationFolder );
101+ }
102+ }
0 commit comments