import { fixture } from "../hooks/pageFixture"; import { LaunchOptions, chromium, firefox, webkit } from "@playwright/test"; export default class BrowserActions { constructor() { } async navigateTo(url: string) { await fixture.page.goto(url, { waitUntil: "domcontentloaded" }); fixture.logger.info('Successfully navigated to ' + url) //ActionLogger.log({timestamp, locator, status, message,}); } } const options: LaunchOptions = { headless: !true } export const invokeBrowser = () => { const browserType = process.env.npm_config_BROWSER || "chrome"; switch (browserType) { case "chrome": return chromium.launch(options); case "firefox": return firefox.launch(options); case "webkit": return webkit.launch(options); default: throw new Error("Please set the proper browser!") } }