Class WindowResizer

  • All Implemented Interfaces:
    AutoCloseable

    public class WindowResizer
    extends Object
    implements AutoCloseable
    An AutoCloseable resizer for the browser. When closing, it reverts the the original state
    • Constructor Detail

      • WindowResizer

        public WindowResizer​(int expectedWidth,
                             int expectedHeight)
        Resize a browser to the requested dimensions. First it changes the window size, and then it updates the size of the html inside it.
        Parameters:
        expectedWidth - expected width
        expectedHeight - expected height
    • Method Detail

      • getVisibleHeight

        public Long getVisibleHeight()
        get visible height of the browser
        Returns:
        height
      • getVisibleWidth

        public Long getVisibleWidth()
        get visible width of the browser
        Returns:
        width
      • getTotalHeight

        public Long getTotalHeight()
        get total scrollable height of the browser
        Returns:
        height
      • getTotalWidth

        public Long getTotalWidth()
        get total scrollable width of the browser
        Returns:
        width
      • close

        public void close()
        Revert state
        Specified by:
        close in interface AutoCloseable