I’m having some tests fail on pretty simple requests that I can validate manually should pass.
it { should have_selector('title', text: app_title('Sign in')) }
Output:
expected css "title" with text "CredSimple - Sign in" to return something
I would like to rspec to tell me what its encountering in addition to this message that its not able to pass the test. Is there a directive that I can use to tell the engine to output what page it is seeing?
Something like:
expected css "title" with text "CredSimple - Sign in" to return something **instead returned text "Wrong Page Title"**
I found a way to do this using
save_and_open_pagestatement in the rspec. This creates an HTML dump that can be viewed in an editor or browser so that you can determine what’s in the test’s source.To implement this I took the following steps
placement is important:
it { save_and_open_page should have_selector(‘div.alert’) }