karate
karate copied to clipboard
[ui] improve auto-screenshot on error in report
when line 13 failed the screenshot is attached to the next line (16) even if it was not run which is confusing
sample test to replicate:
Feature: browser automation demo
Background:
* configure driver = { type: 'chrome' }
Scenario: try to login to github
and then do a google search
Given driver 'https://github.com/login'
And input('#login_field', 'YYY')
And input('#password', 'world')
When submit().click("input[name=commit]")
Then match html('.flash-error') contains 'Bad username or password.'
# And screenshot()
Given driver 'https://google.com'
# And click('{}Accept all')
And input("[name=q][name=q]", 'karate dsl')
When submit().click("input[name=btnI]")
Then waitForUrl('https://github.com/karatelabs/karate')