Skip to content
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

No report generated if assertion fails on title comparison #25

Closed
chit786 opened this issue Sep 23, 2017 · 7 comments
Closed

No report generated if assertion fails on title comparison #25

chit786 opened this issue Sep 23, 2017 · 7 comments

Comments

@chit786
Copy link

chit786 commented Sep 23, 2017

Steps

Just replace Google in homepage.js with Google123 to reproduce this.

Expected

Should capture the screenshot and generate the report.

Can you please guide me here whats missing.

image

@chit786
Copy link
Author

chit786 commented Sep 24, 2017

I am able to handle this by , ignoreUncaughtExceptios:true , in config, but this does not completely solve the problem, as I am also expecting a screenshot, which is not working and getting a timeout in After hook. Any thoughts?

~Thanks
image

@chit786
Copy link
Author

chit786 commented Sep 24, 2017

Hi ,


  After({ timeout: 20 * 1000 },function(scenario) {
    if (scenario.isFailed()) {
       var attach = this.attach; // cucumber's world object has attach function which should be used
      return browser.takeScreenshot().then(function(png) {
        var decodedImage = new Buffer(png, "base64");
        return scenario.attach(decodedImage, "image/png");
      });
    }
  });

modified After hook like this solves the timeout problem,

but then received following error :
image

Strangely browser.takeScreenshot() is not working . chrome version : Version 60.0.3112.11

@igniteram
Copy link
Owner

igniteram commented Sep 24, 2017

@chit786 Can you please specify the versions of following modules which you are using in your project?

  • protractor
  • cucumber
  • protractor-cucumber-framework

So that I could debug this specific issue!

@chit786
Copy link
Author

chit786 commented Sep 24, 2017

@igniteram thank you for reverting.

Well, I just cloned your repo and trying to run it as per my expectations! just checking for how the screenshots gets appended, but unfortunately, not able to see the screenshot working.

{
"name": "protractor-cucumber-allure",
"version": "1.0.0",
"license": "MIT",
"description": "To demostrate protractor cucumber tests for angular/non angular apps with allure report framework",
"homepage": "https://github.com/igniteram/protractor-cucumber-allure",
"keywords": [
"protractor",
"cucumber",
"allure reports",
"angular",
"angularjs",
"testing",
"behaviour driven development",
"bdd",
"selenium",
"webdriverJS",
"posgreSQL",
"gherkin",
"automation testing"
],
"main": "index.js",
"scripts": {
"test": "protractor config/config.js",
"webdriver-start": "webdriver-manager start",
"webdriver-update": "webdriver-manager update"
},
"author": "Ram Pasala ram.pasala7@gmail.com",
"dependencies": {
"chai": "^4.0.2",
"cucumber": "^2.3.0",
"mkdirp": "^0.5.1",
"protractor": "^5.1.1",
"protractor-cucumber-framework": "^3.1.0"
},
"devDependencies": {
"chai-as-promised": "^6.0.0",
"cucumber-html-report": "^0.6.0",
"cucumber-html-reporter": "^0.5.2",
"cucumberjs-allure-reporter": "^1.0.3",
"pg": "^6.0.3"
},
"repository": "https://github.com/igniteram/protractor-cucumber-allure"
}

I have not changed as such anything, just npm install after cloning.

Also observed one thing that ,

onPrepare: function() {
browser.ignoreSynchronization = true;
//browser.manage().window().maximize();
global.expect = chai.expect;
},

I had to comment this window.maximize in this version of webdriver.

I am running protractor globally. with below characteristics of chrome driver and selenium webdriver.

image

The problem I am seeing is with the takeScreenshot function of the browser which is not able to consume browser object.

but when I did console.log(typeof browser) It correctly gave me object type, in After hook. So trying to figure out what am I missing here.

Thanks again.

@chit786
Copy link
Author

chit786 commented Sep 24, 2017

Well.. I tried again . this time locally and not global protractor. on local package protractor version I am getting chromedriver version as 2.32 and that is working fine.. so closing this issue. I believe it has something to do with the chromedriver version .

Thanks for this amazing work.

@chit786
Copy link
Author

chit786 commented Sep 24, 2017

Also do you have any plans of working on allure report ? Cheers.

@chit786 chit786 closed this as completed Sep 24, 2017
@igniteram
Copy link
Owner

Glad it worked! currently cucumberjs-allure-reporter doesn't support cucumber 2.x version onwards and sadly that repo isn't active anymore. So someone has to raise a PR or create a new repo for support of new cucumber versions with allure. I would love to work on it if I get time but considering my work commitments I can't assure though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants