-
Notifications
You must be signed in to change notification settings - Fork 4
fix: merge .percy.yml config options with snapshot options for serializeDOM #223
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
b9758c6
4e94aef
178d599
d2339f9
95b75bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -500,19 +500,23 @@ def percy_snapshot(driver, name, **kwargs): | |
| driver.execute_script(percy_dom_script) | ||
| cookies = driver.get_cookies() | ||
|
|
||
| # Merge .percy.yml config options with snapshot options (snapshot options take priority) | ||
| config_options = data['config'].get('snapshot', {}) | ||
| merged_kwargs = {**config_options, **kwargs} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Medium] Missing tests for the new config-merge behavior No test covers that config-level Suggestion: Add Reviewer: stack:code-review |
||
|
|
||
| # Serialize and capture the DOM | ||
| if is_responsive_snapshot_capture(data['config'], **kwargs): | ||
| if is_responsive_snapshot_capture(data['config'], **merged_kwargs): | ||
| dom_snapshot = capture_responsive_dom( | ||
| driver=driver, | ||
| cookies=cookies, | ||
| config=data['config'], | ||
| percy_dom_script=percy_dom_script, | ||
| **kwargs, | ||
| **merged_kwargs, | ||
| ) | ||
| else: | ||
| dom_snapshot = get_serialized_dom( | ||
| driver, cookies, percy_config=data.get('config'), | ||
| percy_dom_script=percy_dom_script, **kwargs) | ||
| percy_dom_script=percy_dom_script, **merged_kwargs) | ||
|
|
||
| # Strip SDK-local `readiness` from the snapshot POST body. The CLI | ||
| # already has it via healthcheck; sending it again here risks future | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.