Skip to content

Commit

Permalink
Fix misplaced requestfailed listener
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed Nov 29, 2024
1 parent f3dd0f9 commit ea8580b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 0 additions & 4 deletions frontend/tests/functional/user-permissions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ Object.entries(userGroups).forEach(([userGroup, userGroupData]) => {
mailer,
page
}) => {
console.log("EXPECTED TEST EXECUTED");
page.on('requestfailed', request => {
console.log(request.url() + ' ' + request.failure().errorText);
});
await usersPage.goto();
await usersPage.editItemButton(vars.user.email).click();
await usersPage.form.fill({
Expand Down
9 changes: 8 additions & 1 deletion frontend/tests/utils/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,14 @@ export const test = base.extend<Fixtures>({

data: { ...testData },

populateDatabase: async ({ pages, loginPage, sideBar, data }, use) => {
populateDatabase: async ({ pages, loginPage, sideBar, data, browser }, use) => {
test.slow();

const context = await browser.newContext();
context.on('requestfailed', request => {
console.log('[REQUEST_FAILED] ' + request.url() + ' ' + request.failure().errorText);
});

const start = new Date();
await new Promise((resolve) => setTimeout(resolve, 3000));
const end = new Date();
Expand All @@ -290,6 +296,7 @@ export const test = base.extend<Fixtures>({
'dependency' in pageData ? pageData.dependency : null
);
}
await context.close();
await sideBar.logout();
await use();
}
Expand Down

0 comments on commit ea8580b

Please sign in to comment.