Skip to main content

setOrientation

Overview

Use the setOrientation command to change the browser orientation. This command ensures that subsequent commands will not start executing until the orientation change occurs. If the device does not support this feature, the command will be ignored.

Usage

await browser.setOrientation(orientation);

Command Parameters

NameTypeDescription
orientation"landscape" | "portrait"

The path to the screenshot relative to the execution directory (the .png extension is mandatory).

Usage Examples

it("test", async ({ browser }) => {
await browser.setOrientation("landscape");
});