diff --git a/integration_test/lib/pages/representativesPage.ts b/integration_test/lib/pages/representativesPage.ts index 25a7beb..50b9649 100644 --- a/integration_test/lib/pages/representativesPage.ts +++ b/integration_test/lib/pages/representativesPage.ts @@ -2,18 +2,6 @@ import { Page, expect } from '@playwright/test'; const representativeUpdatedToast = 'User info updated!'; export default class RepresentativesPage { - readonly updateDelegateBtn = this.page.getByTestId( - 'edit-representative-info-2' - ); - readonly saveDelegateInfoBtn = this.page.getByTestId( - 'save-representative-info-2' - ); - readonly updateAlternateBtn = this.page.getByTestId( - 'edit-representative-info-3' - ); - readonly saveAlternateBtn = this.page.getByTestId( - 'save-representative-info-3' - ); readonly transferVotingPowerBtn = this.page.getByTestId( 'edit-active-voter-1' ); @@ -32,23 +20,25 @@ export default class RepresentativesPage { email: string, stake_address: string ): Promise { - // await this.goto(); - // await this.page - // .locator('[data-testid^="edit-representative-info-"]') - // .first() - // .click(); - // await this.page.getByRole('textbox').nth(0).fill(name); - // await this.page.getByRole('textbox').nth(1).fill(email); - // await this.page - // .locator('[data-testid^="save-representative-info-"]') - // .first() - // .click(); await this.goto(); - await this.updateDelegateBtn.click(); - await this.page.getByRole('textbox').nth(0).fill(name); + await this.page + .getByRole('row') + .filter({ + has: this.page.getByRole('gridcell', { + name: 'Editable TestUser', + }), + }) + .locator('[data-testid^="edit-representative-info-"]') + .click(); + await this.page + .getByRole('textbox') + .nth(0) + .fill('Editable TestUser' + name); await this.page.getByRole('textbox').nth(1).fill(email); await this.page.getByRole('textbox').nth(2).fill(stake_address); - await this.saveDelegateInfoBtn.click({ force: true }); + await this.page + .locator('[data-testid^="save-representative-info-"]') + .click({ force: true }); } async isRepresentativeUpdated(infos: Array): Promise { diff --git a/integration_test/tests/1-convention-organizers/conventionOrganizer.spec.ts b/integration_test/tests/1-convention-organizers/conventionOrganizer.spec.ts index 9ff8d07..e7151c1 100644 --- a/integration_test/tests/1-convention-organizers/conventionOrganizer.spec.ts +++ b/integration_test/tests/1-convention-organizers/conventionOrganizer.spec.ts @@ -224,13 +224,13 @@ test.describe('User Control', () => { page, pollId, }) => { - const name = faker.person.fullName(); + const name = faker.person.lastName(); const email = name.split(' ')[0] + '@email.com'; const stake_address = faker.person.jobArea(); const represntativePage = new RepresentativesPage(page); await represntativePage.updateUserProfile(name, email, stake_address); await represntativePage.isRepresentativeUpdated([ - name, + 'Editable TestUser' + name, email, stake_address, ]); diff --git a/prisma/seed.ts b/prisma/seed.ts index 1557bc4..c385b5c 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -130,6 +130,16 @@ const users = [ wallet_address: 'stake_test1uz8nudr07gyltqapgzvx9avyxcwp3cxnnlmgfd35px5jfgcq2hezv', }, + { + is_convention_organizer: false, + is_delegate: false, + is_alternate: true, + workshop_id: BigInt(6), + name: 'Editable TestUser', + email: 'editabletest@integration.test', + wallet_address: + 'stake_test1uz8nudr07gyltqapgzvx9avyxcwp3cxnnlmgfd35px8jfgcq2hezp', + }, ]; const workshopInfo = [