-
Notifications
You must be signed in to change notification settings - Fork 470
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
1 parent
f2c22b0
commit 953635f
Showing
3 changed files
with
163 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16326,6 +16326,164 @@ | |
"response": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "fireActionByName", | ||
"item": [ | ||
{ | ||
"name": "testArchiveContentlet", | ||
"item": [ | ||
{ | ||
"name": "Create ContentType", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"exec": [ | ||
"var jsonData = pm.response.json();", | ||
"", | ||
"pm.collectionVariables.set(\"contentTypeID\", jsonData.entity[0].id);", | ||
"pm.collectionVariables.set(\"contentTypeVAR\", jsonData.entity[0].variable);", | ||
"pm.collectionVariables.set(\"contentTypeFieldID\", jsonData.entity[0].fields[0].id);", | ||
"", | ||
"pm.test(\"Status code should be ok 200\", function () {", | ||
" pm.response.to.have.status(200);", | ||
"});", | ||
"", | ||
"pm.test(\"fields check\", function () {", | ||
" pm.expect(jsonData.entity[0].fields.length).to.eql(1);", | ||
"});", | ||
"", | ||
"pm.test(\"description check\", function () {", | ||
" pm.expect(jsonData.entity[0].description).to.eql('THE DESCRIPTION');", | ||
"});" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"auth": { | ||
"type": "basic", | ||
"basic": { | ||
"password": "admin", | ||
"username": "[email protected]", | ||
"showPassword": false | ||
} | ||
}, | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Content-Type", | ||
"name": "Content-Type", | ||
"type": "text", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\n \"clazz\": \"com.dotcms.contenttype.model.type.ImmutableSimpleContentType\", \n \"defaultType\": false, \n \"name\": \"Content Type Test\", \n \"description\": \"THE DESCRIPTION\", \n \"host\": \"SYSTEM_HOST\", \n \"owner\": \"dotcms.org.1\", \n \"fixed\": false, \n \"system\": false, \n \"folder\": \"SYSTEM_FOLDER\",\n \"fields\": [\n {\n \"dataType\": \"LONG_TEXT\",\n \"dbColumn\": \"text_area2\",\n \"fieldVariables\": [],\n \"fixed\": false,\n \"iDate\": 1453474468000,\n \"clazz\": \"com.dotcms.contenttype.model.field.ImmutableTextField\",\n \"indexed\": true,\n \"listed\": false,\n \"modDate\": 1478557845000,\n \"name\": \"Title\",\n \"readOnly\": false,\n \"required\": false,\n \"searchable\": true,\n \"sortOrder\": 3,\n \"unique\": false,\n \"variable\": \"title\"\n }],\n \"workflow\": [\"d61a59e1-a49c-46f2-a929-db2b4bfa88b2\"]\n}\n" | ||
}, | ||
"url": "{{serverURL}}/api/v1/contenttype", | ||
"description": "Given a content type payload containing field variables.\nWhen sending a POST.\nExpect that code is 200.\nExpect content type is created with the provided fields.\nExpect that new properties of content types are set (icon and sortOrder)." | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Create contentlet", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"exec": [ | ||
"var jsonData = pm.response.json();", | ||
"", | ||
"pm.test(\"Status code should be ok 200\", function () {", | ||
" pm.response.to.have.status(200);", | ||
"});", | ||
"", | ||
"pm.collectionVariables.set(\"contentletID\", jsonData.entity.identifier);", | ||
"pm.collectionVariables.set(\"contentletInode\", jsonData.entity.inode);" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"auth": { | ||
"type": "basic", | ||
"basic": { | ||
"password": "admin", | ||
"username": "[email protected]" | ||
} | ||
}, | ||
"method": "PUT", | ||
"header": [ | ||
{ | ||
"key": "Content-Type", | ||
"name": "Content-Type", | ||
"value": "application/json", | ||
"type": "text" | ||
} | ||
], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\n\t\"contentlet\":{\n\t\t\"stName\": \"{{contentTypeVAR}}\",\n\t\t\"title\": \"test contentlet\"\n\t}\n}" | ||
}, | ||
"url": "http://localhost:8080/api/v1/workflow/actions/default/fire/NEW" | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Archive contentlet", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"exec": [ | ||
"var jsonData = pm.response.json();", | ||
"", | ||
"pm.test(\"Status code should be ok 200\", function () {", | ||
" pm.response.to.have.status(200);", | ||
"});", | ||
"", | ||
"pm.test(\"Test the variable value\", function () {", | ||
" var jsonData = pm.response.json();", | ||
" var expectedValue = pm.collectionVariables.get(\"contentletID\");", | ||
" pm.expect(jsonData.entity.identifier).to.eql(expectedValue);", | ||
"});" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"auth": { | ||
"type": "basic", | ||
"basic": { | ||
"password": "admin", | ||
"username": "[email protected]", | ||
"showPassword": false | ||
} | ||
}, | ||
"method": "PUT", | ||
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": " {\n \"actionName\": \"Archive\",\n \"contentlet\" : {\n \"identifier\": \"{{contentletID}}\",\n \"inode\": \"{{contentletInode}}\"\n }\n}", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
} | ||
} | ||
}, | ||
"url": "{{serverURL}}/api/v1/workflow/actions/fire" | ||
}, | ||
"response": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"event": [ | ||
|
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