diff --git a/integration_test/lib/fixtures/organizer.ts b/integration_test/lib/fixtures/organizer.ts index 035ddd3..0efd773 100644 --- a/integration_test/lib/fixtures/organizer.ts +++ b/integration_test/lib/fixtures/organizer.ts @@ -10,10 +10,10 @@ type TestOptions = { pollType: pollEnableType; }; -export const test = base.extend({ +export const test = base.extend({ 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', @@ -34,7 +34,7 @@ export const test = base.extend({ } } - await use(page); + await use(pollId ); // cleanup if (pollType !== 'NoAction') { diff --git a/integration_test/tests/0-common/comon.spec.ts b/integration_test/tests/0-common/comon.spec.ts index e9c856a..eee2f6f 100644 --- a/integration_test/tests/0-common/comon.spec.ts +++ b/integration_test/tests/0-common/comon.spec.ts @@ -1,6 +1,6 @@ import { setAllureEpic } from '@helpers/allure'; import { expect } from '@playwright/test'; -import { test } from '@fixtures/walletExtension'; +import { test } from '@fixtures/organizer'; @@ -8,8 +8,9 @@ test.beforeEach(async () => { await setAllureEpic('0. All Users'); }); -// test.use({ storageState: '.auth/organizer.json', wallet: organizerWallet }); -// +test.use({ + pollType: 'CreateAndBeginPoll', +});// test.describe('Polls', () => { diff --git a/integration_test/tests/2-constitutional-delegates/constitutionalDelegate.spec.ts b/integration_test/tests/2-constitutional-delegates/constitutionalDelegate.spec.ts index 60be763..4c9323b 100644 --- a/integration_test/tests/2-constitutional-delegates/constitutionalDelegate.spec.ts +++ b/integration_test/tests/2-constitutional-delegates/constitutionalDelegate.spec.ts @@ -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(); @@ -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();