-1

i am trying to work with protractor-cucumber framework and when i executing the script.. even though the script is fine still script is failing and it is not giving the failure reason or exception

Same thing is working fine with Jasmine but when it comes to protractor-cucumber it is working like this

My Config File

exports.config = {

//seleniumAddress: 'http://localhost:4444/wd/hub',
getPageTimeout: 60000,
allScriptsTimeout: 500000,
directConnect:true,

framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('C:\\...\\node_modules\\protractor-cucumber-framework'),
capabilities: {
    'browserName': 'chrome'
},
ignoreUncaughtExceptions:true,
// Spec patterns are relative to this directory.
specs: [
    './learnFramework/utility/test.feature'
],

cucumberOpts: {
    require: './learnFramework/TestCases/spec.js',
    tags: false,
    profile: false,
    'no-source': true
},
 onPrepare: function () {
browser.ignoreSynchronization=true;
  }
};

My Spec file

module.exports=function(){
    this.Given(/^Open the browser$/,async function(){
        browser.ignoreSynchronization=true;

    });

    this.Given(/^Load the URL$/,async function(){
        browser.get("https://google.com");
        console.log(await browser.getTitle());
    })
}

When i executing the script it is opening the chrome browser and loading the url also but don't know why it is getting failed and it is not even giving the result of the test

Execution Result


    I want to use this template for my feature file

  Scenario: Title of your scenario
  ✓ Given Open the browser
  ✖ And Load the URL

Failures:

[09:15:48] I/launcher - 0 instance(s) of WebDriver still running
[09:15:48] I/launcher - chrome #01 failed 1 test(s)
[09:15:48] I/launcher - overall: 1 failed spec(s)
[09:15:48] E/launcher - Process exited with error code 1

And I'm using the grunt file for execution..

so someone please help me to come out from this issue

4

1 回答 1

0
await browser.get("https://google.com");

你需要等待浏览器去谷歌。

于 2019-11-04T17:31:18.360 回答