feat(playwright): add functionality to fetch paginated content #2780
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.
Hi there!
First of all: thank you for creating this great piece of software, I've been running ChangeDetection smoothly and it's helped me greatly so far!
I ran into the issue where I had to keep track of a store page with pagination. As I couldn't find an option for paginated results in the program yet, I started tinkering around and I came to an implementation! I wanted to propose it, with the hope it would be a useful addition to your program!
Explanation
My code adds a checkbox underneath the
Execute JavaScript before change detection
field. When checked, 2 other fields become visible:If this checkbox is checked, and if the pagination fields have been filled in, it will process the target page in Playwright, but it will target each page in the pagination until it reaches the last page. When it does so it will inject a hidden input into the page, with the extracted content as value, which can then be retrieved inside the filter. For example, this is my setup:
Execute JavaScript before change detection
(Paginated) Execute JavaScript on each page
(Paginated) Next page button selector
CSS/JSONPath/JQ/XPath Filters
Please let me know if you need me to explain or improve something. I hope it can be a valuable contribution to your project!