import {ResizeBrowserWindow} from '@serenity-js/protractor/lib/screenplay/interactions'
ResizeBrowserWindow
Instructs the Actor to resize the browser window.
Please note that another way to set the size of the browser window
is to configure it in protractor.conf.js
.
Tests:
See also:
Static Method Summary
Static Public Methods | ||
public static |
to(width: number, height: number): Interaction Instantiates a version of this Interaction
setting the size of the browser window to given |
|
public static |
Instantiates a version of this Interaction setting the size of the browser window to maximum. |
Static Public Methods
public static to(width: number, height: number): Interaction source
Instantiates a version of this Interaction
setting the size of the browser window to given width
and height
Params:
Name | Type | Attribute | Description |
width | number | Desired new width of the browser window |
|
height | number | Desired new height of the browser window |
Examples:
Setting specific window size
import { actorCalled } from '@serenity-js/core';
import { BrowseTheWeb, Navigate, ResizeBrowserWindow } from '@serenity-js/protractor';
import { protractor } from 'protractor';
actorCalled('Ventana')
.whoCan(BrowseTheWeb.using(protractor.browser))
.attemptsTo(
Navigate.to('/app'),
ResizeBrowserWindow.to(828, 1792),
);
See:
public static toMaximum(): Interaction source
Instantiates a version of this Interaction setting the size of the browser window to maximum.
Examples:
Maximising browser window
import { actorCalled } from '@serenity-js/core';
import { BrowseTheWeb, Navigate, ResizeBrowserWindow, Window } from '@serenity-js/protractor';
import { Ensure, isGreaterThan } from '@serenity-js/assertions';
import { protractor } from 'protractor';
actorCalled('Ventana')
.whoCan(BrowseTheWeb.using(protractor.browser))
.attemptsTo(
Navigate.to('/app'),
ResizeBrowserWindow.toMaximum(),
Ensure.that(Window.size(), property('width', isGreaterThan(1024))),
);