github.com/lonnblad/godog@v0.7.14-0.20200306004719-1b0cb3259847/features/formatter/junit.feature (about) 1 Feature: JUnit XML formatter 2 In order to support tools that import JUnit XML output 3 I need to be able to support junit formatted output 4 5 Scenario: Support of Feature Plus Scenario Node 6 Given a feature "features/simple.feature" file: 7 """ 8 Feature: simple feature 9 simple feature description 10 Scenario: simple scenario 11 simple scenario description 12 """ 13 When I run feature suite with formatter "junit" 14 Then the rendered xml will be as follows: 15 """ application/xml 16 <?xml version="1.0" encoding="UTF-8"?> 17 <testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0"> 18 <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0"> 19 <testcase name="simple scenario" status="" time="0"></testcase> 20 </testsuite> 21 </testsuites> 22 """ 23 24 Scenario: Support of Feature Plus Scenario Node With Tags 25 Given a feature "features/simple.feature" file: 26 """ 27 @TAG1 28 Feature: simple feature 29 simple feature description 30 @TAG2 @TAG3 31 Scenario: simple scenario 32 simple scenario description 33 """ 34 When I run feature suite with formatter "junit" 35 Then the rendered xml will be as follows: 36 """ application/xml 37 <?xml version="1.0" encoding="UTF-8"?> 38 <testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0"> 39 <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0"> 40 <testcase name="simple scenario" status="" time="0"></testcase> 41 </testsuite> 42 </testsuites> 43 """ 44 Scenario: Support of Feature Plus Scenario Outline 45 Given a feature "features/simple.feature" file: 46 """ 47 Feature: simple feature 48 simple feature description 49 50 Scenario Outline: simple scenario 51 simple scenario description 52 53 Examples: simple examples 54 | status | 55 | pass | 56 | fail | 57 """ 58 When I run feature suite with formatter "junit" 59 Then the rendered xml will be as follows: 60 """ application/xml 61 <?xml version="1.0" encoding="UTF-8"?> 62 <testsuites name="godog" tests="2" skipped="0" failures="0" errors="0" time="0"> 63 <testsuite name="simple feature" tests="2" skipped="0" failures="0" errors="0" time="0"> 64 <testcase name="simple scenario #1" status="" time="0"></testcase> 65 <testcase name="simple scenario #2" status="" time="0"></testcase> 66 </testsuite> 67 </testsuites> 68 """ 69 70 Scenario: Support of Feature Plus Scenario Outline With Tags 71 Given a feature "features/simple.feature" file: 72 """ 73 @TAG1 74 Feature: simple feature 75 simple feature description 76 77 @TAG2 78 Scenario Outline: simple scenario 79 simple scenario description 80 81 @TAG3 82 Examples: simple examples 83 | status | 84 | pass | 85 | fail | 86 """ 87 When I run feature suite with formatter "junit" 88 Then the rendered xml will be as follows: 89 """ application/xml 90 <?xml version="1.0" encoding="UTF-8"?> 91 <testsuites name="godog" tests="2" skipped="0" failures="0" errors="0" time="0"> 92 <testsuite name="simple feature" tests="2" skipped="0" failures="0" errors="0" time="0"> 93 <testcase name="simple scenario #1" status="" time="0"></testcase> 94 <testcase name="simple scenario #2" status="" time="0"></testcase> 95 </testsuite> 96 </testsuites> 97 """ 98 Scenario: Support of Feature Plus Scenario With Steps 99 Given a feature "features/simple.feature" file: 100 """ 101 Feature: simple feature 102 simple feature description 103 104 Scenario: simple scenario 105 simple scenario description 106 107 Given passing step 108 Then a failing step 109 110 """ 111 When I run feature suite with formatter "junit" 112 Then the rendered xml will be as follows: 113 """ application/xml 114 <?xml version="1.0" encoding="UTF-8"?> 115 <testsuites name="godog" tests="1" skipped="0" failures="1" errors="0" time="0"> 116 <testsuite name="simple feature" tests="1" skipped="0" failures="1" errors="0" time="0"> 117 <testcase name="simple scenario" status="failed" time="0"> 118 <failure message="Step a failing step: intentional failure"></failure> 119 </testcase> 120 </testsuite> 121 </testsuites> 122 """ 123 Scenario: Support of Feature Plus Scenario Outline With Steps 124 Given a feature "features/simple.feature" file: 125 """ 126 Feature: simple feature 127 simple feature description 128 129 Scenario Outline: simple scenario 130 simple scenario description 131 132 Given <status> step 133 134 Examples: simple examples 135 | status | 136 | passing | 137 | failing | 138 139 """ 140 When I run feature suite with formatter "junit" 141 Then the rendered xml will be as follows: 142 """ application/xml 143 <?xml version="1.0" encoding="UTF-8"?> 144 <testsuites name="godog" tests="2" skipped="0" failures="1" errors="0" time="0"> 145 <testsuite name="simple feature" tests="2" skipped="0" failures="1" errors="0" time="0"> 146 <testcase name="simple scenario #1" status="passed" time="0"></testcase> 147 <testcase name="simple scenario #2" status="failed" time="0"> 148 <failure message="Step failing step: intentional failure"></failure> 149 </testcase> 150 </testsuite> 151 </testsuites> 152 """ 153 154 # Currently godog only supports comments on Feature and not 155 # scenario and steps. 156 Scenario: Support of Comments 157 Given a feature "features/simple.feature" file: 158 """ 159 #Feature comment 160 Feature: simple feature 161 simple description 162 163 Scenario: simple scenario 164 simple feature description 165 """ 166 When I run feature suite with formatter "junit" 167 Then the rendered xml will be as follows: 168 """ application/xml 169 <?xml version="1.0" encoding="UTF-8"?> 170 <testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0"> 171 <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0"> 172 <testcase name="simple scenario" status="" time="0"></testcase> 173 </testsuite> 174 </testsuites> 175 """ 176 Scenario: Support of Docstrings 177 Given a feature "features/simple.feature" file: 178 """ 179 Feature: simple feature 180 simple description 181 182 Scenario: simple scenario 183 simple feature description 184 185 Given passing step 186 \"\"\" content type 187 step doc string 188 \"\"\" 189 """ 190 When I run feature suite with formatter "junit" 191 Then the rendered xml will be as follows: 192 """ application/xml 193 <?xml version="1.0" encoding="UTF-8"?> 194 <testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0"> 195 <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0"> 196 <testcase name="simple scenario" status="passed" time="0"></testcase> 197 </testsuite> 198 </testsuites> 199 """ 200 Scenario: Support of Undefined, Pending and Skipped status 201 Given a feature "features/simple.feature" file: 202 """ 203 Feature: simple feature 204 simple feature description 205 206 Scenario: simple scenario 207 simple scenario description 208 209 Given passing step 210 And pending step 211 And undefined 212 And passing step 213 214 """ 215 When I run feature suite with formatter "junit" 216 Then the rendered xml will be as follows: 217 """ application/xml 218 <?xml version="1.0" encoding="UTF-8"?> 219 <testsuites name="godog" tests="1" skipped="0" failures="0" errors="1" time="0"> 220 <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="1" time="0"> 221 <testcase name="simple scenario" status="undefined" time="0"> 222 <error message="Step pending step: TODO: write pending definition" type="pending"></error> 223 <error message="Step undefined" type="undefined"></error> 224 <error message="Step passing step" type="skipped"></error> 225 </testcase> 226 </testsuite> 227 </testsuites> 228 """