diff --git a/tests/test-01-business-apply.spec.ts b/tests/test-01-business-apply.spec.ts new file mode 100644 index 0000000..c4f5220 --- /dev/null +++ b/tests/test-01-business-apply.spec.ts @@ -0,0 +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(); +// }); diff --git a/tests/test-02-admin-approve-business.spec.ts.ts b/tests/test-02-admin-approve-business.spec.ts.ts new file mode 100644 index 0000000..92d6407 --- /dev/null +++ b/tests/test-02-admin-approve-business.spec.ts.ts @@ -0,0 +1,5 @@ +// import { test, expect } from '@playwright/test'; +// +// test('test', async ({ page }) => { +// +// }); \ No newline at end of file diff --git a/tests/test-03-project-apply.spec.ts b/tests/test-03-project-apply.spec.ts new file mode 100644 index 0000000..e8653a6 --- /dev/null +++ b/tests/test-03-project-apply.spec.ts @@ -0,0 +1,36 @@ +// import { test } from '@playwright/test'; +// import { selectFirstOption } from './helpers/dropdownUtils'; +// import { login } from './helpers/login'; +// import path from 'path'; +// +// test('test', async ({ page }) => { +// await login(page,'user') +// await page.getByRole('button', { name: 'Projects' }).hover(); +// await page.getByRole('link', { name: 'Projects Start your new' }).click(); +// +// const projectName = page.locator('#projectName') +// await projectName.pressSequentially('DummyTester'); +// await projectName.click(); +// +// const img = path.join(__dirname, 'mockup', '1x1.png'); +// await page.locator('#projectLogo').click(); +// await page.locator('#projectLogo').setInputFiles(img); +// await page.locator('#projectPhotos').click(); +// await page.locator('#projectPhotos').setInputFiles(img); +// +// const projectTypeButton = page.locator('button').filter({ hasText: 'Select a Project type' }); +// await selectFirstOption(page, projectTypeButton); +// +// await page.locator('#shortDescription').fill('0123456789'); +// await page.getByPlaceholder('https:// ').fill('https://www.test.md'); +// await page.getByPlaceholder('$ 500').fill('499'); +// await page.getByPlaceholder('$ 1,000,000').fill('99999999'); +// await page.locator('#deadline').fill('2024-11-29T21:19'); +// +// const tag = page.getByRole('combobox').nth(1); +// await selectFirstOption(page, tag); +// +// await projectName.pressSequentially('1234'); +// +// await page.getByRole('button', { name: 'Submit application' }).click(); +// }); diff --git a/tests/test-1-project-apply.spec.ts b/tests/test-1-project-apply.spec.ts deleted file mode 100644 index 6d78c6e..0000000 --- a/tests/test-1-project-apply.spec.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { test } from '@playwright/test'; -import { selectFirstOption } from './helpers/dropdownUtils'; -import path from 'path'; - -test('test', async ({ page }) => { - await page.goto("http://127.0.0.1:3000/"); - await page.getByRole('button', { name: 'Projects' }).hover(); - await page.getByRole('link', { name: 'Projects Start your new' }).click(); - - const projectName = page.locator('#projectName') - await projectName.pressSequentially('DummyTester'); - await projectName.click(); - - const img = path.join(__dirname, 'mockup', '1x1.png'); - await page.locator('#projectLogo').click(); - await page.locator('#projectLogo').setInputFiles(img); - await page.locator('#projectPhotos').click(); - await page.locator('#projectPhotos').setInputFiles(img); - - const projectTypeButton = page.locator('button').filter({ hasText: 'Select a Project type' }); - await selectFirstOption(page, projectTypeButton); - - await page.locator('#shortDescription').fill('0123456789'); - await page.getByPlaceholder('https:// ').fill('https://www.test.md'); - await page.getByPlaceholder('$ 500').fill('499'); - await page.getByPlaceholder('$ 1,000,000').fill('99999999'); - await page.locator('#deadline').fill('2024-11-29T21:19'); - - const tag = page.getByRole('combobox').nth(1); - await selectFirstOption(page, tag); - - await projectName.pressSequentially('1234'); - - await page.getByRole('button', { name: 'Submit application' }).click(); -});