-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to use protractor-sync module with cucumber #82
Comments
Hi, The error you're receiving isn't related to the use of cucumber. Rather, you'll need to call protractor-sync methods within an asyncblock flow. Be sure to import asyncblock at the top:
Then you'll need to create an asyncblock flow and put your code inside it. The example in our readme shows a somewhat more complex way of doing this (note that
|
Hi @mindywhitsitt , As per your inputs, I have used async block as follows in the code
Getting following error
let me know for any information |
Hm. It appears that I'd also be interested to know whether it really does go to the URL as expected, as that might help us narrow down the problem. |
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 ?
The text was updated successfully, but these errors were encountered: