Closed kzkn closed 4 years ago
Hi!
What about the preceding rule? Does that format come from a different setup? Or a previous version of Capybara?
@dgutov
'((rspec-capybara-html "^ +HTML screenshot: \\([0-9A-Za-z@_./\:-]+\\.html\\)" 1 nil nil 0 1)
(rspec-capybara-screenshot "^ +Image screenshot: \\([0-9A-Za-z@_./\:-]+\\.png\\)" 1 nil nil 0 1)
They are output formats by capybara-screenshot gem. It's still a good way in the old style of feature specs to take a screenshot automatically on fail a spec.
(rspec-system-spec-screenshot "^ +\\[Screenshot\\]: \\(.+\\.png\\)" 1 nil nil 0 1)
This is an output format by System Test that built-in Rails. RSpec's System Spec is a wrapper of it.
Makes sense, thank you. So both formats need to be supported.
Could you modify the previous rule, though, instead of adding a new one? They only differ in the first two words, I think. And brackets.
@dgutov
Thanks. Let me just check one thing.
Do you mean merge rspec-capybara-html
, rspec-capybara-screenshot
and rspec-system-spec-screenshot
?
Or merge rspec-capybara-screenshot
and rspec-system-spec-screenshot
?
Or merge rspec-capybara-screenshot and rspec-system-spec-screenshot?
Let's go with this one.
@dgutov I did it :smiley:
Could you keep the bol anchoring (^ +
)? It's better for performance.
You might also want to use grouping and the alternation instruction (\\|
).
@dgutov thanks. I did it.
Um, this part doesn't make sense: \\(\\|
.
Let's revert that part to the previous version. But keep the bol anchoring.
ok, did it.
Thanks!
Make as a hyperlink the screenshot path automatically taken by RSpec's System Spec.
Example:
Outputs:
This pull request makes the above path as a hyperlink.