Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#23603 : Allow users to write code when creating a file #24181

Closed
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixing other Postman Tests.
jcastro-dotcms committed Feb 23, 2023
commit f4cae6a7618266bc0272a71489de8bba7f96ca22
29 changes: 28 additions & 1 deletion dotCMS/src/curl-test/Content Resource.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "64a156b5-40b4-46ce-8bab-6083e910e48a",
"_postman_id": "50e22041-5236-42d7-8d37-b9a39f0457e3",
"name": "Content Resource",
"description": "Content Resource test",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
@@ -1763,6 +1763,15 @@
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{serverURL}}/api/v1/workflow/actions/default/fire/UNPUBLISH?inode={{fileInode}}&identifier={{fileId}}",
"host": [
@@ -1835,6 +1844,15 @@
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{serverURL}}/api/v1/workflow/actions/default/fire/ARCHIVE?inode={{fileInode}}&identifier={{fileId}}",
"host": [
@@ -1907,6 +1925,15 @@
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{serverURL}}/api/v1/workflow/actions/default/fire/DELETE?inode={{fileInode}}&identifier={{fileId}}",
"host": [
55 changes: 49 additions & 6 deletions dotCMS/src/curl-test/TempAPI.postman_collection.json
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
"info": {
"_postman_id": "b65639a1-cec6-4b6c-b8b6-ab483db33b5b",
"name": "TempAPI",
"description": "Verifies that the Temp File API is working as expected. It allows users to create temporary files in the dotCMS assets folder.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "5403727"
},
@@ -243,14 +244,36 @@
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();",
"pm.test(\"Checking file names and operation status code\", function () {",
" var jsonData = pm.response.json();",
" let found = false;",
" jsonData.tempFiles.forEach((item) => {",
"",
"pm.test(\"File name check\", function () {",
" pm.expect(jsonData.tempFiles[0].fileName).to.eql('Landscape_2009_romantic_country_garden.jpeg');",
" pm.expect(jsonData.tempFiles[1].fileName).to.eql('16475687531_eac8a30914_b.jpeg');",
" pm.expect(jsonData.tempFiles[2].errorCode).to.eql('400');",
"});",
" if (item.fileName == \"Landscape_2009_romantic_country_garden.jpeg\") {",
" found = true;",
" }",
"",
" });",
" pm.expect(found).to.eq(true, \"Expected image 'Landscape_2009_romantic_country_garden.jpeg' was not found.\")",
" found = false;",
" jsonData.tempFiles.forEach((item) => {",
"",
" if (item.fileName == \"16475687531_eac8a30914_b.jpeg\") {",
" found = true;",
" }",
"",
" });",
" pm.expect(found).to.eq(true, \"Expected image '16475687531_eac8a30914_b.jpeg' was not found.\")",
" found = false;",
" jsonData.tempFiles.forEach((item) => {",
"",
" if (item.errorCode == \"400\") {",
" found = true;",
" }",
"",
" });",
" pm.expect(found).to.eq(true, \"Expected error code '400' not found.\")",
"});",
""
],
"type": "text/javascript"
@@ -388,6 +411,26 @@
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "tempFileName",