Skip to content

Commit

Permalink
Fix poll deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
mesudip committed Nov 27, 2024
1 parent 53e55c6 commit 06a2640
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion integration_test/lib/pages/homePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion integration_test/lib/pages/pollPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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
Expand All @@ -29,6 +31,8 @@ export default class PollPage {

async deletePoll(): Promise<void> {
await this.deletePollBtn.click();
await this.deletePollConfirm.click();

}
async endVoting() {
await this.endVotingBtn.click();
Expand Down

0 comments on commit 06a2640

Please sign in to comment.