From 06a264011e8a8de4bdb229e60761219e9ab7e94f Mon Sep 17 00:00:00 2001 From: Sudip Bhattarai Date: Wed, 27 Nov 2024 10:27:32 +0545 Subject: [PATCH] Fix poll deletion --- integration_test/lib/pages/homePage.ts | 4 +++- integration_test/lib/pages/pollPage.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/integration_test/lib/pages/homePage.ts b/integration_test/lib/pages/homePage.ts index 0677930..c8be483 100644 --- a/integration_test/lib/pages/homePage.ts +++ b/integration_test/lib/pages/homePage.ts @@ -2,6 +2,7 @@ import { expect, Locator, Page } from '@playwright/test'; import { faker } from '@faker-js/faker'; import { extractPollIdFromUrl } from '@helpers/string'; import { blake } from 'libcardano'; +import PollPage from './pollPage'; export default class HomePage { readonly heading = this.page.getByText( @@ -75,7 +76,8 @@ export default class HomePage { const openPollCard = await this.getOpenPollCard(); if (openPollCard) { await openPollCard.click(); - await this.page.getByTestId('delete-poll-button').click(); + const pollPage=new PollPage(this.page) + await pollPage.deletePoll() return true; } return false; diff --git a/integration_test/lib/pages/pollPage.ts b/integration_test/lib/pages/pollPage.ts index b1fab4a..15bec92 100644 --- a/integration_test/lib/pages/pollPage.ts +++ b/integration_test/lib/pages/pollPage.ts @@ -6,6 +6,8 @@ export default class PollPage { readonly beginVoteBtn = this.page.getByTestId('begin-vote-button'); readonly closeVoteBtn = this.page.getByTestId('end-vote-button'); readonly deletePollBtn = this.page.getByTestId('DeleteRoundedIcon'); + readonly deletePollConfirm = this.page.getByTestId('delete-poll-button'); + readonly voteYesBtn = this.page.getByTestId('vote-yes-button'); readonly voteNoBtn = this.page.getByTestId('vote-no-button'); readonly voteAbstainBtn = this.page.getByTestId('vote-abstain-button'); @@ -14,7 +16,7 @@ export default class PollPage { readonly endVoteCancelBtn = this.page.getByTestId('cancel-end-vote-button'); readonly downloadVotesBtn = this.page.getByTestId('download-poll-votes-btn'); readonly uploadVoteOnchainBtn = this.page.getByTestId( - 'put-votes-onchain-btn' + 'put-votes-onchain-button' ); //chip or icon @@ -29,6 +31,8 @@ export default class PollPage { async deletePoll(): Promise { await this.deletePollBtn.click(); + await this.deletePollConfirm.click(); + } async endVoting() { await this.endVotingBtn.click();