package zacksolutions;

import com.microsoft.playwright.Browser;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.Playwright;
import org.testng.annotations.Test;

import java.nio.file.Paths;

public class BrowserLaunchTest {
  @Test
  public void browserLaunch() {
    try (Playwright playwright = Playwright.create()) {
      Browser browser = playwright.chromium().launch();
      Page page = browser.newPage();
      page.navigate("https://zenful.cloud");
      System.out.println(page.title());
      page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("photo.png")));
      page.type("input[id='message']", "4 8 15 16 23 42");
      page.click("button");
    }
  }
}
