-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update failed test case for 0-5A wallet switching
- Loading branch information
Showing
4 changed files
with
87 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { faker } from '@faker-js/faker'; | ||
import { Page } from '@playwright/test'; | ||
|
||
const customHeader = { 'X-Custom-Header': 'intersect' }; | ||
|
||
export async function deletePoll(page: Page, pollId: number) { | ||
const res = await page.request.post('/api/archivePoll', { | ||
headers: customHeader, | ||
data: { | ||
pollId: pollId, | ||
}, | ||
}); | ||
return res; | ||
} | ||
|
||
export async function createPoll(page: Page) { | ||
const body = { | ||
name: faker.person.firstName(), | ||
hashedText: faker.person.lastName(), | ||
link: faker.internet.url(), | ||
}; | ||
const res = await page.request.post('/api/newPoll', { | ||
headers: { | ||
'X-Custom-Header': 'intersect', | ||
}, | ||
data: body, | ||
}); | ||
return res; | ||
} | ||
|
||
export async function updateUser(page: Page, userId: string = '138') { | ||
const body = { | ||
userId: userId, | ||
name: faker.person.firstName(), | ||
email: faker.person.firstName() + '@gmail.com', | ||
wallet_address: faker.person.lastName(), | ||
}; | ||
const res = await page.request.post('/api/updateUser', { | ||
headers: { | ||
'X-Custom-Header': 'intersect', | ||
}, | ||
data: body, | ||
}); | ||
return res; | ||
} | ||
|
||
export async function updateActiveVoter( | ||
page: Page, | ||
workshopId: string = '63', | ||
activeVoterId: string = '138' | ||
) { | ||
const body = { workshopId: workshopId, activeVoterId: activeVoterId }; | ||
const res = await page.request.post('/api/updateActiveVoter', { | ||
headers: { | ||
'X-Custom-Header': 'intersect', | ||
}, | ||
data: body, | ||
}); | ||
return res; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 13 additions & 74 deletions
87
...ss-control-testing/access-control.spec.ts → ...ess-control-testing/accessControl.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters