-
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
Open
telmanagababov
wants to merge
5
commits into
main
Choose a base branch
from
feature/e2e-playwright-mocks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+106
−30
Open
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b6b0e8a
Use playwright mocks in Transactions e2e
telmanagababov a6f9e7a
Update e2e data, set useMocks=true
telmanagababov a43de47
Update e2e tags, remove unused "webserver" configuration
telmanagababov a572344
Align mock tags
telmanagababov 839f1ce
Add e2e setup properties to fixture
telmanagababov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { readFileSync } from 'node:fs'; | ||
|
||
const accessControlMocks = { | ||
success: { | ||
'**/accessgroups/users/permissions/summary': JSON.parse( | ||
readFileSync( | ||
'./mock-server/mocks/golden-sample-app/accessgroups/users_permission_summary.json', | ||
'utf-8' | ||
) | ||
).responses.ok.data, | ||
'**/accessgroups/service-agreements/context': JSON.parse( | ||
readFileSync( | ||
'./mock-server/mocks/golden-sample-app/accessgroups/user-context_service-agreements.json', | ||
'utf-8' | ||
) | ||
).responses.ok.data, | ||
}, | ||
}; | ||
const arrangementsMocks = { | ||
success: { | ||
'**/productsummary/context/arrangements**': JSON.parse( | ||
readFileSync( | ||
'./mock-server/mocks/golden-sample-app/productsummary/context_arrangements.json', | ||
'utf-8' | ||
) | ||
).responses.ok.data, | ||
}, | ||
}; | ||
const transactionsMocks = { | ||
success: { | ||
'**/v2/transactions': JSON.parse( | ||
readFileSync( | ||
'./mock-server/mocks/golden-sample-app/transactions/transactions.json', | ||
'utf-8' | ||
) | ||
).responses.ok.data, | ||
}, | ||
}; | ||
|
||
export const defaultListMocks = { | ||
...accessControlMocks.success, | ||
...arrangementsMocks.success, | ||
...transactionsMocks.success, | ||
}; | ||
|
||
export const defaultDetailsMocks = { | ||
...accessControlMocks.success, | ||
...arrangementsMocks.success, | ||
...transactionsMocks.success, | ||
}; |
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
anddetailsMocksSetup
which can be overriden.An example: