ruby - Logging for rspec selenium/capybara tests running in Browserstack -


i building set of automated regression tests in ruby using rspec , capybara. give idea of test, imagine logging in website, adding new data item of fields, saving it, validating new row, updating row, changing fields, , updating/validating that.

for example:

describe "auto regression test #1", :type => :feature, js: true    "should add , update data"     # login     # go page     # press new button     # fill in fields     # etc.   end end 

this simplified version , there may many things going on within "it". @ first thinking should separate out single test multiple cases have login , page (which assume time don't need waste in automated tests - agree?).

nonetheless, i'd log doing such shows in browserstack automate logging tab. what's in there related selenium operations or screenshots. have custom logging. reason being when test fails stack trace - line number (which great) along test fails. since test includes lots of functionality (since don't want rspec log in on , on again) if tests fails , looking @ browserstack see failed difficult know logic failed without additional custom logging. how can put in custom logging can see text in browserstack? (or have wrong , should separate out tests small pieces re-logging in issue)?

the bits of advice can give is:

1:. each test should single use case scenario. if fails know why

2:. if need perform many steps achieve use case scenario should abstracting elements classes represent page (https://code.google.com/p/selenium/wiki/pageobjects) , maybe go further , add flows abstract multiple page actions. if fails in 1 of steps prior validation, know element/page failed , have idea went wrong.

3:. if still have problems understanding went wrong in test browserstack logging , screenshots, problem not lack of logging , yes way tests written


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -