@@ -11,7 +11,7 @@ import BudgetDiscussionDetailsPage from "@pages/budgetDiscussionDetailsPage";
1111import BudgetDiscussionSubmissionPage from "@pages/budgetDiscussionSubmissionPage" ;
1212import { expect } from "@playwright/test" ;
1313import {
14- BudgetProposalContactInformationProps ,
14+ BudgetProposalOwnershipProps ,
1515 BudgetProposalProps ,
1616 CompanyEnum ,
1717} from "@types" ;
@@ -47,38 +47,12 @@ test.describe("Budget proposal 01 wallet", () => {
4747 } ) ;
4848
4949 test . describe ( "Budget proposal field verification" , ( ) => {
50- test ( "12D_1. Should verify all field of “contact information” section" , async ( ) => {
51- await expect (
52- budgetProposalSubmissionPage . beneficiaryFullNameInput
53- ) . toBeVisible ( ) ;
54- await expect (
55- budgetProposalSubmissionPage . beneficiaryEmailInput
56- ) . toBeVisible ( ) ;
57- await expect (
58- budgetProposalSubmissionPage . beneficiaryCountrySelect
59- ) . toBeVisible ( ) ;
60- await expect (
61- budgetProposalSubmissionPage . beneficiaryNationalitySelect
62- ) . toBeVisible ( ) ;
63- await expect (
64- budgetProposalSubmissionPage . submissionLeadFullNameInput
65- ) . toBeVisible ( ) ;
66- } ) ;
67-
68- test ( "12D_2. Should verify all field of “proposal ownership” section" , async ( ) => {
69- const proposalContactInformationContent =
70- budgetProposalSubmissionPage . generateValidBudgetProposalContactInformation ( ) ;
71- await budgetProposalSubmissionPage . fillupContactInformationForm (
72- proposalContactInformationContent
73- ) ;
74-
50+ test ( "12D_1. Should verify all field of “proposal ownership” section" , async ( ) => {
7551 // default field
7652 await expect (
7753 budgetProposalSubmissionPage . companyTypeSelect
7854 ) . toBeVisible ( ) ;
79- await expect (
80- budgetProposalSubmissionPage . publicChampionSelect
81- ) . toBeVisible ( ) ;
55+
8256 await expect (
8357 budgetProposalSubmissionPage . contactDetailsInput
8458 ) . toBeVisible ( ) ;
@@ -111,10 +85,12 @@ test.describe("Budget proposal 01 wallet", () => {
11185 ) . toBeVisible ( ) ;
11286 } ) ;
11387
114- test ( "12D_3. Should verify all field of “problem statements and proposal benefits” section" , async ( ) => {
115- const proposalInformation =
116- budgetProposalSubmissionPage . generateValidBudgetProposalInformation ( ) ;
117- await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 3 ) ;
88+ test ( "12D_2. Should verify all field of “problem statements and proposal benefits” section" , async ( ) => {
89+ const proposalOwnership =
90+ budgetProposalSubmissionPage . generateValidProposalOwnerShip ( ) ;
91+ await budgetProposalSubmissionPage . fillupProposalOwnershipForm (
92+ proposalOwnership
93+ ) ;
11894
11995 await expect (
12096 budgetProposalSubmissionPage . problemStatementInput
@@ -136,10 +112,10 @@ test.describe("Budget proposal 01 wallet", () => {
136112 ) . toBeVisible ( ) ;
137113 } ) ;
138114
139- test ( "12D_4 . Should verify all field of “proposal details” section" , async ( ) => {
115+ test ( "12D_3 . Should verify all field of “proposal details” section" , async ( ) => {
140116 const proposalInformation =
141117 budgetProposalSubmissionPage . generateValidBudgetProposalInformation ( ) ;
142- await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 4 ) ;
118+ await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 3 ) ;
143119
144120 await expect (
145121 budgetProposalSubmissionPage . proposalNameInput
@@ -164,10 +140,10 @@ test.describe("Budget proposal 01 wallet", () => {
164140 ) . toBeVisible ( ) ;
165141 } ) ;
166142
167- test ( "12D_5 . Should verify all field of “costing” section" , async ( ) => {
143+ test ( "12D_4 . Should verify all field of “costing” section" , async ( ) => {
168144 const proposalInformation =
169145 budgetProposalSubmissionPage . generateValidBudgetProposalInformation ( ) ;
170- await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 5 ) ;
146+ await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 4 ) ;
171147
172148 await expect ( budgetProposalSubmissionPage . adaAmountInput ) . toBeVisible ( ) ;
173149 await expect (
@@ -184,20 +160,20 @@ test.describe("Budget proposal 01 wallet", () => {
184160 ) . toBeVisible ( ) ;
185161 } ) ;
186162
187- test ( "12D_6 . Should verify all field of “further information” section" , async ( ) => {
163+ test ( "12D_5 . Should verify all field of “further information” section" , async ( ) => {
188164 const proposalInformation =
189165 budgetProposalSubmissionPage . generateValidBudgetProposalInformation ( ) ;
190- await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 6 ) ;
166+ await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 5 ) ;
191167
192168 await expect ( budgetProposalSubmissionPage . linkTextInput ) . toBeVisible ( ) ;
193169 await expect ( budgetProposalSubmissionPage . linkUrlInput ) . toBeVisible ( ) ;
194170 await expect ( budgetProposalSubmissionPage . addLinkBtn ) . toBeVisible ( ) ;
195171 } ) ;
196172
197- test ( "12D_7 . Should verify all field of “administration and auditing” section" , async ( ) => {
173+ test ( "12D_6 . Should verify all field of “administration and auditing” section" , async ( ) => {
198174 const proposalInformation =
199175 budgetProposalSubmissionPage . generateValidBudgetProposalInformation ( ) ;
200- await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 7 ) ;
176+ await budgetProposalSubmissionPage . fillupForm ( proposalInformation , 6 ) ;
201177
202178 await expect (
203179 budgetProposalSubmissionPage . intersectNamedAdministratorSelect
@@ -247,32 +223,44 @@ test("12C. Should save and view draft proposal", async ({ browser }) => {
247223
248224 const budgetSubmissionPage = new BudgetDiscussionSubmissionPage ( page ) ;
249225 await budgetSubmissionPage . goto ( ) ;
250- const draftContactInformationContent =
251- ( await budgetSubmissionPage . createDraftBudgetProposal ( ) ) as BudgetProposalContactInformationProps ;
226+ const draftProposalOwnership =
227+ ( await budgetSubmissionPage . createDraftBudgetProposal ( ) ) as BudgetProposalOwnershipProps ;
252228 const getAddDrafts = await budgetSubmissionPage . getAllDrafts ( ) ;
253229
254230 expect ( getAddDrafts . length ) . toBeGreaterThan ( 0 ) ;
255231
256232 await budgetSubmissionPage . viewLastDraft ( ) ;
257233
258- await expect ( budgetSubmissionPage . beneficiaryFullNameInput ) . toHaveValue (
259- draftContactInformationContent . beneficiaryFullName
260- ) ;
261- await expect ( budgetSubmissionPage . beneficiaryEmailInput ) . toHaveValue (
262- draftContactInformationContent . beneficiaryEmail
263- ) ;
264- await expect ( budgetSubmissionPage . beneficiaryCountrySelect ) . toHaveText (
265- draftContactInformationContent . beneficiaryCountry
266- ) ;
267- await expect ( budgetSubmissionPage . beneficiaryNationalitySelect ) . toHaveText (
268- draftContactInformationContent . beneficiaryNationality
269- ) ;
270- await expect ( budgetSubmissionPage . submissionLeadFullNameInput ) . toHaveValue (
271- draftContactInformationContent . submissionLeadFullName
234+ await expect ( budgetSubmissionPage . companyTypeSelect ) . toHaveText (
235+ draftProposalOwnership . companyType
272236 ) ;
273- await expect ( budgetSubmissionPage . submissionLeadEmailInput ) . toHaveValue (
274- draftContactInformationContent . submissionLeadEmail
237+
238+ await expect ( budgetSubmissionPage . contactDetailsInput ) . toHaveValue (
239+ draftProposalOwnership . contactDetails
275240 ) ;
241+
242+ if ( draftProposalOwnership . companyType === "Group" ) {
243+ await expect ( budgetSubmissionPage . groupNameInput ) . toHaveValue (
244+ draftProposalOwnership . groupName
245+ ) ;
246+ await expect ( budgetSubmissionPage . groupTypeInput ) . toHaveValue (
247+ draftProposalOwnership . groupType
248+ ) ;
249+ await expect ( budgetSubmissionPage . keyInformationOfGroupInput ) . toHaveValue (
250+ draftProposalOwnership . groupKeyIdentity
251+ ) ;
252+ }
253+ if ( draftProposalOwnership . companyType === "Company" ) {
254+ await expect ( budgetSubmissionPage . companyNameInput ) . toHaveValue (
255+ draftProposalOwnership . companyName
256+ ) ;
257+ await expect ( budgetSubmissionPage . companyDomainNameInput ) . toHaveValue (
258+ draftProposalOwnership . companyDomainName
259+ ) ;
260+ await expect ( budgetSubmissionPage . countryOfIncorporationBtn ) . toHaveText (
261+ draftProposalOwnership . countryOfIncorportation
262+ ) ;
263+ }
276264} ) ;
277265
278266test ( "12H. Should submit a valid budget proposal" , async ( { browser } ) => {
@@ -310,7 +298,7 @@ test("12I. Should submit a valid draft budget proposal", async ({
310298
311299 await budgetSubmissionPage . viewLastDraft ( ) ;
312300
313- for ( let i = 0 ; i < 8 ; i ++ ) {
301+ for ( let i = 0 ; i < 7 ; i ++ ) {
314302 await budgetSubmissionPage . continueBtn . click ( ) ;
315303 }
316304 await budgetSubmissionPage . submitBtn . click ( ) ;
0 commit comments