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

wdio-test-results-service

v0.0.2

Published

WebdriverIO service that sends test results to a GraphQL API

Downloads

3

Readme

WebdriverIO Test Results Service

WebdriverIO service that allows you to store test results to an external GraphQL server. Supports Mocha and Jasmine.

This will store results based on an entire spec file run.

This service is still a work in progress.

Requires that there is a GraphQL back-end setup with the mutations below.

Install

npm install --save-dev wdio-test-results-service

Todo

  • Add authentication

Recomended fields for back-end

Test Run

| Field | Type | Description | | ------------|-------------|----------------------------------------| | run_key | String | Identifier of the overall test run | | issue_key | String | Jira issue, Jenkins job, etc. | | suites | String | WebdriverIO suites that were ran | | version | String | Version of code the tests ran against | | passed | Int | Overall test run passed | | failed | Int | Overall test run failed | | start | Timestamp | Run start time | | end | Timestamp | Run end time |

Test Run Result

| Field | Type | Description | | --------------|----------|-----------------------------------------------------| | test_run_id | Int | Id of the current test run | | spec_id | String | File name of the test | | suite_title | String | Name of the first describe block in the test file | | duration | Int | How long it took the test to complete in seconds | | passed | Int | Test passed or not | | failed | Int | Test failed or not | | skipped | Int | Test skipped or not | | retries | Int | Number of retries done |

Enviroment variables

These can be set when running WebdriverIO and the data will be sent to the GraphQL endpoint

| Variable | | Description | | -------------------|----------|----------------------------------------------------------------------------------------------| | GRAPHQL_ENDPOINT | required | The endpoint to your GraphQL server | | TEST_RUN_TITLE | optional | The title of the overall test run. If not specified it will default to the current timestamp | | CODE_VERSION | optional | The version of the code that your tests are running against | | ISSUE_KEY | optional | Jira issue, Jenkins job, etc. |

Mutations

type Mutation {
	testRunCreate(run_key: String, version: String, issue_key: String, suites: String) : TestRun,
	testRunComplete(id: Int) : TestRun,
	testResultAdd(test_run_id: Int, spec_id: String, suite_title: String, passed: Int, failed: Int, skipped: Int, duration: Int) : TestResult,
}

testRunCreate

| Field | Type | Description | | ------------|-------------|----------------------------------------| | run_key | String | Identifier of the overall test run | | version | String | Version of code the tests ran against | | issue_key | String | Jira issue, Jenkins job, etc. | | suites | String | WebdriverIO suites that were ran |

testRunComplete

| Field | Type | Description | | --------|-------|--------------------------------| | id | Int | Id returned from testRunCreate |

testResultAdd

| Field | Type | Description | | --------------|----------|-----------------------------------------------------| | test_run_id | Int | Id of the current test run | | spec_id | String | File name of the test | | suite_title | String | Name of the first describe block in the test file | | passed | Int | Test passed or not | | failed | Int | Test failed or not | | skipped | Int | Test skipped or not | | duration | Int | How long it took the test to complete in seconds |

Types

TestRun

type TestRun {
	id        : Int,
	run_key   : String,
	issue_key : String,
	suites    : String,
	passed    : Int,
	failed    : Int,
	duration  : Int,
	start     : String,
	end       : String,
	version   : String,
}

TestResult

type TestResult {
	id                 : Int,
	test_run_id        : Int,
	spec_id            : String,
	suite_title        : String,
	passed             : Int,
	failed             : Int,
	skipped            : Int,
	duration           : Int,
}