diff --git a/.gitignore b/.gitignore index 741a9fb..77acb57 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,6 @@ cloud-sql-proxy # eslint config eslint.config.mjs -allure-results \ No newline at end of file +allure-results + +.auth/ \ No newline at end of file diff --git a/integration_test/tests/1-convention-organizers/conventionOrganizer.loggedin.spec.ts b/integration_test/tests/1-convention-organizers/conventionOrganizer.loggedin.spec.ts index 6be38c5..4087987 100644 --- a/integration_test/tests/1-convention-organizers/conventionOrganizer.loggedin.spec.ts +++ b/integration_test/tests/1-convention-organizers/conventionOrganizer.loggedin.spec.ts @@ -5,6 +5,29 @@ import { expect } from '@playwright/test'; import { test } from '@fixtures/walletExtension'; import RepresentativesPage from '@pages/representativesPage'; import LoginPage from '@pages/loginPage'; +import { types } from 'util'; + +const workshopInfo = [ + { + name: 'Dubai', + delegate_id: BigInt(2), + alternate_id: BigInt(5), + active_vote_id: BigInt(2), + }, + { + name: 'Singapore', + delegate_id: BigInt(4), + alternate_id: BigInt(3), + active_vote_id: BigInt(3), + }, + { name: 'Convention Organizer' }, + { + name: 'Buenos Aires', + delegate_id: BigInt(8), + alternate_id: BigInt(7), + active_vote_id: BigInt(8), + }, +]; test.beforeEach(async () => { await setAllureEpic('1. Convention Organizers'); @@ -79,6 +102,44 @@ test.describe('Poll results', () => { }); }); +test.describe('Delegates and Alternates Grouped together', () => { + test('1N. Should have corresponding workspace delegate and alternate in a same row', async ({ + page, + }) => { + await page.goto('/'); + await expect(page.getByRole('row').first()).toBeVisible(); + const delegate = await page.getByRole('gridcell').nth(1).innerText(); + const alternate = await page.getByRole('gridcell').nth(2).innerText(); + const delegatesList = await page + .locator('[data-testid^="delegate-name-"]') + .allInnerTexts(); + const alternateList = await page + .locator('[data-testid^="alternate-name-"]') + .allInnerTexts(); + expect(delegatesList).toContain(delegate); + expect(alternateList).toContain(alternate); + }); + + test('1O. Should have workspace_name ordered alphabetically', async ({ + page, + }) => { + const workspaceNames = []; + await page.goto('/'); + await expect(page.getByRole('row').first()).toBeVisible(); + const rows = await page.getByRole('row').all(); + rows.shift(); + for (const row of rows) { + const workspace = (await row.allInnerTexts())[0].split('\n')[0]; + workspaceNames.push(workspace); + } + expect( + workspaceNames.every( + (word, i) => i === 0 || workspaceNames[i - 1].localeCompare(word) <= 0 + ) + ); + }); +}); + test.describe('Delegate and Alternate Profile', () => { test('1F. Must have access to update delegate profile', async ({ page }) => { const represntativePage = new RepresentativesPage(page);