在Azure DevOps Pipeline中运行Playwright测试

t30tvxxf  于 2023-08-07  发布在  其他
关注(0)|答案(1)|浏览(124)

我正在使用Playwright进行验收驱动测试。我正在使用“安装”一节中列出的步骤在本地设置它并运行剧作家测试。我现在想在Azure DevOps管道中运行测试。如何将这些steps转换为管道中的适当任务?

hjzp0vay

hjzp0vay1#

我能够安装和运行使用以下步骤-

- task: DotNetCoreCLI@2
        displayName: 'Build the E2E Test Application'
        inputs:
          command: build
          projects: $(workingDirectory)/MyProject.sln

      - task: CmdLine@2
        displayName: 'Install Browsers for Playwright'
        inputs:
          script: pwsh $(workingDirectory)/bin/Debug/net6.0/playwright.ps1 install

      - task: DotNetCoreCLI@2
        displayName: 'Run E2E Test'
        inputs:
          command: test
          projects: $(workingDirectory)/MyProject.sln
          arguments: '--filter "Category=MyFilteredTest"'
        env:
          MyEnvVar: $(myEnvVar)

字符串

相关问题