File tree Expand file tree Collapse file tree 3 files changed +28
-13
lines changed
src/practitest_firecracker Expand file tree Collapse file tree 3 files changed +28
-13
lines changed Original file line number Diff line number Diff line change 3636(defn- expand-scenario-outline
3737 [scenario feature]
3838 (let [examples (:examples scenario)
39- all-params (glue-example-arguments ( first examples) )]
39+ all-params (mapcat glue-example-arguments examples)]
4040 (mapcat
4141 (fn [param]
4242 ; ; Store params and values here for future reference
5858 (:map param)] result]]))
5959 all-params)))
6060
61+ (defn- examples-section-end? [line]
62+ (str/starts-with? (str/lower-case (str/trim line)) " scenario:" ))
63+
6164; ; TODO: tags support ??
6265(defn- extract-scenario-source
6366 [feature-root scenario]
7376
7477 outline?
7578 ; ; For outline need to extract examples as well
76- (let [start-examples (:line (:location (last (:examples scenario))))]
77- ; ; Find end of examples sections - either end of file or empty line
79+ (let [start-examples (:line (:location (first (:examples scenario))))]
80+ ; ; Find end of examples sections - either end of file or new BDD scenario
7881 (loop [i start-examples
7982 coll (seq (drop start-examples feature-source))]
8083 (if coll
8184 (let [line (first coll)]
82- (if (str/blank ? line)
85+ (if (examples-section-end ? line)
8386 i
8487 (recur (inc i) (next coll))))
8588 i)))
Original file line number Diff line number Diff line change 319319 (when display-action-logs (log/infof " make-runs" ))
320320 (flatten (doall
321321 (for [[test-testset instances] instance-to-ts-test]
322- (map-indexed
323- (fn [index instance]
322+ (map
323+ (fn [instance]
324324 (let [[_ test-id] test-testset
325325 tst (first (get test-by-id test-id))
326326 test-name (get tst 0 )
327- params (get test-name-to-params test-name)
328- this-param (get params index)
327+ this-param (:parameters (:attributes instance))
328+ ; ; Use nil in case of empty params
329+ this-param (if (empty? this-param)
330+ nil
331+ this-param)
329332 xml-test (get group-xml-tests [test-name this-param])
330333 sys-test (get tst 1 )
331334 [run run-steps] (eval/sf-test-suite->run-def options (first xml-test) sys-test this-param)
Original file line number Diff line number Diff line change @@ -3,12 +3,21 @@ Feature: Identity feature
33 Given I run identity function with 1
44 Then I will get result 1
55
6- Scenario Outline : Multiple identity tests for <arg > and <result > with "Some quoutes"
7- When I run identity function with <arg >
8- Then I will get result <result > every time
6+ Scenario Outline : Multiple identity tests for <First Arg > and <Second Arg > with "Some quoutes"
7+ When I run identity function with <First Arg >
8+ Then I will get result <Second Arg > every time
99
1010 Examples :
11- | arg | result |
11+
12+ | First Arg | Second Arg |
1213 | "First Item " | "First Item " |
13- | "Second Item " | "Second 123 " |
14+ | "Second Item " | "Second 123 " |
1415 | "Third Item " | "Third Item " |
16+
17+ Examples :
18+
19+ | First Arg | Second Arg |
20+ | "Second Part " | "Second Part " |
21+ | "Failure " | "That would fail " |
22+
23+ Scenario : Another schenario just in case
You can’t perform that action at this time.
0 commit comments