Azure DevOps 发布管道 - Protractor UI 测试套件

时间:2021-03-11 18:09:47

标签: azure azure-devops azure-pipelines

我的任务是处理现有旧应用程序的 Azure DevOps 实施。应用程序有一个使用 500 多个自动化测试用例的 QA 团队。该测试用例是使用 Protractor 开发的。 所有测试用例均使用 JavaScript 开发。

使用现有设置,以下是所采取的步骤: 一种。发布管道将 ASP.NET 应用程序部署到 Azure 应用服务 湾QA 人员手动登录到 VM 并启动量角器测试。

我们可以使用 Azure devOps 管道中的任何任务来测试相同的已部署应用程序吗?

1 个答案:

答案 0 :(得分:0)

<块引用>

我们可以使用 Azure devOps 管道中的任何任务来测试相同的已部署应用程序吗?

要使用 Protractor 运行测试,您可以使用命令行任务和节点工具来运行测试。

如果您想使用Microsoft-hosted agent来运行测试,您需要在运行测试之前安装相应版本的节点工具和量角器包。

这是一个例子:

steps:
- task: NodeTool@0
  displayName: 'Use Node 10.x'
  inputs:
    versionSpec: 10.x

- task: Npm@1
  displayName: 'npm install'
  inputs:
    workingDir: EndToEndTests/EndToEndTests
    verbose: false

- script: 'node $(build.sourcesdirectory)/EndToEndTests/EndToEndTests/node_modules/protractor/bin/webdriver-manager update --versions.chrome=xxxx.x.x.x'
  displayName: 'Command Line Script'

- script: |
   
   npm run e2e  #Run the same script as you are on the VM
  displayName: 'Command Line Script'

更多详细信息,您可以参考this blogthis ticket

另一方面,如果您的测试用例需要更多额外配置,您也可以在 VM 上安装 self-hosted agent

在这种情况下,QA 人员不需要登录 VM。他们可以直接在自托管代理上运行流水线任务(在虚拟机上创建)。这相当于在 VM 上进行测试。

相关问题