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

Behave hamcrest assertion output shows the StringDescription object and not the text of the assertion #144

Closed
1 of 3 tasks
crose-88 opened this issue Sep 1, 2017 · 1 comment
Assignees
Labels
bug Something isn't working theme:behave

Comments

@crose-88
Copy link

crose-88 commented Sep 1, 2017

e7f618c6-6bd4-462b-9190-28ceb1fca9bf-result.zip

I'm submitting a ...

  • bug report
  • feature request
  • support request

What is the current behavior?

I'm coming from https://stackoverflow.com/questions/45676000/allure-incorrectly-displays-assertionerror as I'm also seeing the issue. I'm attaching one of my results files with this issue contained in case it's of help.

Currently when an assertion occurs using the "assert_that" functionality of hamcrest, the assertion text is not output, instead the object repr is shown.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

It should be fairly easy to reproduce, the assertion in my then step that's hitting this is

assert_that(err_mess.text, equal_to("Enter a valid email address")) 

where err_mess.text is a string which is different to the give string. So you could use the following to write into the log what I'm seeing:

assert_that("Some text", equal_to("Enter a valid email address"))

What is the expected behavior?

The log should have contained output similar to below which is shown on the console if I don't use the allure_behave file output logging:

  Assertion Failed:
  Expected: 'Enter a valid email address'
       but: was 'Enter a valid email address\nPassword must be 12 characters or more'

Please tell us about your environment:

@sseliverstov
Copy link
Contributor

#158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:behave
Projects
None yet
Development

No branches or pull requests

2 participants