Skip to content

Not able to use protractor-sync module with cucumber #82

@Vardhan18

Description

@Vardhan18

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions