Skip to content

Commit

Permalink
subflows
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldoakes committed Sep 23, 2023
1 parent a5ca720 commit abde1dd
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 27 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ply-ct/ply-demo",
"version": "3.2.15",
"version": "3.2.16",
"description": "Illustrate Ply automated testing",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -47,7 +47,7 @@
"typescript": "^4.9.5"
},
"dependencies": {
"@ply-ct/ply": "^3.2.15"
"@ply-ct/ply": "^3.2.16"
},
"optionalDependencies": {
"@ply-ct/ply-viz": "^0.1.0"
Expand Down
34 changes: 26 additions & 8 deletions test/flows/invoke-subflow.ply.flow
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ steps:
name: Stop
path: stop
attributes:
display: x=490,y=70,w=60,h=40
display: x=690,y=70,w=60,h=40
- id: s3
name: |-
Get
Movie
Get Movie
by Title
path: request
links:
- id: l4
Expand All @@ -33,14 +33,32 @@ steps:
method: GET
headers: '[["Accept","application/json"]]'
- id: s4
name: Subflow
name: |-
Invoke
movie-by-id
path: subflow
links:
- id: l3
to: s2
- id: l5
to: s5
attributes:
display: type=Elbow,x=463,y=90,xs=434&486,ys=90&90
display: type=Elbow,x=471,y=90,xs=434&506,ys=90&90
attributes:
display: x=330,y=50,w=100,h=80
subflow: test/flows/movie-by-id.ply.flow
values: '[["movieId","${@s3.response.body.movies[0].id}"]]'
inValues: '[["movieId","${@s3.response.body.movies[0].id}"]]'
outValues: '[["movieYear","queryYear"]]'
- id: s5
name: |-
Great Movies
of Year
path: request
links:
- id: l6
to: s2
attributes:
display: type=Elbow,x=650,y=90,xs=614&686,ys=90&90
attributes:
display: x=510,y=50,w=100,h=80
method: GET
url: ${baseUrl}/movies?year=${queryYear}&rating=>=4.5
headers: '[["Accept","application/json"]]'
9 changes: 5 additions & 4 deletions test/flows/movie-by-id.ply.flow
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ attributes:
NodeStyle: BoxIcon
display: x=23,y=18,w=156,h=27
values: '[["movieId","","true",""]]'
return: '[["movieYear","${@s3.response.body.year}"]]'
steps:
- id: s1
name: Start
Expand All @@ -11,13 +12,13 @@ steps:
links:
- id: l1
attributes:
display: type=Elbow,x=164,y=117,xs=120&206,ys=117&117
display: type=Elbow,x=158,y=117,xs=120&196,ys=117&117
to: s3
- id: s2
name: Stop
path: stop
attributes:
display: x=406,y=97,w=60,h=40
display: x=420,y=100,w=60,h=40
- id: s3
name: |-
Get Movie
Expand All @@ -27,9 +28,9 @@ steps:
- id: l2
to: s2
attributes:
display: type=Elbow,x=358,y=117,xs=314&402,ys=117&117
display: type=Elbow,x=360,y=120,xs=304&416,ys=120&120
attributes:
display: x=210,y=80,w=100,h=80
display: x=200,y=80,w=100,h=80
url: ${baseUrl}/movies/${movieId}
method: GET
headers: '[["Accept","application/json"]]'
Expand Down
173 changes: 170 additions & 3 deletions test/results/expected/flows/invoke-subflow.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Start:
id: s1
status: Completed
Get Movie:
Get Movie by Title:
id: s3
request:
url: ${baseUrl}/movies?title=The Invisible Man
Expand Down Expand Up @@ -54,19 +54,186 @@ Get Movie:
]
}
status: Completed
Subflow:
Invoke movie-by-id:
id: s4
data: |
[
[
"test/flows/movie-by-id.ply.flow",
"Passed",
${~.*},
${~.*},
1695498240603,
""
]
]
status: Completed
Great Movies of Year:
id: s5
request:
url: ${baseUrl}/movies?year=${queryYear}&rating=>=4.5
method: GET
headers:
Accept: application/json
response:
status:
code: 200
message: OK
headers:
content-type: application/json; charset=utf-8
body: |-
{
"movies": [
{
"credits": [
{
"name": "James Whale",
"role": "director"
},
{
"name": "Claude Rains",
"role": "actor"
},
{
"name": "Gloria Stuart",
"role": "actor"
},
{
"name": "William Harrigan",
"role": "actor"
},
{
"name": "Henry Travers",
"role": "actor"
}
],
"description": "From the opening scene with Claude Rains stumbling around in a blizzard, the desolation of H.G. Wells' story is depicted with chilling atmospherics and astonishing special effects.",
"id": "b1cd7001",
"poster": "tim.jpg",
"rating": 5,
"title": "The Invisible Man",
"webRef": {
"ref": "tt0024184",
"site": "imdb.com"
},
"year": ${queryYear}
},
{
"credits": [
{
"name": "Merian C. Cooper",
"role": "director"
},
{
"name": "Ernest B. Schoedsack",
"role": "director"
},
{
"name": "Fay Wray",
"role": "actor"
},
{
"name": "Robert Armstrong",
"role": "actor"
},
{
"name": "Bruce Cabot",
"role": "actor"
},
{
"name": "Frank Reicher",
"role": "actor"
}
],
"description": "From the wondrous scenes on Skull Island to the pandemonium of terrified crowds in New York City, this epic maintains an allegorical sensibility that puts it really in a genre of its own.",
"id": "daa31bd3",
"poster": "kk.jpg",
"rating": 4.5,
"title": "King Kong",
"webRef": {
"ref": "tt0024216",
"site": "imdb.com"
},
"year": ${queryYear}
},
{
"credits": [
{
"name": "A. Edward Sutherland",
"role": "director"
},
{
"name": "Charles Ruggles",
"role": "actor"
},
{
"name": "Lionel Atwill",
"role": "actor"
},
{
"name": "Gail Patrick",
"role": "actor"
},
{
"name": "Randolph Scott",
"role": "actor"
},
{
"name": "Kathleen Burke",
"role": "actor"
}
],
"description": "Atwill is bone-chilling as the evil Dr. Gorman who devises ever more sadistic ways to dispose of his enemies in this first-rate Paramount chiller whose only defect is the ever-annoying Charlie Ruggles.",
"id": "d4e52815",
"poster": "mitz.jpg",
"rating": 4.5,
"title": "Murders in the Zoo",
"webRef": {
"ref": "tt0024360",
"site": "imdb.com"
},
"year": ${queryYear}
},
{
"credits": [
{
"name": "Fritz Lang",
"role": "director"
},
{
"name": "Rudolf Klein-Rogge",
"role": "actor"
},
{
"name": "Otto Wernicke",
"role": "actor"
},
{
"name": "Oscar Beregi Sr.",
"role": "actor"
},
{
"name": "Gustav Diessl",
"role": "actor"
},
{
"name": "Theodor Loos",
"role": "actor"
}
],
"description": "Fritz Lang uses sets and lighting brilliantly in this virtuosic example of German Expressionist filmmaking, delivering atmosphere galore in his banned last movie before fleeing the Nazis.",
"id": "ff560f19",
"poster": "todm.jpg",
"rating": 4.5,
"title": "The Testament of Dr. Mabuse",
"webRef": {
"ref": "tt0023563",
"site": "imdb.com"
},
"year": ${queryYear}
}
]
}
status: Completed
Stop:
id: s2
status: Completed
2 changes: 1 addition & 1 deletion test/results/expected/flows/movie-by-id.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Get Movie by ID:
}
],
"description": "From the opening scene with Claude Rains stumbling around in a blizzard, the desolation of H.G. Wells' story is depicted with chilling atmospherics and astonishing special effects.",
"id": "b1cd7001",
"id": "${movieId}",
"poster": "tim.jpg",
"rating": 5,
"title": "The Invisible Man",
Expand Down

0 comments on commit abde1dd

Please sign in to comment.