-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new setup hook working with build passing #1905
remaining - include the extra scenario in reports documentation, and the support for multiple named setup scenarios in a feature
- Loading branch information
Showing
27 changed files
with
131 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 4 additions & 14 deletions
18
karate-core/src/test/java/com/intuit/karate/core/jsread/js-read-2.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,19 @@ | ||
Feature: | ||
|
||
Background: | ||
* def anotherVariable = 'hello' | ||
@setup | ||
Scenario: | ||
* def data = [{ name: 'one' }, { name: 'two' }] | ||
|
||
Scenario Outline: | ||
* match name == "#present" | ||
* match anotherVariable == "hello" | ||
|
||
Examples: | ||
| data | | ||
| karate.setup().data | | ||
|
||
Scenario Outline: | ||
* match name == "#present" | ||
* match anotherVariable == "hello" | ||
|
||
Examples: | ||
| name | | ||
| test | | ||
|
||
Scenario Outline: | ||
* match name == "#present" | ||
* match anotherVariable == "hello" | ||
* def params = { 'foo': 'bar' } | ||
* call read('js-read-called-2.feature') params | ||
|
||
Examples: | ||
| data | | ||
| karate.setup().data | |
40 changes: 4 additions & 36 deletions
40
karate-core/src/test/java/com/intuit/karate/core/jsread/js-read-3.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,12 @@ | ||
Feature: | ||
|
||
Background: | ||
* def anotherVariable = 'hello' | ||
@setup | ||
Scenario: | ||
* def x = read('js-read-3.json') | ||
* def data = x.thirderror | ||
* def backgroundVar = | ||
""" | ||
{"foo": '#(data)' } | ||
""" | ||
|
||
Scenario Outline: | ||
* match backgroundVar == { "foo": "#(data)" } | ||
* match id == "#present" | ||
* match anotherVariable == "hello" | ||
* match id == '#number' | ||
|
||
Examples: | ||
| data | | ||
|
||
Scenario Outline: | ||
* def param = | ||
""" | ||
{ bar: '#(backgroundVar)'} | ||
""" | ||
* match param == { bar: '#(backgroundVar)'} | ||
* match id == "#present" | ||
* match anotherVariable == "hello" | ||
|
||
Examples: | ||
| data | | ||
|
||
|
||
Scenario Outline: | ||
* def params = | ||
""" | ||
{ backgroundVar: '#(backgroundVar)'} | ||
""" | ||
* print params | ||
* match id == "#present" | ||
* match anotherVariable == "hello" | ||
* call read('js-read-called-2.feature') params | ||
|
||
Examples: | ||
| data | | ||
| karate.setup().data | |
5 changes: 1 addition & 4 deletions
5
karate-core/src/test/java/com/intuit/karate/core/jsread/js-read-called-2.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
Feature: | ||
|
||
Background: | ||
#* call read('js-read-3.json') | ||
* call read('../utils-reuse-common.feature') | ||
|
||
Scenario: | ||
* print 'arg: ' + __arg | ||
* match __arg == "#present" | ||
* match __arg == "#notnull" | ||
* match __arg == { foo: 'bar' } |
24 changes: 9 additions & 15 deletions
24
karate-core/src/test/java/com/intuit/karate/core/outline-background.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
Feature: | ||
|
||
Background: | ||
* def foo = 'hello' | ||
* def fun = function(){ return 'bar' } | ||
* configure driver = { type: "noopdriver" } | ||
* driver 'http://google.com' | ||
* table data | ||
| name | extra | | ||
| 'one' | | | ||
| 'two' | configSource | | ||
@setup | ||
Scenario: | ||
* table data | ||
| name | extra | | ||
| 'one' | | | ||
| 'two' | configSource | | ||
|
||
Scenario Outline: | ||
* assert name == 'one' || name == 'two' | ||
* assert name == 'two' ? extra == 'normal' : true | ||
* match foo == "hello" | ||
* match fun() == 'bar' | ||
* click("#testing.usage.driver.method") | ||
* assert name == 'one' || name == 'two' | ||
* assert name == 'two' ? extra == 'normal' : true | ||
|
||
Examples: | ||
| data | | ||
| karate.setup().data | |
9 changes: 5 additions & 4 deletions
9
karate-core/src/test/java/com/intuit/karate/core/outline-config-js.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
Feature: function from global config | ||
Feature: | ||
|
||
Background: | ||
* def data = [ { name: 'value1' }, { name: 'value2' }, { name: 'value3' }, { name: 'value4' } ] | ||
@setup | ||
Scenario: | ||
* def data = [{ name: 'value1' }, { name: 'value2' }, { name: 'value3' }, { name: 'value4' }] | ||
|
||
Scenario Outline: | ||
* print 'name:', name | ||
|
||
Examples: | ||
| data | | ||
| karate.setup().data | |
6 changes: 5 additions & 1 deletion
6
karate-core/src/test/java/com/intuit/karate/core/outline-dynamic.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
karate-core/src/test/java/com/intuit/karate/core/outline-generator.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
Feature: | ||
|
||
Background: | ||
@setup | ||
Scenario: | ||
* def generator = function(i){ if (i == 5) return null; return { name: 'cat' + i, age: i } } | ||
|
||
Scenario Outline: | ||
* match __num == age | ||
* match __row.name == 'cat' + age | ||
|
||
Examples: | ||
| generator | | ||
| karate.setup().generator | |
19 changes: 9 additions & 10 deletions
19
karate-core/src/test/java/com/intuit/karate/core/parallel/parallel-csv.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
Feature: | ||
|
||
Background: | ||
* def isNot = function(x) { return function(row) { return row.id != x } } | ||
* callonce read('call-once-from-feature.feature') | ||
@setup | ||
Scenario: | ||
* def data = read('data.csv') | ||
* def exclude = x => data.filter(y => y.id != x) | ||
* def include = x => data.filter(y => y.id == x) | ||
|
||
Scenario Outline: | ||
* call read('called.feature') | ||
* assert id != '0' | ||
|
||
Examples: | ||
| karate.filter(read('data.csv'), isNot('0')) | | ||
| karate.setup().data.filter(x => x.id != '0') | | ||
|
||
Scenario Outline: | ||
* call read('called.feature') | ||
* assert id != '1' | ||
|
||
Examples: | ||
| karate.filter(read('data.csv'), isNot('1')) | | ||
| karate.setup().exclude('1') | | ||
|
||
Scenario Outline: | ||
* call read('called.feature') | ||
* assert id != '2' | ||
* assert id == '2' | ||
|
||
Examples: | ||
| karate.filter(read('data.csv'), isNot('2')) | | ||
| karate.setup().include('2') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
karate-core/src/test/java/com/intuit/karate/core/parallel/parallel-outline-2.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
Feature: | ||
|
||
Background: | ||
* def data = [ { name: 'value1' }, { name: 'value2' }, { name: 'value3' }, { name: 'value4' } ] | ||
@setup | ||
Scenario: | ||
* def data = [{ name: 'value1' }, { name: 'value2' }, { name: 'value3' }, { name: 'value4' }] | ||
|
||
Scenario Outline: | ||
* match functionFromKarateBase() == 'fromKarateBase' | ||
|
||
Examples: | ||
| data | | ||
| karate.setup().data | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.