@ProcessMakerMichelangelo @RestAPI Feature: Dynaform Main Tests Requirements: a workspace with the process 14414793652a5d718b65590036026581 ("Sample Project #1") already loaded there are three activities in the process and a workspace with the process 42445320652cd534acb3824056962285 ("Sample Project #2 (DynaForms Resources)") already loaded, this process will be used for the import of Dynaform there are one dynaform in the process Background: Given that I have a valid access_token Scenario Outline: Get a List DynaForms of a Project Given I request "project//dynaforms" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" And the response has records Examples: | project | records | | 14414793652a5d718b65590036026581 | 0 | | 42445320652cd534acb3824056962285 | 1 | Scenario Outline: Normal Dynaform creation Given POST this data: """ { "dyn_title": "", "dyn_description": "", "dyn_type": "" } """ And I request "project//dynaform" And the content type is "application/json" Then the response status code should be 201 And the response charset is "UTF-8" And the type is "object" And store "dyn_uid" in session array as variable "dyn_uid_" Examples: | test_description | project | dyn_title | dyn_description | dyn_type | dyn_uid_number | | create dynaform xmlform P1 | 14414793652a5d718b65590036026581 | Dynaform - Normal | dyn normal P1 | xmlform | 1 | | create dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid | dyn grid P1 | grid | 2 | | create dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal | dyn normal P2 | xmlform | 3 | | create dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid | dyn grid P2 | grid | 4 | Scenario: Create dynaform with same name Given POST this data: """ { "dyn_title": "Dynaform - Normal", "dyn_description": "dyn normal P1", "dyn_type": "xmlform" } """ And I request "project/14414793652a5d718b65590036026581/dynaform" Then the response status code should be 400 And the response status message should have the following text "already exists" Scenario Outline: Create a Dynaform using the Copy/Import method Given POST this data: """ { "dyn_title": "", "dyn_description": "", "dyn_type": "", "copy_import": { "prj_uid": "", "dyn_uid": "" } } """ And I request "project//dynaform" And the content type is "application/json" Then the response status code should be 201 And the response charset is "UTF-8" And the type is "object" And store "dyn_uid" in session array as variable "dyn_uid_" Examples: | test_description | project | dyn_title | dyn_description | dyn_type | dyn_uid_number | copy_prj_uid | copy_dyn_uid | | create dynaform copy 1 | 14414793652a5d718b65590036026581 | Dynaform - Copy 1 | dyn copy | xmlform | 5 | 42445320652cd534acb3824056962285 | 70070685552cd53605650f7062918506 | | create dynaform copy 2 | 42445320652cd534acb3824056962285 | Dynaform - Copy 2 | dyn copy | xmlform | 6 | 42445320652cd534acb3824056962285 | 70070685552cd53605650f7062918506 | Scenario: Create a Dynaform using the Copy/Import with same name Given POST this data: """ { "dyn_title": "Dynaform - Copy 1", "dyn_description": "dyn copy", "dyn_type": "xmlform", "copy_import": { "prj_uid": "42445320652cd534acb3824056962285", "dyn_uid": "70070685552cd53605650f7062918506" } } """ And I request "project/14414793652a5d718b65590036026581/dynaform" Then the response status code should be 400 And the response status message should have the following text "already exists" Scenario Outline: Create dynaform based on a PMTable Given POST this data: """ { "dyn_title": "", "dyn_description": "", "dyn_type": "", "pmtable": { "tab_uid": "", "fields": [ { "fld_name": "", "pro_variable": "" } ] } } """ And I request "project//dynaform" And the content type is "application/json" Then the response status code should be 201 And the response charset is "UTF-8" And the type is "object" And store "dyn_uid" in session array as variable "dyn_uid_" Examples: | test_description | project | dyn_title | dyn_description | dyn_type | dyn_uid_number | tab_uid | fld_name_01 | pro_variable_01 | | create dynaform pmtable 1 | 14414793652a5d718b65590036026581 | Dynaform - pmtable 1 | dyn from pmtable1 | xmlform | 7 | 65193158852cc1a93a5a535084878044 | DYN_UID | @#APPLICATION | | create dynaform pmtable 2 | 42445320652cd534acb3824056962285 | Dynaform - pmtable2 | dyn from pmtable2 | xmlform | 8 | 65193158852cc1a93a5a535084878044 | DYN_UID | @#APPLICATION | Scenario: Create dynaform based on a PMTable with same name Given POST this data: """ { "dyn_title": "Dynaform - pmtable 1", "dyn_description": "dyn from pmtable1", "dyn_type": "xmlform", "pmtable": { "tab_uid": "65193158852cc1a93a5a535084878044", "fields": [ { "fld_name": "DYN_UID", "pro_variable": "@#APPLICATION " } ] } } """ And I request "project/14414793652a5d718b65590036026581/dynaform" And the content type is "application/json" Then the response status code should be 400 And the response status message should have the following text "already exists" Scenario Outline: Get a List DynaForms of a Project list when there are 9 records, total in both projects Given I request "project//dynaforms" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" And the response has records Examples: | project | records | | 14414793652a5d718b65590036026581 | 4 | | 42445320652cd534acb3824056962285 | 5 | Scenario Outline: Update the Dynaform and then check if the values had changed Given PUT this data: """ { "dyn_title": "", "dyn_description": "", "dyn_type": "" } """ And that I want to update a resource with the key "dyn_uid" stored in session array as variable "dyn_uid_" And I request "project//dynaform" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "object" Examples: | test_description | project | dyn_title | dyn_description | dyn_type | dyn_uid_number | | Update dynaform xmlform P1 | 14414793652a5d718b65590036026581 | My DynaForm1 Modified | My DynaForm1 DESCRIPTION Modified | grid | 1 | | Update dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid Modified | dyn grid P1 DESCRIPTION Modified | xmlform | 2 | | Update dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal Modified | dyn normal P2 DESCRIPTION Modified | grid | 3 | | Update dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid Modified | dyn grid P2 DESCRIPTION Modified | xmlform | 4 | Scenario Outline: Get a single dynaform and check some properties Given that I want to get a resource with the key "dyn_uid" stored in session array as variable "dyn_uid_" And I request "project//dynaform" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "object" And that "dyn_title" is set to "" And that "dyn_description" is set to "" And that "dyn_type" is set to "" Examples: | test_description | project | dyn_title | dyn_description | dyn_type | dyn_uid_number | | Update dynaform xmlform P1 | 14414793652a5d718b65590036026581 | My DynaForm1 Modified | My DynaForm1 DESCRIPTION Modified | grid | 1 | | Update dynaform grid P1 | 14414793652a5d718b65590036026581 | Dynaform - Grid Modified | dyn grid P1 DESCRIPTION Modified | xmlform | 2 | | Update dynaform xmlform P2 | 42445320652cd534acb3824056962285 | Dynaform - Normal Modified | dyn normal P2 DESCRIPTION Modified | grid | 3 | | Update dynaform grid P2 | 42445320652cd534acb3824056962285 | Dynaform - Grid Modified | dyn grid P2 DESCRIPTION Modified | xmlform | 4 | Scenario Outline: Delete all Dynaform created previously in this script Given that I want to delete a resource with the key "dyn_uid" stored in session array as variable "dyn_uid_" And I request "project//dynaform" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "object" Examples: | project | dyn_uid_number | | 14414793652a5d718b65590036026581 | 1 | | 14414793652a5d718b65590036026581 | 2 | | 42445320652cd534acb3824056962285 | 3 | | 42445320652cd534acb3824056962285 | 4 | | 14414793652a5d718b65590036026581 | 5 | | 42445320652cd534acb3824056962285 | 6 | | 14414793652a5d718b65590036026581 | 7 | | 42445320652cd534acb3824056962285 | 8 | Scenario Outline: Get a List DynaForms of a Project Given I request "project//dynaforms" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" And the response has records Examples: | project | records | | 14414793652a5d718b65590036026581 | 0 | | 42445320652cd534acb3824056962285 | 1 |