Hiding webview elements from video
TestFairy allows the developer to hide specific HTML elements from the recorded video in any
WKWebView within their application. As the developer, you may choose to hide one or more elements from the video for security and privacy reasons.
For example, you might want to remove all information related to credit card data from appearing in the session.
To hide an element from video, all you need to do is call the static instance method
hideWebViewElements in the
TestFairy class passing in a CSS selector to target your element:
[TestFairy hideWebViewElements:@".col-12,h1 .header"];
TestFairy will find any
WKWebView in the view hierarchy, and hide a given HTML element based on a valid CSS selector.
Below is a sample screen taken from a demo video. On the left, this is how the app looks like normally. On the right is a screenshot taken with the HTML elements hidden.
- Elements are hidden from screenshots before they are uploaded.
- You may use
hideWebViewElementswith multiple comma separated selectors.
- You may add more selectors at any time by calling