Java Code Examples for org.openqa.selenium.WebDriver#Window
The following examples show how to use
org.openqa.selenium.WebDriver#Window .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScreenManagerTests.java From HubTurbo with GNU Lesser General Public License v3.0 | 5 votes |
/** * Tests whether the bView is placed next to the pView when the pView is almost at the resize * threshold. */ @Test public void resizeBview_MediumPViewSize_AdjacentBView() { ScreenManager mockedScreenManager = getMockedScreenManager(1439.0, 1600, 161, 2400); WebDriver.Window mockedWindow = mock(WebDriver.Window.class); WebDriver.Options mockedManage = getMockedOptions(mockedWindow); BrowserComponent testBrowserComponent = new BrowserComponent(null, mockedScreenManager, false); testBrowserComponent.setWindowBounds(mockedManage); verify(mockedWindow).setPosition(new Point(1439, 0)); verify(mockedWindow).setSize(new Dimension(161, 2400)); }
Example 2
Source File: ScreenManagerTests.java From HubTurbo with GNU Lesser General Public License v3.0 | 5 votes |
/** * Tests whether the bView is maximised when the pView's size is past the resize threshold. */ @Test public void resizeBview_OversizedPView_MaximiseBView() { ScreenManager mockedScreenManager = getMockedScreenManager(1440.0, 1600, 160, 2400); WebDriver.Window mockedWindow = mock(WebDriver.Window.class); WebDriver.Options mockedManage = getMockedOptions(mockedWindow); BrowserComponent testBrowserComponent = new BrowserComponent(null, mockedScreenManager, false); testBrowserComponent.setWindowBounds(mockedManage); verify(mockedWindow).setPosition(new Point(0, 0)); verify(mockedWindow).setSize(new Dimension(1600, 2400)); }
Example 3
Source File: ScreenManagerTests.java From HubTurbo with GNU Lesser General Public License v3.0 | 5 votes |
/** * Tests whether the bView is maximised when the pView takes up the entire screen. */ @Test public void resizeBview_FullscreenPView_MaximisedBView() { ScreenManager mockedScreenManager = getMockedScreenManager(1600.0, 1600, 0, 2400); WebDriver.Window mockedWindow = mock(WebDriver.Window.class); WebDriver.Options mockedManage = getMockedOptions(mockedWindow); BrowserComponent testBrowserComponent = new BrowserComponent(null, mockedScreenManager, false); testBrowserComponent.setWindowBounds(mockedManage); verify(mockedWindow).setPosition(new Point(0, 0)); verify(mockedWindow).setSize(new Dimension(1600, 2400)); }
Example 4
Source File: ScreenManagerTests.java From HubTurbo with GNU Lesser General Public License v3.0 | 5 votes |
/** * Tests whether the bView snaps to the correct position when pView is out of position. */ @Test public void resizeBview_OutOfPositionPView_SnappedBView() { ScreenManager mockedScreenManager = getMockedScreenManager(800.0, 1600, 400, 2400); WebDriver.Window mockedWindow = mock(WebDriver.Window.class); WebDriver.Options mockedManage = getMockedOptions(mockedWindow); BrowserComponent testBrowserComponent = new BrowserComponent(null, mockedScreenManager, false); testBrowserComponent.setWindowBounds(mockedManage); verify(mockedWindow).setPosition(new Point(800, 0)); verify(mockedWindow).setSize(new Dimension(400, 2400)); }
Example 5
Source File: WindowListener2.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowIsMoved(WebDriver driver, WebDriver.Window window, Point targetPoint) { messages.add("Externally defined listener: The position the window has been changed. " + "The X is " + targetPoint.getX() + " the Y is " + targetPoint.getY()); }
Example 6
Source File: WindowListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowIsMaximized(WebDriver driver, WebDriver.Window window) { messages.add("The window has been maximized"); }
Example 7
Source File: WindowListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowIsMoved(WebDriver driver, WebDriver.Window window, Point targetPoint) { messages.add("The position the window has been changed. The X is " + targetPoint.getX() + " the Y is " + targetPoint.getY()); }
Example 8
Source File: WindowListener2.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowChangeSize(WebDriver driver, WebDriver.Window window, Dimension targetSize) { messages.add("Externally defined listener: Size of the window has " + "been changed. The height is " + targetSize.getHeight() + " the width is " + targetSize.getWidth()); }
Example 9
Source File: WindowListener2.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowIsMaximized(WebDriver driver, WebDriver.Window window) { messages.add("Externally defined listener: The window has been maximized"); }
Example 10
Source File: DefaultListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowIsMaximized(WebDriver driver, WebDriver.Window window) { ((WindowEventListener) dispatcher).afterWindowIsMaximized(driver, window); }
Example 11
Source File: DefaultListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void beforeWindowIsMaximized(WebDriver driver, WebDriver.Window window) { ((WindowEventListener) dispatcher).beforeWindowIsMaximized(driver, window); }
Example 12
Source File: DefaultListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowIsMoved(WebDriver driver, WebDriver.Window window, Point targetPoint) { ((WindowEventListener) dispatcher).afterWindowIsMoved(driver, window, targetPoint); }
Example 13
Source File: WindowListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void beforeWindowChangeSize(WebDriver driver, WebDriver.Window window, Dimension targetSize) { messages.add("Attempt to change size of the window. The height is " + targetSize.getHeight() + " the width is " + targetSize.getWidth()); }
Example 14
Source File: DefaultListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowChangeSize(WebDriver driver, WebDriver.Window window, Dimension targetSize) { ((WindowEventListener) dispatcher).afterWindowChangeSize(driver, window, targetSize); }
Example 15
Source File: WindowListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void beforeWindowIsMaximized(WebDriver driver, WebDriver.Window window) { messages.add("Attempt to maximize the window."); }
Example 16
Source File: WindowListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void afterWindowChangeSize(WebDriver driver, WebDriver.Window window, Dimension targetSize) { messages.add("Size of the window has been changed. The height is " + targetSize.getHeight() + " the width is " + targetSize.getWidth()); }
Example 17
Source File: WindowListener.java From java-client with Apache License 2.0 | 4 votes |
@Override public void beforeWindowIsMoved(WebDriver driver, WebDriver.Window window, Point targetPoint) { messages.add("Attempt to change position of the window. The X is " + targetPoint.getX() + " the Y is " + targetPoint.getY()); }
Example 18
Source File: CurrentWindow.java From webtester2-core with Apache License 2.0 | 4 votes |
private WebDriver.Window getWindowManager(Browser browser) { return browser.webDriver().manage().window(); }
Example 19
Source File: WindowEventListener.java From java-client with Apache License 2.0 | 2 votes |
/** * This action will be performed each time before {@link WebDriver.Window#setSize(Dimension)}. * * @param driver WebDriver * @param window is the window whose size is going to be changed * @param targetSize is the new size */ void beforeWindowChangeSize(WebDriver driver, WebDriver.Window window, Dimension targetSize);
Example 20
Source File: WindowEventListener.java From java-client with Apache License 2.0 | 2 votes |
/** * This action will be performed each time after {@link WebDriver.Window#maximize()}. * * @param driver WebDriver * @param window is the window which has been maximized */ void afterWindowIsMaximized(WebDriver driver, WebDriver.Window window);