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

appium-reporter-plugin

v1.1.0-beta.6

Published

Appium 2.0 plugin for generating html report with screenshots server side.

Downloads

436

Readme

appium-reporter-plugin

example workflow

Intro

appium-reporter-plugin is appium 2.0 plugin, for generating simple html report with screenshots. Consolidated Report is generated for all the test that ran in the appium session. Report can be fetched from server and be written to file (just like screenshots).

When to use

appium-reporter-plugin would be handly, if you need to

  • Take screenshot at every step of your test (not just at test failure / end)
  • Generate a simple standalone html report with screenshots

Sample Report Demo

https://user-images.githubusercontent.com/2680841/183408319-cf7a550d-2b74-4732-8a13-e80c57524467.mov

How to use

To install plugin

appium plugin install --source=npm appium-reporter-plugin

Start appium server with plugin

appium --use-plugins=appium-reporter-plugin

Sample implementation can be found @

  1. JS Implementation -> https://github.com/AppiumTestDistribution/appium-reporter-plugin/tree/main/examples/js/AppiumReportPluginDemo
  2. Java Implementation -> https://github.com/AppiumTestDistribution/appium-reporter-plugin/tree/main/examples/java/AppiumReportPluginDemo

Mappings / Commands

appium-reporter-plugin assumes every test/spec uses new driver session. For commands invoked on the driver session, screenshot and metrics are captured at server side. At the end of the test i.e., before deleting the driver session, /setTestInfo should be called to map test information. After all the tests are completed /getReport can be called to fetch the html report and written to file. To clear the test info stored on the server, /deleteReportData can be used.

setTestInfo

For mapping test information to data collected, server binding POST: /setTestInfo is exposed. This binding accepts JSON payload with keys as mentioned below

| key | Description | Type | Accepted Values | | ----------- | ----------- | ---- | --------------- | | sessionId | driver's sessionId | Mandatory | driver's sessionId or null if session is not created (pendig test) | | testName | Name of the test | Mandatory | any string | | testStatus | Test execution status | Mandatory | PASSED, FAILED, PENDING, All other string considered as unknown | | error | Reason for test Failure | Optinal | any string |

ex:

    {sessionId: 'asdas-asdasd-asdasda-asdasdasd', testName: 'Sum of 1 and 2 should be 3', testStatus: 'PASSED'}
    {sessionId: 'asdas-asdasd-asdasda-asdasdasd', testName: 'Sum of 1 and 2 should be 4', testStatus: 'FAILED', error: 'Sum of 1 and 2 is 3'}
    {sessionId: null, testName: 'Sum of 1 and 2 should be 3', testStatus: 'PENDING'}

getReport

After execution of all the tests, report can be downloaded from server using GET: /getReport. getReport returns a html report with screenshots as a string.

deleteReportData

screenshots and test information is stored on server and this occupies space. To clear the space and delete all the test infomation on server DELETE: /deleteReportData can be used.

-- demo.spec.js has working example and we recommamd checking the implementation.

Note:

  1. appium-reporter-plugin doesn't gather test results data from any unit test framework.
  2. Bindings exposed by this plugin are not default W3C binding, hence these commands can't be drirecly called on driver object. Either wdio setCommand should be used or direct api call can be made.

Build

npm run build

Install from code base

1. set APPIUM_HOME to a local directory and install drivers needed
 export APPIUM_HOME=~/Documents/AppiumTestDistribution/appium-reporter-plugin/local_appium_home

2. npm run install-plugin

Re-Install from code base

npm run reinstall-plugin

Start appium server with plugin

appium --use-plugins=appium-reporter-plugin

Run tests

npm run test

Note : If you are overriding APPIIM_HOME make sure drivers are installed

appium driver install xcuitest
appium driver install uiautomator2

ToDo

  • explore event timing apis
  • Add details such as - sessionId overall timing of test number of android and ios
  • expose the exclusion command list
  • expose screenshot resize params as arguments
  • githooks for lint and pretty