@@ -72,7 +72,6 @@ test.describe("Proposal checks", () => {
7272 currentPage . getByTestId ( `${ cip129GovActionId } -id` )
7373 ) . toBeVisible ( ) ;
7474
75- await expect ( govActionDetailsPage . contextBtn ) . toBeVisible ( ) ;
7675 await expect ( govActionDetailsPage . showVotesBtn ) . toBeVisible ( ) ;
7776
7877 await expect ( govActionDetailsPage . voteBtn ) . toBeVisible ( ) ;
@@ -87,20 +86,22 @@ test.describe("Proposal checks", () => {
8786 await expect ( govActionDetailsPage . noVoteRadio ) . toBeVisible ( ) ;
8887 await expect ( govActionDetailsPage . abstainRadio ) . toBeVisible ( ) ;
8988
90- await govActionDetailsPage . contextBtn . click ( ) ;
89+ await govActionDetailsPage . yesVoteRadio . click ( ) ;
90+ await govActionDetailsPage . voteBtn . click ( ) ;
9191
9292 await expect ( govActionDetailsPage . contextInput ) . toBeVisible ( ) ;
9393 await govActionDetailsPage . cancelModalBtn . click ( ) ;
9494
95- await govActionDetailsPage . yesVoteRadio . click ( ) ;
9695 await expect ( govActionDetailsPage . voteBtn ) . toBeEnabled ( ) ;
9796 } ) ;
9897
9998 test . describe ( "Validate provide context about vote" , ( ) => {
10099 const characters =
101100 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ;
102101 test ( "5D_1. Should accept valid data in provide context" , async ( ) => {
103- await govActionDetailsPage . contextBtn . click ( ) ;
102+
103+ await govActionDetailsPage . yesVoteRadio . click ( )
104+ await govActionDetailsPage . voteBtn . click ( )
104105
105106 await expect ( govActionDetailsPage . contextInput ) . toBeVisible ( ) ;
106107
@@ -119,7 +120,8 @@ test.describe("Proposal checks", () => {
119120 } ) ;
120121
121122 test ( "5D_2. Should reject invalid data in provide context" , async ( ) => {
122- await govActionDetailsPage . contextBtn . click ( ) ;
123+ await govActionDetailsPage . yesVoteRadio . click ( )
124+ await govActionDetailsPage . voteBtn . click ( )
123125
124126 await expect ( govActionDetailsPage . contextInput ) . toBeVisible ( ) ;
125127
@@ -245,32 +247,23 @@ test.describe("Perform voting", () => {
245247 ) . toBeVisible ( ) ;
246248
247249 govActionDetailsPage = await governanceActionsPage . viewFirstVotedProposal ( ) ;
248- await govActionDetailsPage . vote ( faker . lorem . sentence ( 200 ) , true ) ;
250+
251+ const fakerContext = faker . lorem . sentence ( 200 )
252+ await govActionDetailsPage . vote ( fakerContext , true ) ;
249253
250254 await govActionDetailsPage . currentPage . reload ( ) ;
251255
252256 await governanceActionsPage . votedTab . click ( ) ;
253257
254- const isYesVoteVisible = await govActionDetailsPage . currentPage
255- . getByTestId ( "my-vote" )
256- . getByText ( "Yes" )
257- . isVisible ( ) ;
258-
259- const textContent = await govActionDetailsPage . currentPage
260- . getByTestId ( "my-vote" )
261- . textContent ( ) ;
262-
263- await govActionDetailsPage . currentPage . evaluate ( ( ) =>
264- window . scrollTo ( 0 , 500 )
265- ) ;
266- await expect (
267- govActionDetailsPage . currentPage . getByTestId ( "my-vote" ) . getByText ( "Yes" ) ,
268- {
269- message :
270- ! isYesVoteVisible &&
271- `"Yes" vote not visible, current vote status: ${ textContent . match ( / M y V o t e : ( Y e s | N o ) / ) [ 1 ] } ` ,
272- }
273- ) . toBeVisible ( { timeout : 60_000 } ) ;
258+ govActionDetailsPage = await governanceActionsPage . viewFirstVotedProposal ( ) ;
259+
260+ await govActionDetailsPage . currentPage . getByTestId ( "yes-radio" ) . isVisible ( ) ;
261+
262+ await govActionDetailsPage . currentPage . getByTestId ( "show-more-button" ) . click ( ) ;
263+ await govActionDetailsPage . currentPage . waitForTimeout ( 2000 ) ;
264+
265+ const voteRationaleContext = await govActionDetailsPage . currentPage . getByTestId ( "vote-rationale-context" ) ;
266+ await expect ( voteRationaleContext ) . toContainText ( fakerContext ) ;
274267 } ) ;
275268
276269 test ( "5I. Should view the vote details,when viewing governance action already voted by the DRep" , async ( { } , testInfo ) => {
@@ -282,7 +275,7 @@ test.describe("Perform voting", () => {
282275 govActionDetailsPage . currentPage
283276 ) ;
284277
285- await governanceActionsPage . currentPage . waitForTimeout ( 5_000 ) ;
278+ await governanceActionsPage . getFirstProposal ( ) ;
286279
287280 await governanceActionsPage . votedTab . click ( ) ;
288281 await expect (
0 commit comments