Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions tests/api-requests/Default turninator/Monolog simple.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
meta {
name: Monolog simple
type: http
seq: 1
}

post {
url: {{baseUrl}}/turninator-01
body: multipartForm
auth: inherit
}

headers {
Content-Type: multipart/form-data
}

body:multipart-form {
file: @file(test-inputs/monolog_sample.txt)
}

tests {
const expectedData =
{
"AIF": {
"nodes": [
{
"text": "This is a sample argument about climate change. We need to take action now to reduce carbon emissions. The scientific evidence is overwhelming and shows that human activities are the primary cause of global warming. Therefore, we must implement stricter environmental regulations.",
"type": "L",
"nodeID": 0
}
],
"edges": [],
"locutions": [
{
"personID": 1,
"nodeID": 0
}
],
"schemefulfillments": [],
"descriptorfulfillments": [],
"participants": [
{
"participantID": 1,
"firstname": "Default",
"surname": "Speaker"
}
]
},
"ova": {},
"dialog": {},
"text": {
"txt": " Default Speaker <span class=\"highlighted\" id=\"0\">This is a sample argument about climate change. We need to take action now to reduce carbon emissions. The scientific evidence is overwhelming and shows that human activities are the primary cause of global warming. Therefore, we must implement stricter environmental regulations.</span>.<br><br>"
}
};

// And this is how long the request should take before deemed too slow:
const maxTimeToReturnInMilliseconds = 300;

test("Response should match expected value", function () {
const receivedData = res.getBody();
expect(receivedData).to.deep.equal(expectedData);
});

test(`Response time should be faster than ${maxTimeToReturnInMilliseconds} milliseconds`, function () {
expect(res.responseTime).to.be.below(maxTimeToReturnInMilliseconds);
});
}

settings {
encodeUrl: false
timeout: 0
}
82 changes: 82 additions & 0 deletions tests/api-requests/Default turninator/XAIF Dialog.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
meta {
name: XAIF Dialog
type: http
seq: 2
}

post {
url: {{baseUrl}}/turninator-01
body: multipartForm
auth: inherit
}

headers {
Content-Type: multipart/form-data
}

body:multipart-form {
file: @file(test-inputs/xaif_dialog.json)
}

tests {
const expectedData =
{
"AIF": {
"nodes": [
{
"text": "We should invest in education.",
"type": "L",
"nodeID": 0
},
{
"text": "I think healthcare is more important.",
"type": "L",
"nodeID": 1
}
],
"edges": [],
"locutions": [
{
"personID": 0,
"nodeID": 0
},
{
"personID": 1,
"nodeID": 1
}
],
"participants": [
{
"participantID": 0,
"firstname": "Alice",
"surname": "None"
},
{
"participantID": 1,
"firstname": "Bob",
"surname": "None"
}
],
"schemefulfillments": [],
"descriptorfulfillments": []
},
"text": {
"txt": " Alice None <span class=\"highlighted\" id=\"0\">We should invest in education.</span>.<br><br> Bob None <span class=\"highlighted\" id=\"1\">I think healthcare is more important.</span>.<br><br>"
},
"dialog": true,
"OVA": {},
"ova": {}
};

// And this is how long the request should take before deemed too slow:
const maxTimeToReturnInMilliseconds = 300;

test("Response should match expected value", function () {
const receivedData = res.getBody();
expect(receivedData).to.deep.equal(expectedData);
});

test(`Response time should be faster than ${maxTimeToReturnInMilliseconds} milliseconds`, function () {
expect(res.responseTime).to.be.below(maxTimeToReturnInMilliseconds);
});
}
68 changes: 68 additions & 0 deletions tests/api-requests/Default turninator/XAIF Minimal.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
meta {
name: XAIF Minimal
type: http
seq: 3
}

post {
url: {{baseUrl}}/turninator-01
body: multipartForm
auth: inherit
}

headers {
Content-Type: multipart/form-data
}

body:multipart-form {
file: @file(test-inputs/xaif_minimal.json)
}

tests {
const expectedData =
{
"AIF": {
"nodes": [
{
"text": "This is a sample argument text that will be processed by the turninator.",
"type": "L",
"nodeID": 0
}
],
"edges": [],
"locutions": [
{
"personID": 1,
"nodeID": 0
}
],
"participants": [
{
"participantID": 1,
"firstname": "Default",
"surname": "Speaker"
}
],
"schemefulfillments": [],
"descriptorfulfillments": []
},
"text": {
"txt": " Default Speaker <span class=\"highlighted\" id=\"0\">This is a sample argument text that will be processed by the turninator.</span>.<br><br>"
},
"dialog": false,
"OVA": {},
"ova": {}
};

// And this is how long the request should take before deemed too slow:
const maxTimeToReturnInMilliseconds = 300;

test("Response should match expected value", function () {
const receivedData = res.getBody();
expect(receivedData).to.deep.equal(expectedData);
});

test(`Response time should be faster than ${maxTimeToReturnInMilliseconds} milliseconds`, function () {
expect(res.responseTime).to.be.below(maxTimeToReturnInMilliseconds);
});
}
9 changes: 9 additions & 0 deletions tests/api-requests/Default turninator/bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": "1",
"name": "Default turninator",
"type": "collection",
"ignore": [
"node_modules",
".git"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vars {
baseUrl: http://localhost:5006
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vars {
baseUrl: http://default-turninator.amfws.staging.arg.tech
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vars {
baseUrl: http://default-turninator.amfws.arg.tech
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
John Smith: I believe renewable energy is the future.
Jane Doe: I agree, but we need to consider the economic implications.
John Smith: The long-term benefits outweigh the initial costs.
Jane Doe: That's a fair point, but we also need to support workers in traditional energy sectors.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a sample argument about climate change. We need to take action now to reduce carbon emissions. The scientific evidence is overwhelming and shows that human activities are the primary cause of global warming. Therefore, we must implement stricter environmental regulations.
13 changes: 13 additions & 0 deletions tests/api-requests/Default turninator/test-inputs/xaif_dialog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"AIF": {
"nodes": [],
"edges": [],
"locutions": [],
"participants": [],
"schemefulfillments": [],
"descriptorfulfillments": []
},
"text": "Alice: We should invest in education.\nBob: I think healthcare is more important.",
"dialog": true,
"OVA": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"AIF": {
"nodes": [],
"edges": [],
"locutions": [],
"participants": [],
"schemefulfillments": [],
"descriptorfulfillments": []
},
"text": "This is a sample argument text that will be processed by the turninator.",
"dialog": false,
"OVA": {}
}