
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Percy visual testing for Ruby Appium.
npm install @percy/cli
:
$ npm install --save-dev @percy/cli
gem install Percy appium package:
$ gem install percy-appium-app
This is an example test using the percy_screenshot
function.
require 'appium_lib'
require 'percy-appium-app'
username = '<BROWSERSTACK_USERNAME>'
access_key = '<ACCESS_KEY>'
capabilities = {
'platformName' => 'android',
'platformVersion' => '13.0',
'deviceName' => 'Google Pixel 7',
'bstack:options' => {
'appiumVersion' => '2.0.1'
},
'app' => '<APP LINK>',
'appium:percyOptions' => {
# enabled is default True. This can be used to disable visual testing for certain capabilities
'enabled' => true
}
}
appium_driver = Appium::Driver.new(
{
'caps' => capabilities,
'appium_lib' => {
server_url: "https://#{username}:#{access_key}@hub-cloud.browserstack.com/wd/hub"
}
}, true
)
driver = appium_driver.start_driver
# take a screenshot
percy_screenshot(driver, 'here is some name')
Running the test above normally will result in the following log:
[percy] Percy is not running, disabling screenshots
When running with percy app:exec
, and your project's
PERCY_TOKEN
, a new Percy build will be created and screenshots will be uploaded to your project.
$ export PERCY_TOKEN=[your-project-token]
$ percy app:exec -- [ruby test command]
[percy] Percy has started!
[percy] Created build #1: https://percy.io/[your-project]
[percy] Screenshot taken "Ruby example"
[percy] Stopping percy...
[percy] Finalized build #1: https://percy.io/[your-project]
[percy] Done!
percy_screenshot(driver, name[, **kwargs])
driver
(required) - A appium driver instancename
(required) - The screenshot name; must be unique to each screenshotdevice_name
(optional) - The device name used for capturing screenshotorientation
(optional) - Orientation of device while capturing screeenshot; Allowed values [portrait
| landscape
]status_bar_height
(optional) - Height of status bar; intnav_bar_height
(optional) - Height of navigation bar; intfullpage
(optional) - [Alpha] Only supported on App Automate driver sessions [ needs @percy/cli 1.20.2+ ]; boolean
screen_lengths
(optional) - [Alpha] Max screen lengths for fullPage; inttop_scrollview_offset
: (optional) - [Alpha] Offset from top of scrollview; intbottom_scrollview_offset
(optional) - [Alpha] Offset from bottom of scrollview; intfull_screen
(optional) - Indicate whether app is full screen; boolean [ needs @percy/cli 1.20.2+ ];sync
(optional) - Waits for screenshot to be processed and gives the processed result of screenshot [needs @percy/cli v1.28.0-beta.0+]; booleanscrollable_xpath
(optional) - [Alpha] Scrollable element xpath for fullpage [ needs @percy/cli 1.20.2+ ]; stringscrollable_id
(optional) - [Alpha] Scrollable element accessibility id for fullpage [ needs @percy/cli 1.20.2+ ]; stringignore_regions_xpaths
(optional) - Elements xpaths that user want to ignore in visual diff [ needs @percy/cli 1.23.0+ ]; list of stringignore_region_accessibility_ids
(optional) - Elements accessibility_ids that user want to ignore in visual diff [ needs @percy/cli 1.23.0+ ]; list of stringignore_region_appium_elements
(optional) - Appium elements that user want to ignore in visual diff [ needs @percy/cli 1.23.0+ ]; list of appium element objectcustom_ignore_regions
(optional) - Custom locations that user want to ignore in visual diff [ needs @percy/cli 1.23.0+ ]; list of ignore_region object
init(self, top, bottom, left, right)
top
(int): Top coordinate of the ignore region.bottom
(int): Bottom coordinate of the ignore region.left
(int): Left coordinate of the ignore region.right
(int): Right coordinate of the ignore region.For a hybrid app, we need to switch to native context before taking screenshot.
def percy_screenshot_flutter(driver, name: str, **kwargs):
driver.switch_to.context('NATIVE_APP')
percy_screenshot(driver, name, **kwargs)
driver.switch_to.context('FLUTTER')
end
percy_screenshot_flutter(driver, name, **kwargs)
Note:
For other hybrid apps the
driver.switch_to.context('FLUTTER')
would change to context that it uses like say WEBVIEW etc.
percy_screenshot(driver, name, options)
[ needs @percy/cli 1.27.0-beta.0+ ];
driver
(required) - A appium driver instancename
(required) - The screenshot name; must be unique to each screenshotoptions
(optional) - There are various options supported by percy_screenshot to server further functionality.
sync
- Boolean value by default it falls back to false
, Gives the processed result around screenshot [From CLI v1.28.0-beta.0+].freeze_animated_image
- Boolean value by default it falls back to false
, you can pass true
and percy will freeze image based animations.freeze_image_by_selectors
-List of selectors. Images will be freezed which are passed using selectors. For this to work freeze_animated_image
must be set to true.freeze_image_by_xpaths
- List of xpaths. Images will be freezed which are passed using xpaths. For this to work freeze_animated_image
must be set to true.percy_css
- Custom CSS to be added to DOM before the screenshot being taken. Note: This gets removed once the screenshot is taken.ignore_region_xpaths
- List of xpaths. elements in the DOM can be ignored using xpathignore_region_selectors
- List of selectors. elements in the DOM can be ignored using selectors.ignore_region_appium_elements
- List of appium web-element. elements can be ignored using appium_elements.custom_ignore_regions
- List of custom objects. elements can be ignored using custom boundaries. Just passing a simple object for it like below.
{"top": 10, "right": 10, "bottom": 120, "left": 10}
top
(int): Top coordinate of the ignore region.bottom
(int): Bottom coordinate of the ignore region.left
(int): Left coordinate of the ignore region.right
(int): Right coordinate of the ignore region.consider_region_xpaths
- List of xpaths. elements in the DOM can be considered for diffing and will be ignored by Intelli Ignore using xpaths.consider_region_selectors
- List of selectors. elements in the DOM can be considered for diffing and will be ignored by Intelli Ignore using selectors.consider_region_appium_elements
- List of appium web-element. elements can be considered for diffing and will be ignored by Intelli Ignore using appium_elements.custom_consider_regions
- List of custom objects. elements can be considered for diffing and will be ignored by Intelli Ignore using custom boundaries
{"top": 10, "right": 10, "bottom": 120, "left": 10}
top
(int): Top coordinate of the consider region.bottom
(int): Bottom coordinate of the consider region.left
(int): Left coordinate of the consider region.right
(int): Right coordinate of the consider region.Note: Automate Percy Token starts with auto
keyword. The command can be triggered using exec
keyword.
$ export PERCY_TOKEN=[your-project-token]
$ percy exec -- [ruby test command]
[percy] Percy has started!
[percy] [Ruby example] : Starting automate screenshot ...
[percy] Screenshot taken "Ruby example"
[percy] Stopping percy...
[percy] Finalized build #1: https://percy.io/[your-project]
[percy] Done!
Refer to docs here: Percy on Automate
If you have a previous Percy configuration file, migrate it to the newest version with the
config:migrate
command:
$ percy config:migrate
FAQs
Unknown package
We found that percy-appium-app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.