import { Page } from "@playwright/test";
import { TEST_PASSWORD } from "../test-data";

export async function enterPasswordsDuringOnboarding(page: Page) {
  await page
    .getByPlaceholder("Enter password", { exact: true })
    .fill(TEST_PASSWORD);
  await page
    .getByPlaceholder("Re-enter password", { exact: true })
    .fill(TEST_PASSWORD);
  await page.getByText("Proceed", { exact: true }).click();
}

export async function selectWalletDuringOnboarding(
  page: Page,
  walletName: string,
) {
  await page
    .locator("div")
    .filter({ hasText: new RegExp(`^${walletName}$`) })
    .first()
    .click();
}
