npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hermione-safari-commands

v2.1.0

Published

Plugin for hermione to add/wrap browser commands for iOS safari

Downloads

11

Readme

hermione-safari-commands

NPM version Build Status

Plugin for hermione which is intended to add/wrap browser commands in order to work properly with the iOS safari browser.

You can read more about hermione plugins here.

Installation

npm install hermione-safari-commands

Usage

Plugin has following configuration:

  • enabled (optional) Boolean – enable/disable the plugin, by default plugin is enabled;
  • browsers (required) Object - the list of browsers to use for wrap commands;
    • commands (required) Array - commands which will be wrapped.
    • nativeElementsSize (optional) Object - the map of native elements sizes for the browser. Sizes in pixels without counting the pixel ratio. Can be used in order to speed up taking screenshots;
      • topToolbar (required) Object - the size of the top toolbar;
        • width (required) Number - the width of the top toolbar;
        • height (required) Number - the height of the top toolbar;
      • bottomToolbar (required) Object - the size of the bottom toolbar;
        • width (required) Number - the width of the bottom toolbar;
        • height (required) Number - the height of the bottom toolbar;
      • webview (required) Object - the size of the webview;
        • width (required) Number - the width of the webview;
        • height (required) Number - the height of the webview;

Also there is ability to override plugin parameters by CLI options or environment variables (see configparser). Use hermione_safari_commands_ prefix for the environment variables and --hermione-safari-commands- for the cli options.

Add plugin to your hermione config file:

module.exports = {
    // ...
    system: {
        plugins: {
            'hermione-safari-commands': {
                enabled: true,
                browsers: {
                    safari13: {
                        commands: [
                            'url',
                            'click',
                            'screenshot',
                            'orientation',
                            'swipe',
                            'touch',
                            'dragAndDrop'
                        ],
                        nativeElementsSize: {
                            topToolbar: {
                                height: 47,
                                width: 390
                            },
                            bottomToolbar: {
                                height: 113,
                                width: 390
                            },
                            webview: {
                                height: 654,
                                width: 390
                            }
                        }
                    }
                }
            }
        }
    },
    //...
}

Existing safari commands:

Wrappers over existing commands:

  • url - wrapper over wdio "url" in order to wait until the page is completely open (used timeout from hermione.pageLoadTimeout or 30000 ms). In appium-xcuitest-driver page is open with using the xcrun utility - xcrun simctl openurl which just tells the simulator to open the page and does not wait anything;
  • click - replaces wdio "click" in order to perform real touch click (by default it emits only events on passed element). Should be used with touch command;
  • screenshot - wrapper of wdio "screenshot" in order to cut the native elements from the final image (calibration must be turned off);
  • orientation - wrapper of wdio "orientation" in order to recalculate size of native elements for "screenshot" command (turns on automatically when you specify a screenshot command);
  • swipe - replaces wdio "swipe" in order to perform swipe by coordinates in native context;
  • touch - replaces wdio "touch" in order to perform touch click by coordinates in native context;
  • dragAndDrop - replaces wdio "dragAndDrop" in order to perform drag and drop elements by coordinates in native context.

Commands to work with native elements:

  • deviceClickBack - command to click back button on device, which closes the current tab and returns to the previous one.

Testing

Run mocha tests:

npm run test-unit

Run eslint codestyle verification

npm run lint