15
15
// specific language governing permissions and limitations
16
16
// under the License.
17
17
18
- package org .openqa .selenium . firefox ;
18
+ package org .openqa .selenium ;
19
19
20
20
import static org .assertj .core .api .Assertions .assertThat ;
21
21
22
- import org .junit .After ;
23
- import org .junit .Test ;
24
22
import org .junit .Before ;
25
-
26
- import org .openqa .selenium .Pdf ;
23
+ import org .junit .Test ;
27
24
import org .openqa .selenium .print .PageSize ;
28
25
import org .openqa .selenium .print .PrintOptions ;
29
26
import org .openqa .selenium .testing .JUnit4TestBase ;
30
27
31
- public class FireFoxPrintCommandTest extends JUnit4TestBase {
32
-
33
- private FirefoxDriver localDriver = new FirefoxDriver ();
28
+ public class PrintPageTest extends JUnit4TestBase {
34
29
private static String MAGIC_STRING = "JVBER" ;
35
30
36
31
@ Before
37
32
public void setUp () {
38
- localDriver .get (pages .printPage );
39
- }
40
- @ After
41
- public void tearDown () {
42
- if (localDriver != null ) {
43
- localDriver .quit ();
44
- }
33
+ driver .get (pages .printPage );
45
34
}
46
35
47
36
@ Test
48
37
public void canPrintPage () {
49
38
PrintOptions printOptions = new PrintOptions ();
50
39
51
- Pdf pdf = localDriver .print (printOptions );
40
+ Pdf pdf = driver .print (printOptions );
52
41
assertThat (pdf .getContent ().contains (MAGIC_STRING )).isTrue ();
53
42
}
54
43
@@ -57,7 +46,7 @@ public void canPrintwoPages() {
57
46
PrintOptions printOptions = new PrintOptions ();
58
47
printOptions .setPageRanges (new String []{"1-2" });
59
48
60
- Pdf pdf = localDriver .print (printOptions );
49
+ Pdf pdf = driver .print (printOptions );
61
50
assertThat (pdf .getContent ().contains (MAGIC_STRING )).isTrue ();
62
51
}
63
52
@@ -71,7 +60,8 @@ public void canPrintWithValidParams() {
71
60
printOptions .setOrientation (PrintOptions .Orientation .Landscape );
72
61
printOptions .setPageSize (pageSize );
73
62
74
- Pdf pdf = localDriver .print (printOptions );
63
+ Pdf pdf = driver .print (printOptions );
75
64
assertThat (pdf .getContent ().contains (MAGIC_STRING )).isTrue ();
76
65
}
66
+
77
67
}
0 commit comments