Skip to content

Commit

Permalink
Test: Update fixture to return pollId
Browse files Browse the repository at this point in the history
  • Loading branch information
mesudip committed Nov 15, 2024
1 parent 0000bdd commit a2ab8bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
6 changes: 3 additions & 3 deletions integration_test/lib/fixtures/organizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ type TestOptions = {
pollType: pollEnableType;
};

export const test = base.extend<TestOptions>({
export const test = base.extend<TestOptions & {pollId: number}>({
pollType: ['NoAction', { option: true }],

page: async ({ page, browser, pollType }, use) => {
pollId: async ({ page, browser, pollType }, use) => {
// setup
const organizerPage = await createNewPageWithWallet(browser, {
storageState: '.auth/organizer.json',
Expand All @@ -34,7 +34,7 @@ export const test = base.extend<TestOptions>({
}
}

await use(page);
await use(pollId );

// cleanup
if (pollType !== 'NoAction') {
Expand Down
7 changes: 4 additions & 3 deletions integration_test/tests/0-common/comon.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { setAllureEpic } from '@helpers/allure';
import { expect } from '@playwright/test';
import { test } from '@fixtures/walletExtension';
import { test } from '@fixtures/organizer';



test.beforeEach(async () => {
await setAllureEpic('0. All Users');
});

// test.use({ storageState: '.auth/organizer.json', wallet: organizerWallet });
//
test.use({
pollType: 'CreateAndBeginPoll',
});//

test.describe('Polls', () => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ test.describe('Vote', () => {
* *conversely votes that are 'closed' or 'pending' do not give voters the option to vote.
*/
test('21A. Given active delegate, and poll is open, can cast vote', async ({
page,
page, pollId
}) => {
const homePage = new HomePage(page);
await homePage.goto();
const openPollCard = await homePage.getOpenPollCard();
await openPollCard.click();
const pollPage = new PollPage(page);
await pollPage.goto(pollId)

await expect(pollPage.voteYesBtn).toBeVisible();
await expect(pollPage.voteNoBtn).toBeVisible();
Expand Down Expand Up @@ -70,13 +67,10 @@ test.describe('Pending poll visibility', () => {
});

test('21B. Given active delegate and the poll is pending, voting should be disallowed', async ({
page,
page, pollId
}) => {
const homePage = new HomePage(page);
await homePage.goto();
const openPollCard = await homePage.getOpenPollCard();
await openPollCard.click();
const pollPage = new PollPage(page);
await pollPage.goto(pollId)

await expect(pollPage.voteYesBtn).not.toBeVisible();
await expect(pollPage.voteNoBtn).not.toBeVisible();
Expand Down

0 comments on commit a2ab8bf

Please sign in to comment.