I am using protractor-sync module with cucumber so that to make the calls synchronously But when I start using the functions of 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.
Error console:
× 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 File
`
Feature: Validation test
@CucumberScenario
Scenario: Validate Google Page
Given Navigate to Google Page
`
Steps File:
`
import { Given } from 'cucumber';
import { browserSync } from 'protractor-sync';
Given('Navigate to Google Page',{ timeout: 120 * 1000 }, ()=> {
browserSync.get("https://www.google.com");
});
protractor 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'
}
};
`
Can we use protractor-sync module along with cucumber ?
I am using protractor-sync module with cucumber so that to make the calls synchronously But when I start using the functions of 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.Error console:
× 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 File
`
Feature: Validation test
@CucumberScenario
Scenario: Validate Google Page
Given Navigate to Google Page
`
Steps File:
`
import { Given } from 'cucumber';
import { browserSync } from 'protractor-sync';
Given('Navigate to Google Page',{ timeout: 120 * 1000 }, ()=> {
browserSync.get("https://www.google.com");
});
protractor conf.jsexports.config = {
allScriptsTimeout: 240000,
specs: [
"./features/*.feature",
],
framework: 'custom',
frameworkPath: require.resolve("protractor-cucumber-framework"),
cucumberOpts: {
strict: true,
compiler: 'ts:ts-node/register'
}
};
`
Can we use protractor-sync module along with cucumber ?