File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
src/org/openqa/selenium/print
test/org/openqa/selenium/print Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ public Map<String, Object> toMap() {
121
121
options .put ("background" , getBackground ());
122
122
final String [] effectivePageRanges = getPageRanges ();
123
123
if (effectivePageRanges != null ) {
124
- options .put ("effectivePageRanges " , effectivePageRanges );
124
+ options .put ("pageRanges " , effectivePageRanges );
125
125
}
126
126
options .put ("margin" , getPageMargin ());
127
127
Original file line number Diff line number Diff line change 21
21
import org .junit .jupiter .api .Tag ;
22
22
import static org .assertj .core .api .Assertions .assertThat ;
23
23
24
+ import java .util .Map ;
25
+
24
26
25
27
@ Tag ("UnitTests" )
26
28
class PrintOptionsTest {
@@ -46,4 +48,21 @@ void setsValuesAsPassed() {
46
48
assertThat (printOptions .getBackground ()).isTrue ();
47
49
assertThat (printOptions .getShrinkToFit ()).isFalse ();
48
50
}
51
+
52
+ @ Test
53
+ void toMapContainsProperKey () {
54
+ PrintOptions printOptions = new PrintOptions ();
55
+
56
+ printOptions .setPageRanges ("1-2" );
57
+
58
+ Map <String , Object > map = printOptions .toMap ();
59
+ assertThat (map .size ()).isEqualTo (7 );
60
+ assertThat (map .containsKey ("page" )).isTrue ();
61
+ assertThat (map .containsKey ("orientation" )).isTrue ();
62
+ assertThat (map .containsKey ("scale" )).isTrue ();
63
+ assertThat (map .containsKey ("shrinkToFit" )).isTrue ();
64
+ assertThat (map .containsKey ("background" )).isTrue ();
65
+ assertThat (map .containsKey ("pageRanges" )).isTrue ();
66
+ assertThat (map .containsKey ("margin" )).isTrue ();
67
+ }
49
68
}
You can’t perform that action at this time.
0 commit comments