-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Store element-screenshot results as artifacts #2226
Conversation
@@ -167,6 +167,7 @@ class Detox { | |||
|
|||
const matchers = matchersRegistry.resolve(this.device, { | |||
invocationManager, | |||
emitter: this._eventEmitter, |
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.
such flexibility, much design 😄
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.
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.
exactly! :doge:
3c89942
to
bed5eda
Compare
@noomorph with |
@d4vidi , we have E2Es for the API itself (look for e2e/2*****screenshots.test.js, don't remember exactly), but since 2019 probably we abandoned snapshot tests for artifacts folder contents. I am looking much much very very forward to rewriting artifacts subsystem and making it much more generic in terms of creating, pulling, and saving the per-test-session and per-single-test artifacts, though after the rewrite we might no longer have the same artifacts outputs, though. 🤔 Why? Because there's a long ongoing story about making all glued for logs, video and Detox Instruments profiler recordings with some rich markers to navigate between nested suites, tests (and hooks), time markers and actors (Node.js processes, devices, apps, etc), need to put some thinking in how it is going to look like at the end of the day. |
docs/APIRef.ActionsOnElement.md
Outdated
@@ -242,12 +242,16 @@ jestExpect(multipleMatchedElements.elements.length).toBe(5); | |||
jestExpect(multipleMatchedElements.elements[0].identifier).toBe('FirstElement'); | |||
``` | |||
|
|||
### `takeScreenshot()` Android Only | |||
### `takeScreenshot(name)` Android Only |
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.
I'd suggest using takeScreenshot([name])
square brackets convention for marking optional args.
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.
np
docs/APIRef.ActionsOnElement.md
Outdated
Take a screenshot of the native view associated with the element in question. Useful for highly-focused visual comparison tests (i.e. comparison between elements rather than of complete screen, with visual "noise"). | ||
Takes a screenshot of the native view associated with the element in question, and schedules putting it to the [artifacts folder](https://github.com/wix/Detox/blob/master/docs/APIRef.Artifacts.md#enabling-artifacts) upon completion of the current test. Useful for highly-focused visual comparison tests (i.e. comparison between elements rather than of [complete screens](https://github.com/wix/Detox/blob/master/docs/APIRef.DeviceObjectAPI.md#devicetakescreenshotname) with "visual noise"). | ||
|
||
`name (optional)` - Name of the final file to store as the image artifact. For example, `my-text-field` would result in a file named `my-text-field.png`. In case the name isn't provided, Detox would self-generate a distinct name, instead (though not a very descriptive one). |
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.
would self-generate a distinct name, instead (though not a very descriptive one).
generates a random alphanumeric name instead.
@d4vidi, I am sorry in advance for piggybacking, but could you also make |
@d4vidi, side thought — do we ignore/noop |
Looks good, overall. |
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.
I dig it.
Pull Request Test Coverage Report for Build 2485
💛 - Coveralls |
Description:
Resolves #2012. Applies the final piece of this puzzle: the administration of artifacts management we have over image-files generated by using this feature.