public class PlaywrightConfig {
public static Browser.NewContextOptions getStandardContextOptions() {
return new Browser.NewContextOptions()
.setBaseURL("https://staging.targetqa.com")
.setViewportSize(1920, 1080)
.setLocale("en-US")
.setTimezoneId("America/New_York");
}public static Browser.NewContextOptions getMobileDeviceOptions(Playwright playwright) {
// Device emulation (e.g. iPhone 14):
return new Browser.NewContextOptions()
.setViewportSize(390, 844)
.setUserAgent("Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X)...")
.setIsMobile(true)
.setHasTouch(true);
}
}