|
1 | | -import { budgetProposal01Wallet } from "@constants/staticWallets"; |
2 | | -import { test } from "@fixtures/walletExtension"; |
| 1 | +import { |
| 2 | + budgetProposal01Wallet, |
| 3 | + budgetProposal02Wallet, |
| 4 | +} from "@constants/staticWallets"; |
| 5 | +import { test } from "@fixtures/budgetProposal"; |
3 | 6 | import { setAllureEpic } from "@helpers/allure"; |
| 7 | +import { createNewPageWithWallet } from "@helpers/page"; |
4 | 8 | import BudgetDiscussionSubmissionPage from "@pages/budgetDiscussionSubmissionPage"; |
5 | 9 | import { expect } from "@playwright/test"; |
| 10 | +import { BudgetProposalContactInformationProps } from "@types"; |
6 | 11 |
|
7 | | -test.beforeEach(async ({}) => { |
| 12 | +test.beforeEach(async () => { |
8 | 13 | await setAllureEpic("12. Proposal Budget Submission"); |
9 | 14 | }); |
10 | 15 |
|
11 | | -test.use({ |
12 | | - storageState: ".auth/budgetProposal01.json", |
13 | | - wallet: budgetProposal01Wallet, |
14 | | -}); |
| 16 | +test.describe("Budget proposal 01 wallet", () => { |
| 17 | + test.use({ |
| 18 | + storageState: ".auth/budgetProposal01.json", |
| 19 | + wallet: budgetProposal01Wallet, |
| 20 | + }); |
15 | 21 |
|
16 | | -test("12B. Should access proposal creation page in connected state", async ({ |
17 | | - page, |
18 | | -}) => { |
19 | | - const budgetProposalSubmissionPage = new BudgetDiscussionSubmissionPage(page); |
20 | | - await budgetProposalSubmissionPage.goto(); |
21 | | - await expect( |
22 | | - budgetProposalSubmissionPage.beneficiaryFullNameInput |
23 | | - ).toBeVisible(); |
24 | | -}); |
| 22 | + test("12B. Should access proposal creation page in connected state", async ({ |
| 23 | + page, |
| 24 | + }) => { |
| 25 | + const budgetProposalSubmissionPage = new BudgetDiscussionSubmissionPage( |
| 26 | + page |
| 27 | + ); |
| 28 | + await budgetProposalSubmissionPage.goto(); |
| 29 | + await expect( |
| 30 | + budgetProposalSubmissionPage.beneficiaryFullNameInput |
| 31 | + ).toBeVisible(); |
| 32 | + }); |
25 | 33 |
|
26 | | -test("12C. Should view draft proposal", async ({}) => {}); |
| 34 | + test.describe("Budget proposal field verification", () => { |
| 35 | + test("12D_1. Should verify all field of “contact information” section", async ({}) => {}); |
| 36 | + test("12D_2. Should verify all field of “proposal ownership” section", async ({}) => {}); |
| 37 | + test("12D_3. Should verify all field of “problem statements and proposal benefits” section", async ({}) => {}); |
| 38 | + test("12D_4. Should verify all field of “costing” section", async ({}) => {}); |
| 39 | + test("12D_5. Should verify all field of “further information” section", async ({}) => {}); |
| 40 | + test("12D_6. Should verify all field of “administration and auditing” section", async ({}) => {}); |
| 41 | + test("12D_7. Should verify all field of “submit” section", async ({}) => {}); |
| 42 | + }); |
27 | 43 |
|
28 | | -test.describe("Budget proposal field verification", () => { |
29 | | - test("12D_1. Should verify all field of “contact information” section", async ({}) => {}); |
30 | | - test("12D_2. Should verify all field of “proposal ownership” section", async ({}) => {}); |
31 | | - test("12D_3. Should verify all field of “problem statements and proposal benefits” section", async ({}) => {}); |
32 | | - test("12D_4. Should verify all field of “costing” section", async ({}) => {}); |
33 | | - test("12D_5. Should verify all field of “further information” section", async ({}) => {}); |
34 | | - test("12D_6. Should verify all field of “administration and auditing” section", async ({}) => {}); |
35 | | - test("12D_7. Should verify all field of “submit” section", async ({}) => {}); |
36 | | -}); |
| 44 | + test.describe("Budget proposal field validation", () => { |
| 45 | + test("12E_1. Should accept valid data in “contact information” section", async ({}) => {}); |
| 46 | + test("12E_2. Should accept valid data in “proposal ownership” section", async ({}) => {}); |
| 47 | + test("12E_3. Should accept valid data in “problem statements and proposal benefits” section", async ({}) => {}); |
| 48 | + test("12E_4. Should accept valid data in “costing” section", async ({}) => {}); |
| 49 | + test("12E_5. Should accept valid data in “further information” section", async ({}) => {}); |
| 50 | + test("12E_6. Should accept valid data in “administration and auditing” section", async ({}) => {}); |
| 51 | + test("12E_7. Should accept valid data in “submit” section", async ({}) => {}); |
| 52 | + test("12F_1. Should reject invalid data in “contact information” section", async ({}) => {}); |
| 53 | + test("12F_2. Should reject invalid data in “proposal ownership” section", async ({}) => {}); |
| 54 | + test("12F_3. Should reject invalid data in “problem statements and proposal benefits” section", async ({}) => {}); |
| 55 | + test("12F_4. Should reject invalid data in “costing” section", async ({}) => {}); |
| 56 | + test("12F_5. Should reject invalid data in “further information” section", async ({}) => {}); |
| 57 | + test("12F_6. Should reject invalid data in “administration and auditing” section", async ({}) => {}); |
| 58 | + test("12F_7. Should reject invalid data in “submit” section", async ({}) => {}); |
| 59 | + }); |
37 | 60 |
|
38 | | -test.describe("Budget proposal field validation", () => { |
39 | | - test("12E_1. Should accept valid data in “contact information” section", async ({}) => {}); |
40 | | - test("12E_2. Should accept valid data in “proposal ownership” section", async ({}) => {}); |
41 | | - test("12E_3. Should accept valid data in “problem statements and proposal benefits” section", async ({}) => {}); |
42 | | - test("12E_4. Should accept valid data in “costing” section", async ({}) => {}); |
43 | | - test("12E_5. Should accept valid data in “further information” section", async ({}) => {}); |
44 | | - test("12E_6. Should accept valid data in “administration and auditing” section", async ({}) => {}); |
45 | | - test("12E_7. Should accept valid data in “submit” section", async ({}) => {}); |
46 | | - test("12F_1. Should reject invalid data in “contact information” section", async ({}) => {}); |
47 | | - test("12F_2. Should reject invalid data in “proposal ownership” section", async ({}) => {}); |
48 | | - test("12F_3. Should reject invalid data in “problem statements and proposal benefits” section", async ({}) => {}); |
49 | | - test("12F_4. Should reject invalid data in “costing” section", async ({}) => {}); |
50 | | - test("12F_5. Should reject invalid data in “further information” section", async ({}) => {}); |
51 | | - test("12F_6. Should reject invalid data in “administration and auditing” section", async ({}) => {}); |
52 | | - test("12F_7. Should reject invalid data in “submit” section", async ({}) => {}); |
| 61 | + test("12G. Should validate and review submitted budget proposal", async ({}) => {}); |
53 | 62 | }); |
54 | 63 |
|
55 | | -test("12G. Should validate and review submitted budget proposal", async ({}) => {}); |
56 | | -test("12H. Should save a budget proposal as a draft", async ({}) => {}); |
| 64 | +test("12C. Should save and view draft proposal", async ({ browser }) => { |
| 65 | + const page = await createNewPageWithWallet(browser, { |
| 66 | + storageState: ".auth/budgetProposal02.json", |
| 67 | + wallet: budgetProposal02Wallet, |
| 68 | + }); |
| 69 | + |
| 70 | + const budgetSubmissionPage = new BudgetDiscussionSubmissionPage(page); |
| 71 | + await budgetSubmissionPage.goto(); |
| 72 | + const draftContactInformationContent = |
| 73 | + (await budgetSubmissionPage.createDraftBudgetProposal()) as BudgetProposalContactInformationProps; |
| 74 | + const getAddDrafts = await budgetSubmissionPage.getAllDrafts(); |
| 75 | + |
| 76 | + expect(getAddDrafts.length).toBeGreaterThan(0); |
| 77 | + |
| 78 | + await budgetSubmissionPage.viewLastDraft(); |
| 79 | + |
| 80 | + await expect(budgetSubmissionPage.beneficiaryFullNameInput).toHaveValue( |
| 81 | + draftContactInformationContent.beneficiaryFullName |
| 82 | + ); |
| 83 | + await expect(budgetSubmissionPage.beneficiaryEmailInput).toHaveValue( |
| 84 | + draftContactInformationContent.beneficiaryEmail |
| 85 | + ); |
| 86 | + await expect(budgetSubmissionPage.beneficiaryCountrySelect).toHaveText( |
| 87 | + draftContactInformationContent.beneficiaryCountry |
| 88 | + ); |
| 89 | + await expect(budgetSubmissionPage.beneficiaryNationalitySelect).toHaveText( |
| 90 | + draftContactInformationContent.beneficiaryNationality |
| 91 | + ); |
| 92 | + await expect(budgetSubmissionPage.submissionLeadFullNameInput).toHaveValue( |
| 93 | + draftContactInformationContent.submissionLeadFullName |
| 94 | + ); |
| 95 | + await expect(budgetSubmissionPage.submissionLeadEmailInput).toHaveValue( |
| 96 | + draftContactInformationContent.submissionLeadEmail |
| 97 | + ); |
| 98 | +}); |
57 | 99 |
|
58 | | -test("12I. Should submit a valid budget proposal", async ({}) => {}); |
59 | | -test("12J. Should submit a valid draft budget proposal", async ({}) => {}); |
| 100 | +test("12H. Should submit a valid budget proposal", async ({}) => {}); |
| 101 | +test("12I. Should submit a valid draft budget proposal", async ({}) => {}); |
0 commit comments