-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
75 additions
and
2 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
3 changes: 3 additions & 0 deletions
3
example-project/Kreya features/Scripting/Scripting WebSocket-request-0.txt
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"text": "Message 1" | ||
} |
3 changes: 3 additions & 0 deletions
3
example-project/Kreya features/Scripting/Scripting WebSocket-request-1.txt
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"text": "Message 2" | ||
} |
14 changes: 14 additions & 0 deletions
14
example-project/Kreya features/Scripting/Scripting WebSocket.js
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { expect } from 'chai'; | ||
|
||
let responseCount = 0; | ||
|
||
kreyaWebSocket.onResponseMessage(response => { | ||
responseCount++; | ||
kreya.test('Response content', () => expect(response.content).to.contain(`Message ${responseCount}`)); | ||
}); | ||
|
||
kreyaWebSocket.onCallCompleted(call => { | ||
kreya.trace('The WebSocket call completed.'); | ||
|
||
kreya.test('Status code', () => expect(call.status.code).to.equal(1000)); | ||
}); |
20 changes: 20 additions & 0 deletions
20
example-project/Kreya features/Scripting/Scripting WebSocket.krop
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"details": { | ||
"path": "/ws/echo" | ||
}, | ||
"script": { | ||
"src": "Scripting WebSocket.js" | ||
}, | ||
"requests": [ | ||
{ | ||
"location": "Scripting WebSocket-request-0.txt", | ||
"type": "json" | ||
}, | ||
{ | ||
"location": "Scripting WebSocket-request-1.txt", | ||
"type": "json" | ||
} | ||
], | ||
"operationType": "duplexStreaming", | ||
"invokerName": "websocket" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"text": "My JSON message" | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
A raw text message |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
U29tZSBiaW5hcnkgY29udGVudA== |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"details": { | ||
"path": "/ws/echo" | ||
}, | ||
"requests": [ | ||
{ | ||
"location": "Echo-request-0.txt", | ||
"type": "json" | ||
}, | ||
{ | ||
"location": "Echo-request-1.txt", | ||
"type": "text" | ||
}, | ||
{ | ||
"location": "Echo-request-2.txt", | ||
"type": "binaryBase64" | ||
} | ||
], | ||
"operationType": "duplexStreaming", | ||
"invokerName": "websocket" | ||
} |
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 |
---|---|---|
|
@@ -20,6 +20,9 @@ | |
} | ||
], | ||
"pathParams": [] | ||
}, | ||
"websocket": { | ||
"endpoint": "{{ env.websocket_endpoint }}" | ||
} | ||
} | ||
} | ||
|
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