cypress-tags 和 cypress 运行都无法仅执行 cypress-cucumber 框架中的标记测试用例

问题描述 投票:0回答:1

我尝试使用 cypress-tags 和 cypress run 命令来执行标记的测试用例,但都失败了。有人可以指导解决方案吗?

依赖版本: "@badeball/cypress-cucumber-preprocessor": "^21.0.3", "@bahmutov/cypress-esbuild-preprocessor": "^2.2.3", "柏树": "^13.16.0", "cypress-cucumber-preprocessor": "^4.3.1", "cypress-on-fix": "^1.0.3", “cypress-xray-plugin”:“^7.4.1”

我已在 package.json 中包含了 filterspec 和 omitfilter : “柏树黄瓜预处理器”:{ “过滤器规格”:true, “省略过滤”:真, “nonGlobalStepdefinitions”:假, “步骤定义”:[ “赛普拉斯/e2e/Stepdefinitions/**/*。{js,ts}” ],

我还集成了 cypress-xray 插件,将执行结果上传到 Jira 云。

我有 2 个功能文件: 登录功能: 特点:黄瓜测试仪

@smoke
@TEST_CYP-4 @TESTSET_CYP-9
Scenario: cucumber trial test case
    Given user is on example website
    And user passes valid credentials
    Then user login is successful

@smoke  
@TEST_CYP-10 @TESTSET_CYP-9
Scenario: cucumber test case 2
    Given user is on example website
    And user passes valid credentials
    Then user login is successful
    
@TEST_CYP-11 @TESTSET_CYP-9
Scenario: cucumber test case 3
    Given user is on example website
    And user passes valid credentials
    Then user login is successful

添加客户.功能: 特点:黄瓜测试集2

@TEST_CYP-16 @TESTSET_CYP-15
Scenario: cucumber test case 1 - test set 2
    Given user is on example website
    And user passes valid credentials
    Then user login is successful
    
@TEST_CYP-17 @TESTSET_CYP-15
Scenario: cucumber test case 2 - test set 2
    Given user is on example website
    And user passes valid credentials
    Then user login is successful

用于执行的命令: npx cypress run --record --key --browser chrome --spec cypress/e2e/features/regression --env JIRA_USERNAME=,JIRA_API_TOKEN=,XRAY_CLIENT_ID=,XRAY_CLIENT_SECRET= 标签=“@smoke”

cypress 不是只运行 @smoke 标签提到的 2 个场景,而是执行两个功能文件中的所有场景。

tags cypress cypress-cucumber-preprocessor
1个回答
0
投票

有一点是错误的,那就是你有

"@badeball/cypress-cucumber-preprocessor": "^21.0.3", 
...
"cypress-cucumber-preprocessor": "^4.3.1",

摆脱旧的已失效的 v4.3.2,因为它可能会导致各处出现问题。还要确保它已从

cypress.config.js
消失。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.