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

miniprogram-automator-extension

v0.0.3

Published

An extension library of wechat miniprogram-automator modules

Downloads

9

Readme

WeChat Mini program Automator Extension

Miniprogram Automator extension package is an extended version of the miniprogram-automator package developed by the WeChat mini-program team. The Mini-Program Automator extension is a new approach to find and perform an action on the element. I want to simplify the functionalities so it may help the user write effortless end 2 end test scenarios.

The following functions are exposed on the page level (ExtendedPage) so the user can directly trigger actions on the page without calling page.$('.selector').

  • tap: Tap on the element
  • text: Get the text of the element
  • wxml: Get this inner xml(html)
  • outerWxml: Get outer xml(html)
  • attribute: Get the attribute value of the element
  • trigger: Trigger the element event such as focus, change
  • type: Type in the input element, newly added
  • value: Get the value of the input element
  • style: Get the value of the Sytle attribute
  • waitFor: Wait for specific time
  • waitFor: Wait for the selector to be appeared
  • waitUntil: Wait until specific parameter value not matched
  • waitUntilTextMatch: Wait until specific text not appeared
  • waitUntilAttributeValueMatch: Wait until attribute value match
  • waitUntilWxmlMatch: wait until wxml not match
  • findElementByText: Get the element if specific text matched
  • findByIndex: Get the element by index
  • and all rest of page function

You can refer .d.ts files for more details

How does it work

Miniprogram Automator Extenstion library working pattern is slightly different from Miniprogram Automator. Let's understand this by tapping on the button element

Miniprogram-automator

Find the element by calling page.$('.selector') and then trigger the action of that element.

This is a good approach if you trigger multiple actions on the element

    const automator = require("miniprogram-automator-extension");
    
    (async () => {
        const miniApp = await automator.launch({cliPath: 'path/to/cli', projectPath: 'path/to/project);
        const page = await miniApp.navigateTo('Home');
        
        const btnElement = await page.$('.btn_element");
        await btnElement.tap();

        await miniApp.close();
    })();

Miniprogram-automator-extension

The element selector can be passed directly in the action function. The function execute two actions together

  • Find an element and
  • Trigger the action on the element

This approch is useful when you want to trigger a single action on the element.

    const automator = require("miniprogram-automator-extension");
    const ExtendedPage = require("miniprogram-automator-extension");

    (async () => {
        const miniApp = await automator.launch({cliPath: 'path/to/cli', projectPath: 'path/to/project);
        const extendedPage = new ExtendedPage(await miniApp.navigateTo('Home'));
        
        await extendedPage.tap('.btn_element); 

        await miniApp.close();
    })();

Installation

    $ npm i miniprogram-automator-extension

*Note: This module is in under progress, therefore stay tune for new update