First Test pass

This commit is contained in:
Nantawat Sukrisunt 2024-11-10 19:33:08 +07:00
parent 65ad1e2661
commit 8cf74b5e4c
4 changed files with 22 additions and 28 deletions

View File

@ -36,7 +36,7 @@ export async function deleteUserByEmail(email: string): Promise<boolean> {
console.error(`UID is null`);
return false;
}
// const data = await deleteUser(uid);
console.log(`Successfully delete user with email: ${email}`);
await deleteUser(uid);
console.log(`Successfully delete user with email: ${email} and UID: ${uid}`);
return true;
}

View File

@ -14,7 +14,6 @@ export const selectFirstOption = async (page: Page, triggerLocator: Locator) =>
const optionText = await firstOption.textContent();
console.log(`${optionText}`);
await firstOption.click();
console.log("Selected.");
selected = true
} catch (error) {
console.log("Retrying as the combobox disappeared.");

View File

@ -1,20 +1,20 @@
// import { test, expect } from "@playwright/test";
// import { login } from "./helpers/login";
// import { selectFirstOption } from "./helpers/dropdownUtils";
//
// test("test", async ({ page }) => {
// await login(page, "user");
// await page.getByRole('button', { name: 'Businesses' }).hover();
// await page.getByRole("link", { name: "Business Apply to raise on on" }).click();
//
// await selectFirstOption(page, page.locator("button").filter({ hasText: "Select an industry" }));
// await selectFirstOption(page, page.locator("button").filter({ hasText: "Select a country" }));
// await page.getByPlaceholder("$").fill("999998");
// await page.getByRole("button", { name: "Yes" }).first().click();
// await page.getByRole("button", { name: "Yes" }).nth(1).click();
// await page.getByRole("button", { name: "Yes" }).nth(2).click();
// await page.getByPlaceholder('https:// ').fill('https://www.test.md');
// await selectFirstOption(page, page.locator("button").filter({ hasText: "Select" }));
// await page.locator("#companyName").fill("kasetsart");
// await page.getByRole('button', { name: 'Submit application' }).click();
// });
import { test } from "@playwright/test";
import { login } from "./helpers/login";
import { selectFirstOption } from "./helpers/dropdownUtils";
test("test", async ({ page }) => {
await login(page, "user");
await page.getByRole('button', { name: 'Businesses' }).hover();
await page.getByRole("link", { name: "Business Apply to raise on on" }).click();
await selectFirstOption(page, page.locator("button").filter({ hasText: "Select an industry" }));
await selectFirstOption(page, page.locator("button").filter({ hasText: "Select a country" }));
await page.getByPlaceholder("$").fill("999998");
await page.getByRole("button", { name: "Yes" }).first().click();
await page.getByRole("button", { name: "Yes" }).nth(1).click();
await page.getByRole("button", { name: "Yes" }).nth(2).click();
await page.getByPlaceholder('https:// ').fill('https://www.test.md');
await selectFirstOption(page, page.locator("button").filter({ hasText: "Select" }));
await page.locator("#companyName").fill("kasetsart");
await page.getByRole('button', { name: 'Submit application' }).click();
});

View File

@ -1,5 +0,0 @@
// import { test, expect } from '@playwright/test';
//
// test('test', async ({ page }) => {
//
// });