@@ -65,11 +65,26 @@ public static PageSnapshot shootPage(WebDriver driver, ScrollStrategy scroll) {
6565 *
6666 * @param driver WebDriver instance
6767 * @param scroll ScrollStrategy How you need to scroll
68- * @param scrollTimeout Timeout to wait after scrolling and before taking screen shot
68+ * @param betweenScrollTimeout Timeout to wait after scrolling and before taking screenshot
6969 * @return PageSnapshot instance
7070 */
71- public static PageSnapshot shootPage (WebDriver driver , ScrollStrategy scroll , int scrollTimeout ) {
72- return shootPage (driver ,scroll ,scrollTimeout ,false );
71+ public static PageSnapshot shootPage (WebDriver driver , ScrollStrategy scroll , int betweenScrollTimeout ) {
72+ return shootPage (driver ,scroll ,betweenScrollTimeout ,false );
73+ }
74+
75+ /**
76+ * To be used when screen shooting the page
77+ * and need to scroll while making screen shots, either vertically or
78+ * horizontally or both directions (Chrome).
79+ *
80+ * @param driver WebDriver instance
81+ * @param scroll ScrollStrategy How you need to scroll
82+ * @param betweenScrollTimeout Timeout to wait after scrolling and before taking screenshot
83+ * @param afterScrollTimeout Timeout to wait after scrolling and before taking screenshot
84+ * @return PageSnapshot instance
85+ */
86+ public static PageSnapshot shootPage (WebDriver driver , ScrollStrategy scroll , int betweenScrollTimeout , int afterScrollTimeout ) {
87+ return shootPage (driver ,scroll ,betweenScrollTimeout ,false , afterScrollTimeout );
7388 }
7489
7590 /**
@@ -93,13 +108,45 @@ public static PageSnapshot shootPage(WebDriver driver, ScrollStrategy scroll, bo
93108 *
94109 * @param driver WebDriver instance
95110 * @param scroll ScrollStrategy How you need to scroll
96- * @param scrollTimeout Timeout to wait after scrolling and before taking screen shot
111+ * @param useDevicePixelRatio whether or not take into account device pixel ratio
112+ * @param afterScrollTimeout Timeout to wait after scrolling and before taking screenshot
113+ * @return PageSnapshot instance
114+ */
115+ public static PageSnapshot shootPage (WebDriver driver , ScrollStrategy scroll , boolean useDevicePixelRatio , int afterScrollTimeout ) {
116+ return shootPage (driver ,scroll ,0 ,useDevicePixelRatio , afterScrollTimeout );
117+ }
118+
119+ /**
120+ * To be used when screen shooting the page
121+ * and need to scroll while making screen shots, either vertically or
122+ * horizontally or both directions (Chrome).
123+ *
124+ * @param driver WebDriver instance
125+ * @param scroll ScrollStrategy How you need to scroll
126+ * @param betweenScrollTimeout Timeout to wait between each scrolling operation
127+ * @param useDevicePixelRatio whether or not take into account device pixel ratio
128+ * @return PageSnapshot instance
129+ */
130+ public static PageSnapshot shootPage (WebDriver driver , ScrollStrategy scroll , int betweenScrollTimeout , boolean useDevicePixelRatio ) {
131+ return shootPage (driver ,scroll ,betweenScrollTimeout ,useDevicePixelRatio ,0 );
132+ }
133+
134+ /**
135+ * To be used when screen shooting the page
136+ * and need to scroll while making screen shots, either vertically or
137+ * horizontally or both directions (Chrome).
138+ *
139+ * @param driver WebDriver instance
140+ * @param scroll ScrollStrategy How you need to scroll
141+ * @param betweenScrollTimeout Timeout to wait between each scrolling operation
142+ * @param afterScrollTimeout Timeout to wait after scrolling and before taking screenshot
97143 * @param useDevicePixelRatio whether or not take into account device pixel ratio
98144 * @return PageSnapshot instance
99145 */
100- public static PageSnapshot shootPage (WebDriver driver , ScrollStrategy scroll , int scrollTimeout , boolean useDevicePixelRatio ) {
146+ public static PageSnapshot shootPage (WebDriver driver , ScrollStrategy scroll , int betweenScrollTimeout , boolean useDevicePixelRatio , int afterScrollTimeout ) {
101147 Browser browser = new Browser (driver , useDevicePixelRatio );
102- browser .setScrollTimeout (scrollTimeout );
148+ browser .setBetweenScrollTimeout (betweenScrollTimeout );
149+ browser .setAfterScrollTimeout (afterScrollTimeout );
103150
104151 PageSnapshot pageScreenshot = new PageSnapshot (driver , browser .getDevicePixelRatio ());
105152 switch (scroll ) {
0 commit comments