-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use playwright mocks in Transactions e2e, update e2e tags #406
base: main
Are you sure you want to change the base?
Conversation
await detailsPage.navigate(detailsData.id); | ||
}); | ||
test.beforeEach( | ||
async ({ page, detailsPage, detailsData, detailsMocks }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great.
The only thing i would consider is to move this whole code (which sets page.route
) into fixture.
This way engineers will have full control when they want to override something on the app level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Added listMocksSetup
and detailsMocksSetup
which can be overriden.
An example:
// override list mocks setup
listMocksSetup: async ({ useMocks, page }, use) => await use(() => {
if (useMocks) {
page.route(
'**/accessgroups/users/permissions/summary',
(route) => route.fulfill({ json: JSON.parse(readFileSync('./my-mocks/summary.json','utf-8')) })
);
page.route(
'**/accessgroups/service-agreements/context',
(route) => route.fulfill({ json: JSON.parse(readFileSync('./my-mocks/agreements.json', 'utf-8')) })
);
page.route(
'**/productsummary/context/arrangements**',
(route) => route.fulfill({ json: JSON.parse(readFileSync('./my-mocks/arrangements.json', 'utf-8')) })
);
page.route(
'**/v2/transactions',
(route) => route.fulfill({ json: JSON.parse(readFileSync('./my-mocks/transactions.json', 'utf-8')) })
);
}
}),
Use Playwright mocks in transactions e2e,
Add
useMocks
parameter to bypass mocks data in modelbank/ephemeral tests.Update e2e tags to follow the Guideline https://backbase.atlassian.net/wiki/spaces/GUIL/pages/5259559552/E2E+tests+migration+guidelines