@gmangiapelo/wdio-azure-devops-service

中文文档
0.1.0发布于 2025/04/11MITTypeScriptESM + CJS近 30 天下载 2.9万

Wdio Service to inject result of automatic test run in Azure DevOps TestPlan

原始使用文档
文档目录14 节
  1. Installation
  2. Usage
  3. Configuration
  4. Test case setup
  5. Azure DevOps Report Example
  6. Service Options
  7. pat
  8. organizationUrl
  9. projectId
  10. planId
  11. suiteId
  12. runName
  13. caseIdRegex
  14. Author

WDIO Azure Devops Service

version downloads

Publishes WebdriverIO results on Azure DevOps Test Plans.

Core features:

  • Support for Jasmine/Jest/Mocha and Cucumber runtime frameworks
  • Test results are aggregated under the same test run if you are executing more spec(test) files and they are belongs to the same suite
  • Results are reported immediately after single test execution (real-time reporting)
  • Test run is closed after last spec(test) file has been finished
  • Multi suite support

Installation

Install this module locally with the following command to be used as a (dev-)dependency:

npm install --save @gmangiapelo/wdio-azure-devops-service
npm install --save-dev @gmangiapelo/wdio-azure-devops-service

Instructions on how to install WebdriverIO can be found here.

Usage

wdio-azure-devops-service supports NodeJS 8 or higher

wdio-azure-devops-service supports commonjs and esm

Configuration

Since @gmangiapelo/wdio-azure-devops-service is a service, you can set it up in your wdio.conf.js file as follows

import AzureDevopsService from "@gmangiapelo/wdio-azure-devops-service";
// wdio.conf.js
exports.config = {
    // ...
    // =====
    // Setup
    // =====
    services: [
        [
              AzureDevopsService,
              {
                  pat: '3qaPw0PnOyQ6mb8gwN7n9aIQtccn8FtsZ2s1tSIzo6yAt6eK9BInJQGJ99BDACAAAAAu9TDCAAASAZDO2Onn',
                  organizationUrl: 'https://dev.azure.com/gianlucamangiapelo',
                  projectId: '8b3c68ac-f69d-41c6-bbad-921d8bae9819',
                  planId: 263072,
                  suiteId: 263073,
                  caseIdRegex: '@?[ref](\\d+)',
                  runName: 'FE regression tests for TestPlan',
              },
          ],
    ],
    // ...
};

Test case setup

Your WDIO tests should include the ID of your Azure test case. Make sure your test case IDs are distinct from your test titles:

Mocha style:

// Good:
it("C123 Can authenticate a valid user", ...

// Bad:
it("C123Can authenticate a valid user", ...
it("Can authenticate a valid user C123", ...

Cucumber style:

## Good:
@C123
Scenario Can authenticate a valid user
@c123
Scenario Can authenticate a valid user,

## Bad:
@c123stringTest
Scenario Can authenticate a valid user

Azure DevOps Report Example

This is an example of the results pushed on AZ Test Plans, during a test run AzureDevops Test Plans example


Service Options

pat

The Personal Access token generated in Azure DevOps with API permission set.

Example: "3qaPw0PnOyQ6mb8gwN7n9aIQtccn8FtsZ2s1tSIzo6yAt6eK9BInJQGJ99BDACAAAAAu9TDCAAASAZDO2Onn"

Type: string

Required: true

organizationUrl

The base url of your Azure DevOps instance.

Example: "https://dev.azure.com/gianlucamangiapelo"

Type: string

Required: true

projectId

The id of the project in Azure DevOps.

To find the projectId use GET {organizationUrl}/_apis/projects?api-version=6.0 and copy the appropriate id.

Example: "3cf7dbc9-cb1e-4240-93f2-9a5960ab3945"

Type: string

Required: true

planId

The test plainId that you can retrieve in Azure DevOps Test Plan section.

Example: 124

Type: integer

Required: true

suiteId

The suiteId that you can retrieve in Azure DevOps Test Plan section, in case of nested suites, get the root suiteId, the service iterates over all the child suites.

Example: 21

Type: integer

Required: true

runName

A descriptive name for the test run.

Example: "FE regression tests run"

Type: string

Required: true

caseIdRegex

Custom regular expression to match the testCaseId from tag or title test case.

Type: string

Default: "@?[cC](\d+)"

Required: false

Author

Gianluca Mangiapelo - github

版本与发布记录

@gmangiapelo/wdio-azure-devops-service 共发布 10 个版本,首次发布于 2022/05/23;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.0latest2025/04/111.6 年前
0.0.112023/03/173 年前
0.0.92023/03/173 年前
0.0.82022/06/084 年前
0.0.62022/06/074 年前
0.0.52022/06/074 年前

关于 @gmangiapelo/wdio-azure-devops-service 的常见问题

@gmangiapelo/wdio-azure-devops-service 是什么?

Wdio Service to inject result of automatic test run in Azure DevOps TestPlan

如何安装 @gmangiapelo/wdio-azure-devops-service?

在项目目录运行 npm install @gmangiapelo/wdio-azure-devops-service,或使用 pnpm add / yarn add / bun add。

@gmangiapelo/wdio-azure-devops-service 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gmangiapelo/wdio-azure-devops-service 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gmangiapelo/wdio-azure-devops-service 可以商用吗?

@gmangiapelo/wdio-azure-devops-service 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gmangiapelo/wdio-azure-devops-service 的下载量有多少?

根据 npm 官方下载统计,@gmangiapelo/wdio-azure-devops-service 在 2026/10/17 – 2026/11/15 这 30 天内被下载 29,414 次,日均约 980 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gmangiapelo/wdio-azure-devops-service 还在维护吗?

最新版本 0.1.0 发布于 2025/04/11(1.6 年前);至今共发布 10 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/05/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。