Default failing tests

30 views
Skip to first unread message

Trevor Knight

unread,
Nov 13, 2023, 6:53:26 AM11/13/23
to rspec
Hiya,

Very new to Cucumber / Ruby reports, so please excuse the basic question. I've an XML file which has 3 tests in it, all with PASSED / FAILED status. I'm experimenting in using Cucumber reports to render the XML report in a nice format.

All works well until the Then clause, pased below;

Then(/^the test case should have status "(.*?)"$/) do |expected_status|
    actual_status = @current_testcase.at('status').content
expect(actual_status).to eq(expected_status)
# expect{(actual_status).not_to match(expected_status)}.to raise_error
# expect(actual_status).to eq(expected_status), "Expected status: #{expected_status}, Actual status: #{actual_status}"
end

the expected _status is either PASSED or FAILED, and in the xml report as stated above, it is PASSED / FAILED. The expect clause is correctly working this out, and I see errors in the output in the right places, and see 3 scenarios (2 failed 1 passed) so all looks good. 

When I open the cucumber html report though, all are failed.

No matter what I do, I cannot get any to pass. is there a way to say

if (matched) pass test case, else fail ?

Many thanks,


Trevor. 
Reply all
Reply to author
Forward
0 new messages