Skip to content

Commit

Permalink
chore: Formated validation test features
Browse files Browse the repository at this point in the history
  • Loading branch information
martdo02 committed Sep 19, 2024
1 parent 2346f45 commit 01e4239
Show file tree
Hide file tree
Showing 6 changed files with 401 additions and 357 deletions.
85 changes: 44 additions & 41 deletions packages/validations/features/jpath.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Feature: Validations: Json Path Testing
Background:
When set "directory" to "./test"
Background:
When set "directory" to "./test"


Scenario: When set array value it is able to validate in the area
Expand All @@ -13,55 +13,58 @@ Feature: Validations: Json Path Testing
Then it matches the set from file "expected.json"
Then it matches the set "expected"
Then item "item" is equal to:
"""
["jeff","joe"]
"""
"""
[
"jeff",
"joe"
]
"""
And it is written to file "hello.txt"
And item "item" is written to file "hello2.txt"
Scenario: Apply json path to item
Given set "meh" to
"""
{
"url": "http://google.com",
"arrayTest": [
"Testing1",
"Testing2",
"Testing3"
]
}
"""
And set "expected" to
"""
{
"url": null,
"arrayTest": [
"Testing1",
"Testing2",
"Testing3"
]
}
"""
When set "meh.url" to "null"
Then item "expected" is equal to item "meh"
"""
{
"url": "http://google.com",
"arrayTest": [
"Testing1",
"Testing2",
"Testing3"
]
}
"""
And set "expected" to
"""
{
"url": null,
"arrayTest": [
"Testing1",
"Testing2",
"Testing3"
]
}
"""
When set "meh.url" to "null"
Then item "expected" is equal to item "meh"

Scenario: Change JSON value in file
When "SomethingElse" is written to file "newconfig.json" on JSON path "$.meh"
When "SomethingElse" is written to file "newconfig.json" on JSON path "$.meh"
And set config from json file "newconfig.json"
Then "${meh}" is equal to "SomethingElse"
When "Test" is written to file "newconfig.json" on JSON path "$.meh"
And set config from json file "newconfig.json"
Then "${meh}" is equal to "Test"
Scenario: Compare two items for equality
Given set "a" to
"""
{
"a":5
}
"""
"""
{
"a": 5
}
"""
And set "b" to
"""
{
"a":5
}
"""
Then item "a" is equal to item "b"
"""
{
"a": 5
}
"""
Then item "a" is equal to item "b"
Loading

0 comments on commit 01e4239

Please sign in to comment.