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

fis3-hook-e2e

v0.0.3

Published

fis3 e2e test plugin

Downloads

3

Readme

fis3-hook-e2e

fis3 e2e 测试辅助插件,在指定media下release完毕时自动拉取最新测试case本地启动真机测试。

注意:暂时只支持内网及protractor测试,请先安装protractor本地测试环境。

使用方法

  1. 安装fis3及protractor测试环境

    #安装fis3及插件
    npm install -g fis3
    npm install -g fis3-hook-e2e
    
    #安装并初始化protractor测试环境
    npm install -g protractor
    webdriver-manager update
  2. 添加fis3 hook及protractor运行配置

    fis3 hook 插件配置:

    //vi fis-conf.js
    //e2e测试
    
    fis.hook('e2e', {
        media: 'preview',//指定 preview media触发e2e测试
        //fis ci项目ID,将自动拉取此项目下的测试用例
        project: 'fis_agile_ci',
        protractor: {
            //protractor配置文件相对路径
            configFile: 'test/e2e/protractor_conf.js'
        }
    })

    protractor配置示例:

    //vi test/e2e/protractor_conf.js
    exports.config = {
      framework: 'jasmine',//推荐jasmine测试框架
      seleniumAddress: 'http://localhost:4444/wd/hub',//默认本地webdriver 服务器地址
      specs: ['**/*.spec.js'],//匹配所有 spec.js 后缀的测试用例
      //多浏览器配置
      multiCapabilities: [{
            'browserName': 'chrome'
      },
      {
            'browserName': 'firefox'
      }],
      onPrepare: function() {
          browser.ignoreSynchronization = true;
      }
    }

    protractor配置文件所在目录将复制到fis3临时目录,同时自动下载对应项目的测试case。

  3. 启动webdriver,执行fis3 release启动测试

    webdriver start #启动 webdriver本地服务器,如果是远程服务器则不需要
    fis3 release <media> #执行某个指定media启动e2e测试,如 preview

demo项目

先按照上面步骤一初始化环境。

git clone http://gitlab.baidu.com/zhangtao07/fis3-protractor-demo.git
cd fis3-protractor-demo
webdriver-manager start #启动服务器
fis3 release preview  -r home  #执行release触发e2e测试

测试用例和配置示例在home模块下,执行命令本地就能启动真机检测

说明

e2e测试用例建议放置在指定目录,如项目根目录/test/e2e,注意protractor配置文件的specs配置项要能匹配到当前目录下所有.spec.js后缀的文件。

除了拉取远端自动生成的 case,您也可以自己写case

自动生成测试case的说明

使用chrome插件在浏览页面时自动收集操作步骤,并在CI中添加自定义检测规则,详情参考文档