有没有一种方法可以只运行标签而无需打开和关闭浏览器?

时间:2019-08-06 19:55:52

标签: webdriver-io webdriver-io-v4

我正在尝试使用tagExpression从各种不同的功能文件中运行特定的方案,但是Webdriver将打开并关闭每种方案的浏览器,直到找到我提供的标签。有没有办法在找到标签之前不打开浏览器?

    // <string[]> (file/dir) require files before executing features
    require: ['./features/step_definitions/*.js'],
    // <boolean> show full backtrace for errors
    backtrace: true,
    // <string[]> ("extension:module")
    // require files with the given EXTENSION after requiring MODULE (repeatable)
    compiler: [],
    dryRun: false, // <boolean> invoke formatters without executing steps
    failFast: true, // <boolean> abort the run on first failure
    // <string[]> (type[:path]) specify the output format,
    // optionally supply PATH to redirect formatter output (repeatable)
    format: ['pretty'],
    colors: true,
    snippets: true,
    source: true, 
    profile: [], 
    strict: true,
    tagExpression: '@testone',
    timeout: 300000, ble this config to treat undefined definitions as warnings.
    ignoreUndefinedDefinitions: false,
  },```

1 个答案:

答案 0 :(得分:0)

为每个功能文件(不适用于方案)创建硒会话(此时将打开和关闭浏览器)。如果某些功能文件没有与标签匹配的场景,则可以避免使用以下两个选项之一来打开它们:excludesuites方法。

请遵循他们的文档。

示例:

//Not required features can be added here such that wdio ignores them  
exclude: [
        './features/**/test.feature'
    ]

OR

//Define suites and pass as part of params
suites:{
        bvt: [
            './features/BVT_Desktop.feature',
            './features/BVT_Mobile.feature',
        ]
    }