需要与黄瓜使用量角器同步模块

时间:2019-03-26 09:21:55

标签: protractor cucumber cucumberjs

我正在将protractor-sync模块与黄瓜配合使用,以使调用同步运行 但是当我开始使用量角器同步 browserSync.get(“ https://www.google.com”);

错误

Error: Could not find the current asyncblock flow. Please make sure this method is called from an asyncblock
context.

错误控制台:

× Given Navigate to Google Page # Protractor\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:173
       Error: Could not find the current asyncblock flow. Please make sure this method is called from an asyncblock
context.
           at Object.exec (C:\Cucumber Protractor\node_modules\protractor-sync\dist\exec.js:10:19)
           at BrowserSync.get (C:\Cucumber Protractor\node_modules\protractor-sync\dist\browser-sync.js:34:23)
           at World.<anonymous> (C:\Cucumber Protractor\steps\LoginSteps.ts:12:15)

功能文件

Feature: Validation test

@CucumberScenario
Scenario: Validate Google Page
Given Navigate to Google Page

步骤文件:

import { Given } from 'cucumber';
import { browserSync } from 'protractor-sync';

Given('Navigate to Google Page',{ timeout: 120 * 1000 }, ()=> {

  browserSync.get("https://www.google.com");

});

量角器conf.js

exports.config = {
  allScriptsTimeout: 240000,
  specs: [
    "./features/*.feature",
],
  framework: 'custom',
  frameworkPath: require.resolve("protractor-cucumber-framework"),
  cucumberOpts: {
    strict: true,
    compiler: 'ts:ts-node/register'

}

};

我们可以和黄瓜一起使用量角器同步模块吗 https://github.com/blackboard/protractor-sync

0 个答案:

没有答案