Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Files Manager Resources
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario: Get a list of main process files manager
|
||||
Given I request "project/1265557095225ff5c688f46031700471/process-file-manager"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
Scenario: Get a list public folder of process files manager
|
||||
Given I request "project/1265557095225ff5c688f46031700471/process-file-manager?path=public"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
Scenario: Get a list templates folder of process files manager
|
||||
Given I request "project/1265557095225ff5c688f46031700471/process-file-manager?path=templates"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
Scenario Outline: Post files
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"file_name": "<file_name>",
|
||||
"path": "<path>",
|
||||
"content": "<content>"
|
||||
}
|
||||
"""
|
||||
And I request "project/1265557095225ff5c688f46031700471/process-file-manager"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "<type>"
|
||||
And store "prf_uid" in session array as variable "prf_uid<i>"
|
||||
|
||||
Examples:
|
||||
| test_description | file_name | path | content | http_code | type | i |
|
||||
| into public folder | test.txt | public/ | test | 200 | object | 0 |
|
||||
| into maintemplates folder | test.txt | templates/ | test | 200 | object | 1 |
|
||||
| into public subfolder | test.txt | public/test_folder | test | 200 | object | 2 |
|
||||
| into public subfolder | test.txt | templates/test_folder | test | 200 | object | 3 |
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Post files
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"file_name": "<file_name>",
|
||||
"content": "<content>"
|
||||
}
|
||||
"""
|
||||
And I request "project/1265557095225ff5c688f46031700471/process-file-manager?path=<path>"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "<type>"
|
||||
|
||||
Examples:
|
||||
| test_description | file_name | path | content | http_code | type |
|
||||
| put into public folder | test.txt | public/ | put test | 200 | object |
|
||||
| put into maintemplates folder | test.txt | templates/ | put test | 200 | object |
|
||||
| put into public subfolder | test.txt | public/test_folder | put test | 200 | object |
|
||||
| put into public subfolder | test.txt | templates/test_folder | put test | 200 | object |
|
||||
|
||||
Scenario Outline: Delete User
|
||||
Given that I want to delete a "<path>"
|
||||
And I request "project/1265557095225ff5c688f46031700471/process-file-manager?path=<path>"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
| test_description | path |
|
||||
| put into public folder | public/test.txt |
|
||||
| put into maintemplates folder | templates/test.txt |
|
||||
| put into public subfolder | public/test_folder/test.txt |
|
||||
| put into public subfolder | templates/test_folder/test.txt |
|
||||
@@ -17,7 +17,7 @@ Feature: Output Documents Main Tests
|
||||
And the type is "array"
|
||||
And the response has 2 records
|
||||
And the "out_doc_title" property in row 0 equals "Endpoint Old Version (base)"
|
||||
And the "out_doc_title" property in row 1 equals "Endpoint New Version (base)
|
||||
And the "out_doc_title" property in row 1 equals "Endpoint New Version (base)"
|
||||
|
||||
|
||||
Scenario: Get a single output document of a project
|
||||
|
||||
@@ -32,8 +32,7 @@ Feature: PM Group Main Tests
|
||||
| Search letters 'de | de | 0 | 5 | 2 | 200 |
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Create new Group
|
||||
Scenario Outline: Create 3 new Groups
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
@@ -57,7 +56,7 @@ Feature: PM Group Main Tests
|
||||
| 2 | Demo Group3 for main behat | INACTIVE |
|
||||
|
||||
|
||||
Scenario: Get list Groups of workspace
|
||||
Scenario: Get the Groups list when there are 23 records
|
||||
And I request "groups?filter=&start=0&limit=50"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
@@ -107,7 +106,103 @@ Feature: PM Group Main Tests
|
||||
| 1 | Update Demo Group2 for main behat | INACTIVE |
|
||||
| 2 | Update Demo Group3 for main behat | ACTIVE |
|
||||
|
||||
|
||||
|
||||
#ASSIGN USER TO GROUP
|
||||
|
||||
Scenario Outline: Get list Users of workspace using different filters for a group
|
||||
And I request "group/36775342552d5674146d9c2078497230/users?filter=<filter>&start=<start>&limit=<limit>"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be <http_code>
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And the response has <record> record
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | filter | start | limit | record | http_code |
|
||||
| lowercase | admin | 0 | 9 | 0 | 200 |
|
||||
| uppercase | ADMIN | 0 | 9 | 0 | 200 |
|
||||
| limit=3 | a | 0 | 60 | 37 | 200 |
|
||||
| limit and start | a | 1 | 2 | 2 | 200 |
|
||||
| high number for start | a | 1000 | 1 | 0 | 200 |
|
||||
| high number for start | a | 1000 | 0 | 0 | 200 |
|
||||
| empty result | xyz | 0 | 0 | 0 | 200 |
|
||||
| empty string | | 0 | 10000 | 43 | 200 |
|
||||
| empty string | | 1 | 2 | 2 | 200 |
|
||||
| search 0 | 0 | 0 | 0 | 0 | 200 |
|
||||
| search 0 | 0 | 0 | 100 | 0 | 200 |
|
||||
| Search letters 'c' | c | 0 | 40 | 21 | 200 |
|
||||
| Search letters 'de | de | 0 | 5 | 1 | 200 |
|
||||
|
||||
|
||||
Scenario Outline: Assign users to groups created from the endpoint
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"usr_uid": "<usr_uid>"
|
||||
}
|
||||
"""
|
||||
And I request "group/grp_uid/user" with the key "grp_uid" stored in session array as variable "grp_uid_<grp_uid_number>"
|
||||
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"
|
||||
|
||||
Examples:
|
||||
| grp_uid_number | usr_uid |
|
||||
| 0 | 00000000000000000000000000000001 |
|
||||
| 1 | 51049032352d56710347233042615067 |
|
||||
| 2 | 25286582752d56713231082039265791 |
|
||||
|
||||
|
||||
Scenario Outline: List assigned Users to Group
|
||||
And I request "group/grp_uid/users" with the key "grp_uid" stored in session array as variable "grp_uid_<grp_uid_number>"
|
||||
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 "usr_uid" property in row 0 equals "<usr_uid>"
|
||||
And the "usr_username" property in row 0 equals "<usr_username>"
|
||||
And the "usr_status" property in row 0 equals "<usr_status>"
|
||||
|
||||
Examples:
|
||||
| grp_uid_number | usr_uid | usr_username | usr_status |
|
||||
| 0 | 00000000000000000000000000000001 | admin | ACTIVE |
|
||||
| 1 | 51049032352d56710347233042615067 | aaron | ACTIVE |
|
||||
| 2 | 25286582752d56713231082039265791 | amy | ACTIVE |
|
||||
|
||||
|
||||
Scenario Outline: List available Users to assign to Group
|
||||
And I request "group/grp_uid/available-users?filter=none" with the key "grp_uid" stored in session array as variable "grp_uid_<grp_uid_number>"
|
||||
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 json data is an empty array
|
||||
|
||||
Examples:
|
||||
| grp_uid_number |
|
||||
| 0 |
|
||||
| 1 |
|
||||
| 2 |
|
||||
|
||||
|
||||
Scenario Outline: Unassign User of the Group
|
||||
Given that I want to delete a resource with the key "<usr_uid>" stored in session array
|
||||
And I request "group/grp_uid/user/<usr_uid>" with the key "grp_uid" stored in session array as variable "grp_uid_<grp_uid_number>"
|
||||
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:
|
||||
|
||||
| grp_uid_number | usr_uid |
|
||||
| 0 | 00000000000000000000000000000001 |
|
||||
| 1 | 51049032352d56710347233042615067 |
|
||||
| 2 | 25286582752d56713231082039265791 |
|
||||
|
||||
|
||||
Scenario Outline: Delete all Group created previously in this script
|
||||
Given that I want to delete a resource with the key "grp_uid" stored in session array as variable "grp_uid_<grp_uid_number>"
|
||||
And I request "group"
|
||||
@@ -123,8 +218,6 @@ Feature: PM Group Main Tests
|
||||
| 1 |
|
||||
| 2 |
|
||||
|
||||
#GET /api/1.0/{workspace}/groups?filter=abc&start=0&limit=25
|
||||
# Get list Groups
|
||||
Scenario: Get list Groups
|
||||
And I request "groups?filter=Update Demo Gro"
|
||||
And the content type is "application/json"
|
||||
|
||||
@@ -35,8 +35,22 @@ Feature: PM Group Negative Tests
|
||||
|
||||
Examples:
|
||||
|
||||
| grp_title | grp_status | grp_title | error_code | error_message |
|
||||
| Field requered grp_title | ACTIVE | | 400 | grp_title |
|
||||
| Field requered grp_status | | test | 400 | grp_status |
|
||||
|
||||
|
||||
| grp_title | grp_uid_number | grp_status | grp_title | error_code | error_message |
|
||||
| Field required grp_title | 1 | ACTIVE | | 400 | grp_title |
|
||||
| Field required grp_status | 2 | | test | 400 | grp_status |
|
||||
| Create group with same name | 4 | ACTIVE | Employees | 400 | exists |
|
||||
|
||||
|
||||
|
||||
|
||||
Scenario: Assign users to groups exist in workspace with bad parameters (negative tests)
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"usr_uid": "0000000000000000444500000001"
|
||||
}
|
||||
"""
|
||||
And I request "group/66623507552d56742865613066097298/user"
|
||||
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 "usr_uid"
|
||||
1
features/backend/pm_user/main_tests_pm_user.feature
Normal file
1
features/backend/pm_user/main_tests_pm_user.feature
Normal file
@@ -0,0 +1 @@
|
||||
ygyfgy
|
||||
1
features/backend/pm_user/negative_tests_pm_user.feature
Normal file
1
features/backend/pm_user/negative_tests_pm_user.feature
Normal file
@@ -0,0 +1 @@
|
||||
jhjh
|
||||
51
features/backend/process/basic_sequence_process.feature
Normal file
51
features/backend/process/basic_sequence_process.feature
Normal file
@@ -0,0 +1,51 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Process of a Project Resources
|
||||
Requirements:
|
||||
a workspace with the process 14414793652a5d718b65590036026581 ("Sample Project #1") already loaded
|
||||
there are three activities in the process
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
#GET /api/1.0/{workspace}/project/{prj_uid}/process
|
||||
# Get a single Process
|
||||
Scenario Outline: Get a single Process
|
||||
Given that I want to get a resource with the key "obj_uid" stored in session array
|
||||
And I request "project/14414793652a5d718b65590036026581/process"
|
||||
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 "pro_title" is set to "<pro_title>"
|
||||
And that "pro_description" is set to "<pro_description>"
|
||||
And that "pro_status" is set to "<pro_status>"
|
||||
And that "pro_create_user" is set to "<pro_create_user>"
|
||||
And that "pro_debug" is set to "<pro_debug>"
|
||||
|
||||
Examples:
|
||||
| pro_title | pro_description | pro_status | pro_create_user | pro_debug |
|
||||
| Sample Project #1 | | ACTIVE | 00000000000000000000000000000001 | 0 |
|
||||
|
||||
#PUT /api/1.0/{workspace}/project/{prj_uid}/process
|
||||
# Update Process
|
||||
Scenario Outline: Update Process
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"pro_title": "<pro_title>",
|
||||
"pro_description": "<pro_description>",
|
||||
"pro_status": "<pro_status>",
|
||||
"pro_create_user": "<pro_create_user>",
|
||||
"pro_debug": <pro_debug>
|
||||
}
|
||||
"""
|
||||
And I request "project/14414793652a5d718b65590036026581/process"
|
||||
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:
|
||||
| pro_title | pro_description | pro_status | pro_create_user | pro_debug |
|
||||
| Sample Project #1 | | ACTIVE | 00000000000000000000000000000001 | 0 |
|
||||
|
||||
229
features/backend/process/main_tests_process.feature
Normal file
229
features/backend/process/main_tests_process.feature
Normal file
@@ -0,0 +1,229 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Process of a Project Resources
|
||||
Requirements:
|
||||
a workspace with the process 79409754952f8f5110c4342001470580 ("Test Process 2") and there are two activities
|
||||
and workspace with the process 58773281752f50297d6bf00047802053 ("Test Process 1") and there are two activities, in the process already loaded
|
||||
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario Outline: Get a single Process
|
||||
Given that I want to get a resource with the key "obj_uid" stored in session array
|
||||
And I request "project/<project>/process"
|
||||
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 "pro_title" is set to "<pro_title>"
|
||||
And that "pro_description" is set to "<pro_description>"
|
||||
And that "pro_parent" is set to "<pro_parent>"
|
||||
And that "pro_time" is set to "<pro_time>"
|
||||
And that "pro_timeunit" is set to "<pro_timeunit>"
|
||||
And that "pro_status" is set to "<pro_status>"
|
||||
And that "pro_type_day" is set to "<pro_type_day>"
|
||||
And that "pro_type" is set to "<pro_type>"
|
||||
And that "pro_assignment" is set to "<pro_assignment>"
|
||||
And that "pro_show_map" is set to "<pro_show_map>"
|
||||
And that "pro_show_message" is set to "<pro_show_message>"
|
||||
And that "pro_subprocess" is set to "<pro_subprocess>"
|
||||
And that "pro_tri_deleted" is set to "<pro_tri_deleted>"
|
||||
And that "pro_tri_canceled" is set to "<pro_tri_canceled>"
|
||||
And that "pro_tri_paused" is set to "<pro_tri_paused>"
|
||||
And that "pro_tri_reassigned" is set to "<pro_tri_reassigned>"
|
||||
And that "pro_show_delegate" is set to "<pro_show_delegate>"
|
||||
And that "pro_show_dynaform" is set to "<pro_show_dynaform>"
|
||||
And that "pro_category" is set to "<pro_category>"
|
||||
And that "pro_sub_category" is set to "<pro_sub_category>"
|
||||
And that "pro_industry" is set to "<pro_industry>"
|
||||
And that "pro_update_date" is set to "<pro_update_date>"
|
||||
And that "pro_create_date" is set to "<pro_create_date>"
|
||||
And that "pro_create_user" is set to "<pro_create_user>"
|
||||
And that "pro_debug" is set to "<pro_debug>"
|
||||
And that "pro_derivation_screen_tpl" is set to "<pro_derivation_screen_tpl>"
|
||||
And that "pro_summary_dynaform" is set to "<pro_summary_dynaform>"
|
||||
And that "pro_calendar" is set to "<pro_calendar>"
|
||||
|
||||
|
||||
Examples:
|
||||
| project | pro_title | pro_description | pro_parent | pro_time | pro_timeunit | pro_status | pro_type_day | pro_type | pro_assignment | pro_show_map | pro_show_message | pro_subprocess | pro_tri_deleted | pro_tri_canceled | pro_tri_paused | pro_tri_reassigned | pro_show_delegate | pro_show_dynaform | pro_category | pro_sub_category | pro_industry | pro_update_date | pro_create_date | pro_create_user | pro_debug | pro_derivation_screen_tpl | pro_summary_dynaform | pro_calendar |
|
||||
| 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | null | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | |
|
||||
| 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | null | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | |
|
||||
|
||||
|
||||
Scenario Outline: Update Process
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"pro_title" : "<pro_title>",
|
||||
"pro_description" : "<pro_description>",
|
||||
"pro_parent" : "<pro_parent>",
|
||||
"pro_time" : "<pro_time>",
|
||||
"pro_timeunit" : "<pro_timeunit>",
|
||||
"pro_status" : "<pro_status>",
|
||||
"pro_type_day" : "<pro_type_day>",
|
||||
"pro_type" : "<pro_type>",
|
||||
"pro_assignment" : "<pro_assignment>",
|
||||
"pro_show_map" : "<pro_show_map>",
|
||||
"pro_show_message" : "<pro_show_message>",
|
||||
"pro_subprocess" : "<pro_subprocess>",
|
||||
"pro_tri_deleted" : "<pro_tri_deleted>",
|
||||
"pro_tri_canceled" : "<pro_tri_canceled>",
|
||||
"pro_tri_paused" : "<pro_tri_paused>",
|
||||
"pro_tri_reassigned" : "<pro_tri_reassigned>",
|
||||
"pro_show_delegate" : "<pro_show_delegate>",
|
||||
"pro_show_dynaform" : "<pro_show_dynaform>",
|
||||
"pro_category" : "<pro_category>",
|
||||
"pro_sub_category" : "<pro_sub_category>",
|
||||
"pro_industry" : "<pro_industry>",
|
||||
"pro_update_date" : "<pro_update_date>",
|
||||
"pro_create_date" : "<pro_create_date>",
|
||||
"pro_create_user" : "<pro_create_user>",
|
||||
"pro_debug" : "<pro_debug>",
|
||||
"pro_derivation_screen_tpl": "<pro_derivation_screen_tpl>",
|
||||
"pro_summary_dynaform" : "<pro_summary_dynaform>",
|
||||
"pro_calendar" : "<pro_calendar>"
|
||||
}
|
||||
"""
|
||||
And I request "project/<project>/process"
|
||||
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 | pro_title | pro_description | pro_parent | pro_time | pro_timeunit | pro_status | pro_type_day | pro_type | pro_assignment | pro_show_map | pro_show_message | pro_subprocess | pro_tri_deleted | pro_tri_canceled | pro_tri_paused | pro_tri_reassigned | pro_show_delegate | pro_show_dynaform | pro_category | pro_sub_category | pro_industry | pro_update_date | pro_create_date | pro_create_user | pro_debug | pro_derivation_screen_tpl | pro_summary_dynaform | pro_calendar |
|
||||
| 79409754952f8f5110c4342001470580 | Update Test Process 1 | Update Process - PUT | 79409754952f8f5110c4342001470580 | 1 | DAYS | INACTIVE | | NORMAL | 1 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-01-10 09:43:36 | 2015-12-09 09:43:36 | 00000000000000000000000000000001 | 0 | | | |
|
||||
| 58773281752f50297d6bf00047802053 | Update Test Process 2 | Update Process - PUT | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 1 | 1 | 1 | 69112537052f503b53142c2026229055 | 30169571352f50349539aa7005920345 | 45413889552f5037587e5a4073302257 | 23429991752f5035c3eab21091451118 | 1 | 0 | 77488943552f502c3d7f649000082980 | | 0 | 2014-01-10 09:43:36 | 2014-02-07 10:58:15 | 51049032352d56710347233042615067 | 1 | tplScreen.html | 94906672952f5058bf3f0f8012616448 | 99159704252f501c63f8c58025859967 |
|
||||
|
||||
|
||||
Scenario Outline: Get a single Process
|
||||
Given that I want to get a resource with the key "obj_uid" stored in session array
|
||||
And I request "project/<project>/process"
|
||||
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 "pro_title" is set to "<pro_title>"
|
||||
And that "pro_description" is set to "<pro_description>"
|
||||
And that "pro_parent" is set to "<pro_parent>"
|
||||
And that "pro_time" is set to "<pro_time>"
|
||||
And that "pro_timeunit" is set to "<pro_timeunit>"
|
||||
And that "pro_status" is set to "<pro_status>"
|
||||
And that "pro_type_day" is set to "<pro_type_day>"
|
||||
And that "pro_type" is set to "<pro_type>"
|
||||
And that "pro_assignment" is set to "<pro_assignment>"
|
||||
And that "pro_show_map" is set to "<pro_show_map>"
|
||||
And that "pro_show_message" is set to "<pro_show_message>"
|
||||
And that "pro_subprocess" is set to "<pro_subprocess>"
|
||||
And that "pro_tri_deleted" is set to "<pro_tri_deleted>"
|
||||
And that "pro_tri_canceled" is set to "<pro_tri_canceled>"
|
||||
And that "pro_tri_paused" is set to "<pro_tri_paused>"
|
||||
And that "pro_tri_reassigned" is set to "<pro_tri_reassigned>"
|
||||
And that "pro_show_delegate" is set to "<pro_show_delegate>"
|
||||
And that "pro_show_dynaform" is set to "<pro_show_dynaform>"
|
||||
And that "pro_category" is set to "<pro_category>"
|
||||
And that "pro_sub_category" is set to "<pro_sub_category>"
|
||||
And that "pro_industry" is set to "<pro_industry>"
|
||||
And that "pro_update_date" is set to "<pro_update_date>"
|
||||
And that "pro_create_date" is set to "<pro_create_date>"
|
||||
And that "pro_create_user" is set to "<pro_create_user>"
|
||||
And that "pro_debug" is set to "<pro_debug>"
|
||||
And that "pro_derivation_screen_tpl" is set to "<pro_derivation_screen_tpl>"
|
||||
And that "pro_summary_dynaform" is set to "<pro_summary_dynaform>"
|
||||
And that "pro_calendar" is set to "<pro_calendar>"
|
||||
|
||||
|
||||
Examples:
|
||||
| project | pro_title | pro_description | pro_parent | pro_time | pro_timeunit | pro_status | pro_type_day | pro_type | pro_assignment | pro_show_map | pro_show_message | pro_subprocess | pro_tri_deleted | pro_tri_canceled | pro_tri_paused | pro_tri_reassigned | pro_show_delegate | pro_show_dynaform | pro_category | pro_sub_category | pro_industry | pro_update_date | pro_create_date | pro_create_user | pro_debug | pro_derivation_screen_tpl | pro_summary_dynaform | pro_calendar |
|
||||
| 79409754952f8f5110c4342001470580 | Update Sample Project #1 | Update Process - PUT | 79409754952f8f5110c4342001470580 | 1 | DAYS | INACTIVE | | NORMAL | 1 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-01-10 09:43:36 | 2015-12-09 09:43:36 | 00000000000000000000000000000001 | 0 | | | |
|
||||
| 58773281752f50297d6bf00047802053 | Update Test Process | Update Process - PUT | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 1 | 1 | 1 | 69112537052f503b53142c2026229055 | 30169571352f50349539aa7005920345 | 45413889552f5037587e5a4073302257 | 23429991752f5035c3eab21091451118 | 1 | 0 | 77488943552f502c3d7f649000082980 | | 0 | 2014-01-10 09:43:36 | 2014-02-07 10:58:15 | 51049032352d56710347233042615067 | 1 | tplScreen.html | 94906672952f5058bf3f0f8012616448 | 14606161052f50839307899033145440 |
|
||||
|
||||
|
||||
Scenario Outline: Update Process
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"pro_title" : "<pro_title>",
|
||||
"pro_description" : "<pro_description>",
|
||||
"pro_parent" : "<pro_parent>",
|
||||
"pro_time" : "<pro_time>",
|
||||
"pro_timeunit" : "<pro_timeunit>",
|
||||
"pro_status" : "<pro_status>",
|
||||
"pro_type_day" : "<pro_type_day>",
|
||||
"pro_type" : "<pro_type>",
|
||||
"pro_assignment" : "<pro_assignment>",
|
||||
"pro_show_map" : "<pro_show_map>",
|
||||
"pro_show_message" : "<pro_show_message>",
|
||||
"pro_subprocess" : "<pro_subprocess>",
|
||||
"pro_tri_deleted" : "<pro_tri_deleted>",
|
||||
"pro_tri_canceled" : "<pro_tri_canceled>",
|
||||
"pro_tri_paused" : "<pro_tri_paused>",
|
||||
"pro_tri_reassigned" : "<pro_tri_reassigned>",
|
||||
"pro_show_delegate" : "<pro_show_delegate>",
|
||||
"pro_show_dynaform" : "<pro_show_dynaform>",
|
||||
"pro_category" : "<pro_category>",
|
||||
"pro_sub_category" : "<pro_sub_category>",
|
||||
"pro_industry" : "<pro_industry>",
|
||||
"pro_update_date" : "<pro_update_date>",
|
||||
"pro_create_date" : "<pro_create_date>",
|
||||
"pro_create_user" : "<pro_create_user>",
|
||||
"pro_debug" : "<pro_debug>",
|
||||
"pro_derivation_screen_tpl": "<pro_derivation_screen_tpl>",
|
||||
"pro_summary_dynaform" : "<pro_summary_dynaform>",
|
||||
"pro_calendar" : "<pro_calendar>"
|
||||
}
|
||||
"""
|
||||
And I request "project/<project>/process"
|
||||
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 | pro_title | pro_description | pro_parent | pro_time | pro_timeunit | pro_status | pro_type_day | pro_type | pro_assignment | pro_show_map | pro_show_message | pro_subprocess | pro_tri_deleted | pro_tri_canceled | pro_tri_paused | pro_tri_reassigned | pro_show_delegate | pro_show_dynaform | pro_category | pro_sub_category | pro_industry | pro_update_date | pro_create_date | pro_create_user | pro_debug | pro_derivation_screen_tpl | pro_summary_dynaform | pro_calendar |
|
||||
| 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:49:37 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | |
|
||||
| 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:49:37 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | |
|
||||
|
||||
|
||||
Scenario Outline: Get a single Process
|
||||
Given that I want to get a resource with the key "obj_uid" stored in session array
|
||||
And I request "project/<project>/process"
|
||||
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 "pro_title" is set to "<pro_title>"
|
||||
And that "pro_description" is set to "<pro_description>"
|
||||
And that "pro_parent" is set to "<pro_parent>"
|
||||
And that "pro_time" is set to "<pro_time>"
|
||||
And that "pro_timeunit" is set to "<pro_timeunit>"
|
||||
And that "pro_status" is set to "<pro_status>"
|
||||
And that "pro_type_day" is set to "<pro_type_day>"
|
||||
And that "pro_type" is set to "<pro_type>"
|
||||
And that "pro_assignment" is set to "<pro_assignment>"
|
||||
And that "pro_show_map" is set to "<pro_show_map>"
|
||||
And that "pro_show_message" is set to "<pro_show_message>"
|
||||
And that "pro_subprocess" is set to "<pro_subprocess>"
|
||||
And that "pro_tri_deleted" is set to "<pro_tri_deleted>"
|
||||
And that "pro_tri_canceled" is set to "<pro_tri_canceled>"
|
||||
And that "pro_tri_paused" is set to "<pro_tri_paused>"
|
||||
And that "pro_tri_reassigned" is set to "<pro_tri_reassigned>"
|
||||
And that "pro_show_delegate" is set to "<pro_show_delegate>"
|
||||
And that "pro_show_dynaform" is set to "<pro_show_dynaform>"
|
||||
And that "pro_category" is set to "<pro_category>"
|
||||
And that "pro_sub_category" is set to "<pro_sub_category>"
|
||||
And that "pro_industry" is set to "<pro_industry>"
|
||||
And that "pro_update_date" is set to "<pro_update_date>"
|
||||
And that "pro_create_date" is set to "<pro_create_date>"
|
||||
And that "pro_create_user" is set to "<pro_create_user>"
|
||||
And that "pro_debug" is set to "<pro_debug>"
|
||||
And that "pro_derivation_screen_tpl" is set to "<pro_derivation_screen_tpl>"
|
||||
And that "pro_summary_dynaform" is set to "<pro_summary_dynaform>"
|
||||
And that "pro_calendar" is set to "<pro_calendar>"
|
||||
|
||||
|
||||
Examples:
|
||||
| project | pro_title | pro_description | pro_parent | pro_time | pro_timeunit | pro_status | pro_type_day | pro_type | pro_assignment | pro_show_map | pro_show_message | pro_subprocess | pro_tri_deleted | pro_tri_canceled | pro_tri_paused | pro_tri_reassigned | pro_show_delegate | pro_show_dynaform | pro_category | pro_sub_category | pro_industry | pro_update_date | pro_create_date | pro_create_user | pro_debug | pro_derivation_screen_tpl | pro_summary_dynaform | pro_calendar |
|
||||
| 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | null | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | |
|
||||
| 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | null | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | |
|
||||
76
features/backend/process/negative_tests_process.feature
Normal file
76
features/backend/process/negative_tests_process.feature
Normal file
@@ -0,0 +1,76 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Process of a Project Resources Negative Tests
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario Outline: Update Process
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"pro_title" : "<pro_title>",
|
||||
"pro_description" : "<pro_description>",
|
||||
"pro_parent" : "<pro_parent>",
|
||||
"pro_time" : "<pro_time>",
|
||||
"pro_timeunit" : "<pro_timeunit>",
|
||||
"pro_status" : "<pro_status>",
|
||||
"pro_type_day" : "<pro_type_day>",
|
||||
"pro_type" : "<pro_type>",
|
||||
"pro_assignment" : "<pro_assignment>",
|
||||
"pro_show_map" : "<pro_show_map>",
|
||||
"pro_show_message" : "<pro_show_message>",
|
||||
"pro_subprocess" : "<pro_subprocess>",
|
||||
"pro_tri_deleted" : "<pro_tri_deleted>",
|
||||
"pro_tri_canceled" : "<pro_tri_canceled>",
|
||||
"pro_tri_paused" : "<pro_tri_paused>",
|
||||
"pro_tri_reassigned" : "<pro_tri_reassigned>",
|
||||
"pro_show_delegate" : "<pro_show_delegate>",
|
||||
"pro_show_dynaform" : "<pro_show_dynaform>",
|
||||
"pro_category" : "<pro_category>",
|
||||
"pro_sub_category" : "<pro_sub_category>",
|
||||
"pro_industry" : "<pro_industry>",
|
||||
"pro_update_date" : "<pro_update_date>",
|
||||
"pro_create_date" : "<pro_create_date>",
|
||||
"pro_create_user" : "<pro_create_user>",
|
||||
"pro_debug" : "<pro_debug>",
|
||||
"pro_derivation_screen_tpl": "<pro_derivation_screen_tpl>",
|
||||
"pro_summary_dynaform" : "<pro_summary_dynaform>",
|
||||
"pro_calendar" : "<pro_calendar>"
|
||||
}
|
||||
"""
|
||||
And I request "project/<project>/process"
|
||||
Then the response status code should be <error_code>
|
||||
And the response status message should have the following text "<error_message>"
|
||||
|
||||
Examples:
|
||||
| test_description | project | pro_title | pro_description | pro_parent | pro_time | pro_timeunit | pro_status | pro_type_day | pro_type | pro_assignment | pro_show_map | pro_show_message | pro_subprocess | pro_tri_deleted | pro_tri_canceled | pro_tri_paused | pro_tri_reassigned | pro_show_delegate | pro_show_dynaform | pro_category | pro_sub_category | pro_industry | pro_update_date | pro_create_date | pro_create_user | pro_debug | pro_derivation_screen_tpl | pro_summary_dynaform | pro_calendar | error_code | error_message |
|
||||
| Invalid prj_uid | 79409700000000000004342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | prj_uid |
|
||||
| Invalid pro_parent | 58773281752f50297d6bf00047802053 | Test Process 1 | | 5877300000000000006bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_parent |
|
||||
| Invalid pro_time | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 5 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_time |
|
||||
| Invalid pro_timeunit | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | HOURS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_timeunit |
|
||||
| Invalid pro_status | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | VALOR | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_status |
|
||||
| Invalid pro_type | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | INPUT | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_type |
|
||||
| Invalid pro_assignment | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 4 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_assignment |
|
||||
| Invalid pro_show_map | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 5 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_show_map |
|
||||
| Invalid pro_show_message | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 4 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_show_message |
|
||||
| Invalid pro_subprocess | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 4 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_subprocess |
|
||||
| Invalid pro_tri_deleted | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | 4541388955000000000e5a4073302257 | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_tri_deleted |
|
||||
| Invalid pro_tri_canceled | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | 4541380000000000087e5a4073302257 | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_tri_canceled |
|
||||
| Invalid pro_tri_paused | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | 4541388900000000087e5a4073302257 | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_tri_paused |
|
||||
| Invalid pro_tri_reassigned | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | 4541380000000000000e5a4073302257 | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_tri_reassigned |
|
||||
| Invalid pro_show_delegate | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 5 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_show_delegate |
|
||||
| Invalid pro_show_dynaform | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 8 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_show_dynaform |
|
||||
| Invalid pro_category | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | 4541380000000000000e5a4073302257 | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_category |
|
||||
| Invalid pro_industry | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 4 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_industry |
|
||||
| Invalid pro_create_date | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 01-98-2014 110:49:37 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_create_date |
|
||||
| Invalid pro_create_user | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 0000000000003551 | 0 | | | | 400 | pro_create_user |
|
||||
| Invalid pro_debug | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 5 | | | | 400 | pro_debug |
|
||||
| Invalid pro_summary_dynaform | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | 954104947190420f51086854718 | | 400 | pro_summary_dynaform |
|
||||
| Invalid pro_calendar | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | 954104947190420f51086854718 | 400 | pro_calendar |
|
||||
| Field required prj_uid | | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | prj_uid |
|
||||
| Same Name pro_title | 79409754952f8f5110c4342001470580 | Test | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 200 | |
|
||||
| Same Name pro_title | 58773281752f50297d6bf00047802053 | Test | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-10 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 400 | pro_title |
|
||||
| Set initial values | 79409754952f8f5110c4342001470580 | Test Process 2 | | 79409754952f8f5110c4342001470580 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-11 10:58:15 | 2014-02-10 10:49:37 | 00000000000000000000000000000001 | 0 | | | | 200 | |
|
||||
| Set initial values | 58773281752f50297d6bf00047802053 | Test Process 1 | | 58773281752f50297d6bf00047802053 | 1 | DAYS | ACTIVE | | NORMAL | 0 | 0 | 0 | 0 | | | | | 0 | 0 | | | 0 | 2014-02-11 10:58:15 | 2014-02-07 10:58:15 | 00000000000000000000000000000001 | 0 | | | | 200 | |
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ Requirements:
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
|
||||
Scenario: Verify that there are no report tables
|
||||
Given I request "project/922677707524ac7417ce345089010125/report-tables"
|
||||
Then the response status code should be 200
|
||||
@@ -53,9 +51,10 @@ Scenario Outline: Create new report tables from dynaform and grid
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
|
||||
| | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 |
|
||||
| | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc 2 | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 |
|
||||
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
|
||||
| Create a Report Table - Normal | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 |
|
||||
| Create a Report Table - Grid | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc 2 | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 |
|
||||
|
||||
|
||||
Scenario: Verify that there are 2 report tables
|
||||
Given I request "project/922677707524ac7417ce345089010125/report-tables"
|
||||
@@ -64,8 +63,6 @@ Scenario: Verify that there are 2 report tables
|
||||
And the response has 2 record
|
||||
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Update a created report tables
|
||||
Given PUT this data:
|
||||
"""
|
||||
@@ -103,9 +100,9 @@ Scenario Outline: Update a created report tables
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
|
||||
| | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
|
||||
| Update a Report Table - Normal | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| Update a Report Table - Grid | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
|
||||
|
||||
Scenario Outline: Get a details of created report tables
|
||||
@@ -119,9 +116,9 @@ Scenario Outline: Get a details of created report tables
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
|
||||
| | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
|
||||
| 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
|
||||
|
||||
Scenario Outline: Populate report tables
|
||||
@@ -131,9 +128,9 @@ Scenario Outline: Populate report tables
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
|
||||
| | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 |
|
||||
| Populate Report Table Normal | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
| Populate Report Table Grid | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 |
|
||||
|
||||
|
||||
|
||||
@@ -146,9 +143,10 @@ Scenario Outline: Delete a created report tables
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | project | rep_uid_number |
|
||||
| | 922677707524ac7417ce345089010125 | 100 |
|
||||
| | 922677707524ac7417ce345089010125 | 200 |
|
||||
| test_description | project | rep_uid_number |
|
||||
| Delete Report Table Normal | 922677707524ac7417ce345089010125 | 1 |
|
||||
| Delete Report Table Grid | 922677707524ac7417ce345089010125 | 2 |
|
||||
|
||||
|
||||
Scenario: Verify that the report tables were deleted correctly
|
||||
Given I request "project/922677707524ac7417ce345089010125/report-tables"
|
||||
|
||||
@@ -1,5 +1,75 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: DataBase Connections
|
||||
Feature: DataBase Connections Negative Tests
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario Outline: Create new report tables from dynaform and grid with bad parameters (negative tests)
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"rep_tab_name" : "<rep_tab_name>",
|
||||
"rep_tab_dsc" : "<rep_tab_dsc>",
|
||||
"rep_tab_connection" : "<rep_tab_connection>",
|
||||
"rep_tab_type" : "<rep_tab_type>",
|
||||
"rep_tab_grid" : "<rep_tab_grid>",
|
||||
"fields" : [
|
||||
{
|
||||
"fld_dyn" : "<fld_dyn_1>",
|
||||
"fld_name" : "<fld_name_1>",
|
||||
"fld_label" : "<fld_label_1>",
|
||||
"fld_type" : "<fld_type_1>",
|
||||
"fld_size" : "<fld_size_1>"
|
||||
},{
|
||||
"fld_dyn" : "<fld_dyn_2>",
|
||||
"fld_name" : "<fld_name_2>",
|
||||
"fld_label" : "<fld_label_2>",
|
||||
"fld_type" : "<fld_type_2>",
|
||||
"fld_size" : "<fld_size_2>"
|
||||
},{
|
||||
"fld_dyn" : "<fld_dyn_3>",
|
||||
"fld_name" : "<fld_name_3>",
|
||||
"fld_label" : "<fld_label_3>",
|
||||
"fld_type" : "<fld_type_3>",
|
||||
"fld_size" : "<fld_size_3>"
|
||||
}
|
||||
]
|
||||
}
|
||||
"""
|
||||
And I request "project/<project>/report-table"
|
||||
Then the response status code should be <error_code>
|
||||
And store "rep_uid" in session array as variable "rep_uid_<rep_uid_number>"
|
||||
And the response status message should have the following text "<error_message>"
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | error_code | error_message |
|
||||
| Field required rep_tab_name | 922677707524ac7417ce345089010125 | 1 | | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | rep_tab_name |
|
||||
| Field required rep_tab_dsc | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | rep_tab_dsc |
|
||||
| Field required rep_tab_connection | 922677707524ac7417ce345089010125 | 3 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | rep_tab_connection |
|
||||
| Field required fld_type | 922677707524ac7417ce345089010125 | 4 | REPORT_TABLE_2 | Report Table Desc 2 | workflow | | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | fld_type |
|
||||
| Field required fld_name | 922677707524ac7417ce345089010125 | 5 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | | Name Any | VARCHAR | 64 | date1 | | Date | DATE | | | | Custom Field 1 | VARCHAR | 15 | 400 | fld_name |
|
||||
| Field required fld_label | 922677707524ac7417ce345089010125 | 6 | REPORT_TABLE_2 | Report Table Desc 2 | | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | | VARCHAR | 64 | fecha1 | DATE_1 | | DATE | | | CUSTOM_FIELD_1 | | VARCHAR | 15 | 400 | fld_label |
|
||||
| The name is too short | 922677707524ac7417ce345089010125 | 7 | RE | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | characters |
|
||||
| Field required Project | 92267000000000000000000089010125 | 8 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | prj_uid |
|
||||
| Invalid rep_tab_connection | 922677707524ac7417ce345089010125 | 9 | REPORT_TABLE_2 | Report Table Desc 2 | sample | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | rep_tab_connection |
|
||||
| Invalid rep_tab_type | 922677707524ac7417ce345089010125 | 10 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | INPUT | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | rep_tab_type |
|
||||
| Invalid fld_type | 922677707524ac7417ce345089010125 | 11 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | SAMPLE | 64 | date1 | DATE_1 | Date | SAMPLE | | | CUSTOM_FIELD_1 | Custom Field 1 | SAMPLE | 15 | 400 | fld_type |
|
||||
| Invalid fld_size | 922677707524ac7417ce345089010125 | 12 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64,34.55 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 64,34.55 | 400 | fld_size |
|
||||
| Invalid rep_tab_grid | 922677707524ac7417ce345089010125 | 13 | REPORT_TABLE_2 | Report Table Desc 2 | workflow | GRID | 26748060000000000000000000484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | rep_tab_grid |
|
||||
| Create same rep_tab_name | 922677707524ac7417ce345089010125 | 14 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 200 | |
|
||||
| Create same rep_tab_name | 922677707524ac7417ce345089010125 | 15 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | 400 | already exits |
|
||||
|
||||
|
||||
Scenario Outline: Delete a created report tables
|
||||
Given that I want to delete a resource with the key "rep_uid" stored in session array as variable "rep_uid_<rep_uid_number>"
|
||||
And I request "project/<project>/report-table"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | project | rep_uid_number |
|
||||
| Delete Report Table Normal | 922677707524ac7417ce345089010125 | 14 |
|
||||
8
gulliver/js/codemirror/.gitattributes
vendored
Normal file
8
gulliver/js/codemirror/.gitattributes
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
*.txt text
|
||||
*.js text
|
||||
*.html text
|
||||
*.md text
|
||||
*.json text
|
||||
*.yml text
|
||||
*.css text
|
||||
*.svg text
|
||||
6
gulliver/js/codemirror/.gitignore
vendored
Normal file
6
gulliver/js/codemirror/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/node_modules
|
||||
/npm-debug.log
|
||||
test.html
|
||||
.tern-*
|
||||
*~
|
||||
*.swp
|
||||
3
gulliver/js/codemirror/.travis.yml
Normal file
3
gulliver/js/codemirror/.travis.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.8
|
||||
300
gulliver/js/codemirror/AUTHORS
Normal file
300
gulliver/js/codemirror/AUTHORS
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,12 +4,12 @@
|
||||
- [Submitting bug reports](#submitting-bug-reports-)
|
||||
- [Contributing code](#contributing-code-)
|
||||
|
||||
## Getting help [^](#how-to-contribute)
|
||||
## Getting help
|
||||
|
||||
Community discussion, questions, and informal bug reporting is done on the
|
||||
[CodeMirror Google group](http://groups.google.com/group/codemirror).
|
||||
|
||||
## Submitting bug reports [^](#how-to-contribute)
|
||||
## Submitting bug reports
|
||||
|
||||
The preferred way to report bugs is to use the
|
||||
[GitHub issue tracker](http://github.com/marijnh/CodeMirror/issues). Before
|
||||
@@ -45,7 +45,7 @@ should be asked on the
|
||||
[jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and
|
||||
include the resulting link in your bug report.
|
||||
|
||||
## Contributing code [^](#how-to-contribute)
|
||||
## Contributing code
|
||||
|
||||
- Make sure you have a [GitHub Account](https://github.com/signup/free)
|
||||
- Fork [CodeMirror](https://github.com/marijnh/CodeMirror/)
|
||||
@@ -56,6 +56,8 @@ should be asked on the
|
||||
test suite under `mode/XXX/test.js`. Feel free to add new test
|
||||
suites to modes that don't have one yet (be sure to link the new
|
||||
tests into `test/index.html`).
|
||||
- Follow the general code style of the rest of the project (see
|
||||
below). Run `bin/lint` to verify that the linter is happy.
|
||||
- Make sure all tests pass. Visit `test/index.html` in your browser to
|
||||
run them.
|
||||
- Submit a pull request
|
||||
@@ -65,6 +67,6 @@ should be asked on the
|
||||
|
||||
- 2 spaces per indentation level, no tabs.
|
||||
- Include semicolons after statements.
|
||||
- Note that the linter (`test/lint/lint.js`) which is run after each
|
||||
commit complains about unused variables and functions. Prefix their
|
||||
names with an underscore to muffle it.
|
||||
- Note that the linter (`bin/lint`) which is run after each commit
|
||||
complains about unused variables and functions. Prefix their names
|
||||
with an underscore to muffle it.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 2013 by Marijn Haverbeke <marijnh@gmail.com>
|
||||
Copyright (C) 2013 by Marijn Haverbeke <marijnh@gmail.com> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -17,7 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
Please note that some subdirectories of the CodeMirror distribution
|
||||
include their own LICENSE files, and are released under different
|
||||
licences.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# CodeMirror [](http://travis-ci.org/marijnh/CodeMirror)
|
||||
# CodeMirror
|
||||
[](http://travis-ci.org/marijnh/CodeMirror)
|
||||
[](http://badge.fury.io/js/codemirror)
|
||||
|
||||
CodeMirror is a JavaScript component that provides a code editor in
|
||||
the browser. When a mode is available for the language you are coding
|
||||
|
||||
149
gulliver/js/codemirror/addon/comment/comment.js
vendored
Normal file
149
gulliver/js/codemirror/addon/comment/comment.js
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var noOptions = {};
|
||||
var nonWS = /[^\s\u00a0]/;
|
||||
var Pos = CodeMirror.Pos;
|
||||
|
||||
function firstNonWS(str) {
|
||||
var found = str.search(nonWS);
|
||||
return found == -1 ? 0 : found;
|
||||
}
|
||||
|
||||
CodeMirror.commands.toggleComment = function(cm) {
|
||||
var from = cm.getCursor("start"), to = cm.getCursor("end");
|
||||
cm.uncomment(from, to) || cm.lineComment(from, to);
|
||||
};
|
||||
|
||||
CodeMirror.defineExtension("lineComment", function(from, to, options) {
|
||||
if (!options) options = noOptions;
|
||||
var self = this, mode = self.getModeAt(from);
|
||||
var commentString = options.lineComment || mode.lineComment;
|
||||
if (!commentString) {
|
||||
if (options.blockCommentStart || mode.blockCommentStart) {
|
||||
options.fullLines = true;
|
||||
self.blockComment(from, to, options);
|
||||
}
|
||||
return;
|
||||
}
|
||||
var firstLine = self.getLine(from.line);
|
||||
if (firstLine == null) return;
|
||||
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
|
||||
var pad = options.padding == null ? " " : options.padding;
|
||||
var blankLines = options.commentBlankLines || from.line == to.line;
|
||||
|
||||
self.operation(function() {
|
||||
if (options.indent) {
|
||||
var baseString = firstLine.slice(0, firstNonWS(firstLine));
|
||||
for (var i = from.line; i < end; ++i) {
|
||||
var line = self.getLine(i), cut = baseString.length;
|
||||
if (!blankLines && !nonWS.test(line)) continue;
|
||||
if (line.slice(0, cut) != baseString) cut = firstNonWS(line);
|
||||
self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));
|
||||
}
|
||||
} else {
|
||||
for (var i = from.line; i < end; ++i) {
|
||||
if (blankLines || nonWS.test(self.getLine(i)))
|
||||
self.replaceRange(commentString + pad, Pos(i, 0));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
CodeMirror.defineExtension("blockComment", function(from, to, options) {
|
||||
if (!options) options = noOptions;
|
||||
var self = this, mode = self.getModeAt(from);
|
||||
var startString = options.blockCommentStart || mode.blockCommentStart;
|
||||
var endString = options.blockCommentEnd || mode.blockCommentEnd;
|
||||
if (!startString || !endString) {
|
||||
if ((options.lineComment || mode.lineComment) && options.fullLines != false)
|
||||
self.lineComment(from, to, options);
|
||||
return;
|
||||
}
|
||||
|
||||
var end = Math.min(to.line, self.lastLine());
|
||||
if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
|
||||
|
||||
var pad = options.padding == null ? " " : options.padding;
|
||||
if (from.line > end) return;
|
||||
|
||||
self.operation(function() {
|
||||
if (options.fullLines != false) {
|
||||
var lastLineHasText = nonWS.test(self.getLine(end));
|
||||
self.replaceRange(pad + endString, Pos(end));
|
||||
self.replaceRange(startString + pad, Pos(from.line, 0));
|
||||
var lead = options.blockCommentLead || mode.blockCommentLead;
|
||||
if (lead != null) for (var i = from.line + 1; i <= end; ++i)
|
||||
if (i != end || lastLineHasText)
|
||||
self.replaceRange(lead + pad, Pos(i, 0));
|
||||
} else {
|
||||
self.replaceRange(endString, to);
|
||||
self.replaceRange(startString, from);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
CodeMirror.defineExtension("uncomment", function(from, to, options) {
|
||||
if (!options) options = noOptions;
|
||||
var self = this, mode = self.getModeAt(from);
|
||||
var end = Math.min(to.line, self.lastLine()), start = Math.min(from.line, end);
|
||||
|
||||
// Try finding line comments
|
||||
var lineString = options.lineComment || mode.lineComment, lines = [];
|
||||
var pad = options.padding == null ? " " : options.padding, didSomething;
|
||||
lineComment: {
|
||||
if (!lineString) break lineComment;
|
||||
for (var i = start; i <= end; ++i) {
|
||||
var line = self.getLine(i);
|
||||
var found = line.indexOf(lineString);
|
||||
if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
|
||||
if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment;
|
||||
if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
|
||||
lines.push(line);
|
||||
}
|
||||
self.operation(function() {
|
||||
for (var i = start; i <= end; ++i) {
|
||||
var line = lines[i - start];
|
||||
var pos = line.indexOf(lineString), endPos = pos + lineString.length;
|
||||
if (pos < 0) continue;
|
||||
if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
|
||||
didSomething = true;
|
||||
self.replaceRange("", Pos(i, pos), Pos(i, endPos));
|
||||
}
|
||||
});
|
||||
if (didSomething) return true;
|
||||
}
|
||||
|
||||
// Try block comments
|
||||
var startString = options.blockCommentStart || mode.blockCommentStart;
|
||||
var endString = options.blockCommentEnd || mode.blockCommentEnd;
|
||||
if (!startString || !endString) return false;
|
||||
var lead = options.blockCommentLead || mode.blockCommentLead;
|
||||
var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end);
|
||||
var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString);
|
||||
if (close == -1 && start != end) {
|
||||
endLine = self.getLine(--end);
|
||||
close = endLine.lastIndexOf(endString);
|
||||
}
|
||||
if (open == -1 || close == -1 ||
|
||||
!/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) ||
|
||||
!/comment/.test(self.getTokenTypeAt(Pos(end, close + 1))))
|
||||
return false;
|
||||
|
||||
self.operation(function() {
|
||||
self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
|
||||
Pos(end, close + endString.length));
|
||||
var openEnd = open + startString.length;
|
||||
if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;
|
||||
self.replaceRange("", Pos(start, open), Pos(start, openEnd));
|
||||
if (lead) for (var i = start + 1; i <= end; ++i) {
|
||||
var line = self.getLine(i), found = line.indexOf(lead);
|
||||
if (found == -1 || nonWS.test(line.slice(0, found))) continue;
|
||||
var foundEnd = found + lead.length;
|
||||
if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;
|
||||
self.replaceRange("", Pos(i, found), Pos(i, foundEnd));
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
})();
|
||||
54
gulliver/js/codemirror/addon/comment/continuecomment.js
vendored
Normal file
54
gulliver/js/codemirror/addon/comment/continuecomment.js
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
(function() {
|
||||
var modes = ["clike", "css", "javascript"];
|
||||
for (var i = 0; i < modes.length; ++i)
|
||||
CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "});
|
||||
|
||||
function continueComment(cm) {
|
||||
var pos = cm.getCursor(), token = cm.getTokenAt(pos);
|
||||
if (token.type != "comment" || cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||
var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode;
|
||||
|
||||
var insert;
|
||||
if (mode.blockCommentStart && mode.blockCommentContinue) {
|
||||
var end = token.string.indexOf(mode.blockCommentEnd);
|
||||
var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
|
||||
if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) {
|
||||
// Comment ended, don't continue it
|
||||
} else if (token.string.indexOf(mode.blockCommentStart) == 0) {
|
||||
insert = full.slice(0, token.start);
|
||||
if (!/^\s*$/.test(insert)) {
|
||||
insert = "";
|
||||
for (var i = 0; i < token.start; ++i) insert += " ";
|
||||
}
|
||||
} else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
|
||||
found + mode.blockCommentContinue.length > token.start &&
|
||||
/^\s*$/.test(full.slice(0, found))) {
|
||||
insert = full.slice(0, found);
|
||||
}
|
||||
if (insert != null) insert += mode.blockCommentContinue;
|
||||
}
|
||||
if (insert == null && mode.lineComment) {
|
||||
var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment);
|
||||
if (found > -1) {
|
||||
insert = line.slice(0, found);
|
||||
if (/\S/.test(insert)) insert = null;
|
||||
else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (insert != null)
|
||||
cm.replaceSelection("\n" + insert, "end");
|
||||
else
|
||||
return CodeMirror.Pass;
|
||||
}
|
||||
|
||||
CodeMirror.defineOption("continueComments", null, function(cm, val, prev) {
|
||||
if (prev && prev != CodeMirror.Init)
|
||||
cm.removeKeyMap("continueComment");
|
||||
if (val) {
|
||||
var map = {name: "continueComment"};
|
||||
map[typeof val == "string" ? val : "Enter"] = continueComment;
|
||||
cm.addKeyMap(map);
|
||||
}
|
||||
});
|
||||
})();
|
||||
44
gulliver/js/codemirror/addon/dialog/dialog.js
vendored
44
gulliver/js/codemirror/addon/dialog/dialog.js
vendored
@@ -10,11 +10,22 @@
|
||||
} else {
|
||||
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
|
||||
}
|
||||
dialog.innerHTML = template;
|
||||
if (typeof template == "string") {
|
||||
dialog.innerHTML = template;
|
||||
} else { // Assuming it's a detached DOM element.
|
||||
dialog.appendChild(template);
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
function closeNotification(cm, newVal) {
|
||||
if (cm.state.currentNotificationClose)
|
||||
cm.state.currentNotificationClose();
|
||||
cm.state.currentNotificationClose = newVal;
|
||||
}
|
||||
|
||||
CodeMirror.defineExtension("openDialog", function(template, callback, options) {
|
||||
closeNotification(this, null);
|
||||
var dialog = dialogDiv(this, template, options && options.bottom);
|
||||
var closed = false, me = this;
|
||||
function close() {
|
||||
@@ -24,6 +35,7 @@
|
||||
}
|
||||
var inp = dialog.getElementsByTagName("input")[0], button;
|
||||
if (inp) {
|
||||
if (options && options.value) inp.value = options.value;
|
||||
CodeMirror.on(inp, "keydown", function(e) {
|
||||
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
|
||||
if (e.keyCode == 13 || e.keyCode == 27) {
|
||||
@@ -51,6 +63,7 @@
|
||||
});
|
||||
|
||||
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
|
||||
closeNotification(this, null);
|
||||
var dialog = dialogDiv(this, template, options && options.bottom);
|
||||
var buttons = dialog.getElementsByTagName("button");
|
||||
var closed = false, me = this, blurring = 1;
|
||||
@@ -77,4 +90,33 @@
|
||||
CodeMirror.on(b, "focus", function() { ++blurring; });
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* openNotification
|
||||
* Opens a notification, that can be closed with an optional timer
|
||||
* (default 5000ms timer) and always closes on click.
|
||||
*
|
||||
* If a notification is opened while another is opened, it will close the
|
||||
* currently opened one and open the new one immediately.
|
||||
*/
|
||||
CodeMirror.defineExtension("openNotification", function(template, options) {
|
||||
closeNotification(this, close);
|
||||
var dialog = dialogDiv(this, template, options && options.bottom);
|
||||
var duration = options && (options.duration === undefined ? 5000 : options.duration);
|
||||
var closed = false, doneTimer;
|
||||
|
||||
function close() {
|
||||
if (closed) return;
|
||||
closed = true;
|
||||
clearTimeout(doneTimer);
|
||||
dialog.parentNode.removeChild(dialog);
|
||||
}
|
||||
|
||||
CodeMirror.on(dialog, 'click', function(e) {
|
||||
CodeMirror.e_preventDefault(e);
|
||||
close();
|
||||
});
|
||||
if (duration)
|
||||
doneTimer = setTimeout(close, options.duration);
|
||||
});
|
||||
})();
|
||||
|
||||
6
gulliver/js/codemirror/addon/display/fullscreen.css
vendored
Normal file
6
gulliver/js/codemirror/addon/display/fullscreen.css
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.CodeMirror-fullscreen {
|
||||
position: fixed;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
height: auto;
|
||||
z-index: 9;
|
||||
}
|
||||
31
gulliver/js/codemirror/addon/display/fullscreen.js
vendored
Normal file
31
gulliver/js/codemirror/addon/display/fullscreen.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
|
||||
if (old == CodeMirror.Init) old = false;
|
||||
if (!old == !val) return;
|
||||
if (val) setFullscreen(cm);
|
||||
else setNormal(cm);
|
||||
});
|
||||
|
||||
function setFullscreen(cm) {
|
||||
var wrap = cm.getWrapperElement();
|
||||
cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
|
||||
width: wrap.style.width, height: wrap.style.height};
|
||||
wrap.style.width = "";
|
||||
wrap.style.height = "auto";
|
||||
wrap.className += " CodeMirror-fullscreen";
|
||||
document.documentElement.style.overflow = "hidden";
|
||||
cm.refresh();
|
||||
}
|
||||
|
||||
function setNormal(cm) {
|
||||
var wrap = cm.getWrapperElement();
|
||||
wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
|
||||
document.documentElement.style.overflow = "";
|
||||
var info = cm.state.fullScreenRestore;
|
||||
wrap.style.width = info.width; wrap.style.height = info.height;
|
||||
window.scrollTo(info.scrollLeft, info.scrollTop);
|
||||
cm.refresh();
|
||||
}
|
||||
})();
|
||||
@@ -2,12 +2,10 @@
|
||||
CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
|
||||
var prev = old && old != CodeMirror.Init;
|
||||
if (val && !prev) {
|
||||
cm.on("focus", onFocus);
|
||||
cm.on("blur", onBlur);
|
||||
cm.on("change", onChange);
|
||||
onChange(cm);
|
||||
} else if (!val && prev) {
|
||||
cm.off("focus", onFocus);
|
||||
cm.off("blur", onBlur);
|
||||
cm.off("change", onChange);
|
||||
clearPlaceholder(cm);
|
||||
@@ -19,23 +17,20 @@
|
||||
});
|
||||
|
||||
function clearPlaceholder(cm) {
|
||||
if (cm._placeholder) {
|
||||
cm._placeholder.parentNode.removeChild(cm._placeholder);
|
||||
cm._placeholder = null;
|
||||
if (cm.state.placeholder) {
|
||||
cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
|
||||
cm.state.placeholder = null;
|
||||
}
|
||||
}
|
||||
function setPlaceholder(cm) {
|
||||
clearPlaceholder(cm);
|
||||
var elt = cm._placeholder = document.createElement("pre");
|
||||
var elt = cm.state.placeholder = document.createElement("pre");
|
||||
elt.style.cssText = "height: 0; overflow: visible";
|
||||
elt.className = "CodeMirror-placeholder";
|
||||
elt.appendChild(document.createTextNode(cm.getOption("placeholder")));
|
||||
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
|
||||
}
|
||||
|
||||
function onFocus(cm) {
|
||||
clearPlaceholder(cm);
|
||||
}
|
||||
function onBlur(cm) {
|
||||
if (isEmpty(cm)) setPlaceholder(cm);
|
||||
}
|
||||
@@ -43,7 +38,6 @@
|
||||
var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
|
||||
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
|
||||
|
||||
if (cm.hasFocus()) return;
|
||||
if (empty) setPlaceholder(cm);
|
||||
else clearPlaceholder(cm);
|
||||
}
|
||||
|
||||
@@ -1,34 +1,47 @@
|
||||
(function() {
|
||||
var DEFAULT_BRACKETS = "()[]{}''\"\"";
|
||||
var DEFAULT_EXPLODE_ON_ENTER = "[]{}";
|
||||
var SPACE_CHAR_REGEX = /\s/;
|
||||
|
||||
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
|
||||
var wasOn = old && old != CodeMirror.Init;
|
||||
if (val && !wasOn)
|
||||
cm.addKeyMap(buildKeymap(typeof val == "string" ? val : DEFAULT_BRACKETS));
|
||||
else if (!val && wasOn)
|
||||
if (old != CodeMirror.Init && old)
|
||||
cm.removeKeyMap("autoCloseBrackets");
|
||||
if (!val) return;
|
||||
var pairs = DEFAULT_BRACKETS, explode = DEFAULT_EXPLODE_ON_ENTER;
|
||||
if (typeof val == "string") pairs = val;
|
||||
else if (typeof val == "object") {
|
||||
if (val.pairs != null) pairs = val.pairs;
|
||||
if (val.explode != null) explode = val.explode;
|
||||
}
|
||||
var map = buildKeymap(pairs);
|
||||
if (explode) map.Enter = buildExplodeHandler(explode);
|
||||
cm.addKeyMap(map);
|
||||
});
|
||||
|
||||
function charsAround(cm, pos) {
|
||||
var str = cm.getRange(CodeMirror.Pos(pos.line, pos.ch - 1),
|
||||
CodeMirror.Pos(pos.line, pos.ch + 1));
|
||||
return str.length == 2 ? str : null;
|
||||
}
|
||||
|
||||
function buildKeymap(pairs) {
|
||||
var map = {
|
||||
name : "autoCloseBrackets",
|
||||
Backspace: function(cm) {
|
||||
if (cm.somethingSelected()) return CodeMirror.Pass;
|
||||
var cur = cm.getCursor(), line = cm.getLine(cur.line);
|
||||
if (cur.ch && cur.ch < line.length &&
|
||||
pairs.indexOf(line.slice(cur.ch - 1, cur.ch + 1)) % 2 == 0)
|
||||
if (cm.somethingSelected() || cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||
var cur = cm.getCursor(), around = charsAround(cm, cur);
|
||||
if (around && pairs.indexOf(around) % 2 == 0)
|
||||
cm.replaceRange("", CodeMirror.Pos(cur.line, cur.ch - 1), CodeMirror.Pos(cur.line, cur.ch + 1));
|
||||
else
|
||||
return CodeMirror.Pass;
|
||||
}
|
||||
};
|
||||
var closingBrackets = [];
|
||||
var closingBrackets = "";
|
||||
for (var i = 0; i < pairs.length; i += 2) (function(left, right) {
|
||||
if (left != right) closingBrackets.push(right);
|
||||
if (left != right) closingBrackets += right;
|
||||
function surround(cm) {
|
||||
var selection = cm.getSelection();
|
||||
cm.replaceSelection(left + selection + right);
|
||||
var selection = cm.getSelection();
|
||||
cm.replaceSelection(left + selection + right);
|
||||
}
|
||||
function maybeOverwrite(cm) {
|
||||
var cur = cm.getCursor(), ahead = cm.getRange(cur, CodeMirror.Pos(cur.line, cur.ch + 1));
|
||||
@@ -36,10 +49,15 @@
|
||||
else cm.execCommand("goCharRight");
|
||||
}
|
||||
map["'" + left + "'"] = function(cm) {
|
||||
if (left == "'" && cm.getTokenAt(cm.getCursor()).type == "comment" ||
|
||||
cm.getOption("disableInput"))
|
||||
return CodeMirror.Pass;
|
||||
if (cm.somethingSelected()) return surround(cm);
|
||||
if (left == right && maybeOverwrite(cm) != CodeMirror.Pass) return;
|
||||
var cur = cm.getCursor(), ahead = CodeMirror.Pos(cur.line, cur.ch + 1);
|
||||
var line = cm.getLine(cur.line), nextChar = line.charAt(cur.ch);
|
||||
var line = cm.getLine(cur.line), nextChar = line.charAt(cur.ch), curChar = cur.ch > 0 ? line.charAt(cur.ch - 1) : "";
|
||||
if (left == right && CodeMirror.isWordChar(curChar))
|
||||
return CodeMirror.Pass;
|
||||
if (line.length == cur.ch || closingBrackets.indexOf(nextChar) >= 0 || SPACE_CHAR_REGEX.test(nextChar))
|
||||
cm.replaceSelection(left + right, {head: ahead, anchor: ahead});
|
||||
else
|
||||
@@ -49,4 +67,18 @@
|
||||
})(pairs.charAt(i), pairs.charAt(i + 1));
|
||||
return map;
|
||||
}
|
||||
|
||||
function buildExplodeHandler(pairs) {
|
||||
return function(cm) {
|
||||
var cur = cm.getCursor(), around = charsAround(cm, cur);
|
||||
if (!around || pairs.indexOf(around) % 2 != 0 || cm.getOption("disableInput"))
|
||||
return CodeMirror.Pass;
|
||||
cm.operation(function() {
|
||||
var newPos = CodeMirror.Pos(cur.line + 1, 0);
|
||||
cm.replaceSelection("\n\n", {anchor: newPos, head: newPos}, "+input");
|
||||
cm.indentLine(cur.line + 1, null, true);
|
||||
cm.indentLine(cur.line + 2, null, true);
|
||||
});
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
74
gulliver/js/codemirror/addon/edit/closetag.js
vendored
74
gulliver/js/codemirror/addon/edit/closetag.js
vendored
@@ -24,16 +24,15 @@
|
||||
|
||||
(function() {
|
||||
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
||||
if (val && (old == CodeMirror.Init || !old)) {
|
||||
var map = {name: "autoCloseTags"};
|
||||
if (typeof val != "object" || val.whenClosing)
|
||||
map["'/'"] = function(cm) { return autoCloseTag(cm, '/'); };
|
||||
if (typeof val != "object" || val.whenOpening)
|
||||
map["'>'"] = function(cm) { return autoCloseTag(cm, '>'); };
|
||||
cm.addKeyMap(map);
|
||||
} else if (!val && (old != CodeMirror.Init && old)) {
|
||||
if (old != CodeMirror.Init && old)
|
||||
cm.removeKeyMap("autoCloseTags");
|
||||
}
|
||||
if (!val) return;
|
||||
var map = {name: "autoCloseTags"};
|
||||
if (typeof val != "object" || val.whenClosing)
|
||||
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
||||
if (typeof val != "object" || val.whenOpening)
|
||||
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
||||
cm.addKeyMap(map);
|
||||
});
|
||||
|
||||
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
||||
@@ -41,39 +40,48 @@
|
||||
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
||||
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
||||
|
||||
function autoCloseTag(cm, ch) {
|
||||
function autoCloseGT(cm) {
|
||||
var pos = cm.getCursor(), tok = cm.getTokenAt(pos);
|
||||
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
||||
if (inner.mode.name != "xml") return CodeMirror.Pass;
|
||||
if (inner.mode.name != "xml" || !state.tagName || cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||
|
||||
var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
|
||||
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
||||
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
||||
|
||||
if (ch == ">" && state.tagName) {
|
||||
var tagName = state.tagName;
|
||||
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
||||
var lowerTagName = tagName.toLowerCase();
|
||||
// Don't process the '>' at the end of an end-tag or self-closing tag
|
||||
if (tok.type == "tag" && state.type == "closeTag" || tok.string.indexOf("/") > -1 ||
|
||||
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1)
|
||||
return CodeMirror.Pass;
|
||||
var tagName = state.tagName;
|
||||
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
||||
var lowerTagName = tagName.toLowerCase();
|
||||
// Don't process the '>' at the end of an end-tag or self-closing tag
|
||||
if (!tagName ||
|
||||
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
|
||||
tok.type == "tag" && state.type == "closeTag" ||
|
||||
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
|
||||
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
|
||||
CodeMirror.scanForClosingTag && CodeMirror.scanForClosingTag(cm, pos, tagName,
|
||||
Math.min(cm.lastLine() + 1, pos.line + 50)))
|
||||
return CodeMirror.Pass;
|
||||
|
||||
var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
||||
var curPos = doIndent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1);
|
||||
cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "</" + tagName + ">",
|
||||
{head: curPos, anchor: curPos});
|
||||
if (doIndent) {
|
||||
cm.indentLine(pos.line + 1);
|
||||
cm.indentLine(pos.line + 2);
|
||||
}
|
||||
return;
|
||||
} else if (ch == "/" && tok.string == "<") {
|
||||
var tagName = state.context && state.context.tagName;
|
||||
if (tagName) cm.replaceSelection("/" + tagName + ">", "end");
|
||||
return;
|
||||
var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
||||
var curPos = doIndent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1);
|
||||
cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "</" + tagName + ">",
|
||||
{head: curPos, anchor: curPos});
|
||||
if (doIndent) {
|
||||
cm.indentLine(pos.line + 1, null, true);
|
||||
cm.indentLine(pos.line + 2, null);
|
||||
}
|
||||
return CodeMirror.Pass;
|
||||
}
|
||||
|
||||
function autoCloseSlash(cm) {
|
||||
var pos = cm.getCursor(), tok = cm.getTokenAt(pos);
|
||||
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
||||
if (tok.type == "string" || tok.string.charAt(0) != "<" ||
|
||||
tok.start != pos.ch - 1 || inner.mode.name != "xml" ||
|
||||
cm.getOption("disableInput"))
|
||||
return CodeMirror.Pass;
|
||||
|
||||
var tagName = state.context && state.context.tagName;
|
||||
if (tagName) cm.replaceSelection("/" + tagName + ">", "end");
|
||||
}
|
||||
|
||||
function indexOf(collection, elt) {
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
(function() {
|
||||
var modes = ["clike", "css", "javascript"];
|
||||
for (var i = 0; i < modes.length; ++i)
|
||||
CodeMirror.extendMode(modes[i], {blockCommentStart: "/*",
|
||||
blockCommentEnd: "*/",
|
||||
blockCommentContinue: " * "});
|
||||
|
||||
function continueComment(cm) {
|
||||
var pos = cm.getCursor(), token = cm.getTokenAt(pos);
|
||||
var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode;
|
||||
var space;
|
||||
|
||||
if (token.type == "comment" && mode.blockCommentStart) {
|
||||
var end = token.string.indexOf(mode.blockCommentEnd);
|
||||
var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
|
||||
if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) {
|
||||
// Comment ended, don't continue it
|
||||
} else if (token.string.indexOf(mode.blockCommentStart) == 0) {
|
||||
space = full.slice(0, token.start);
|
||||
if (!/^\s*$/.test(space)) {
|
||||
space = "";
|
||||
for (var i = 0; i < token.start; ++i) space += " ";
|
||||
}
|
||||
} else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
|
||||
found + mode.blockCommentContinue.length > token.start &&
|
||||
/^\s*$/.test(full.slice(0, found))) {
|
||||
space = full.slice(0, found);
|
||||
}
|
||||
}
|
||||
|
||||
if (space != null)
|
||||
cm.replaceSelection("\n" + space + mode.blockCommentContinue, "end");
|
||||
else
|
||||
return CodeMirror.Pass;
|
||||
}
|
||||
|
||||
CodeMirror.defineOption("continueComments", null, function(cm, val, prev) {
|
||||
if (prev && prev != CodeMirror.Init)
|
||||
cm.removeKeyMap("continueComment");
|
||||
var map = {name: "continueComment"};
|
||||
map[typeof val == "string" ? val : "Enter"] = continueComment;
|
||||
cm.addKeyMap(map);
|
||||
});
|
||||
})();
|
||||
@@ -5,8 +5,10 @@
|
||||
unorderedBullets = '*+-';
|
||||
|
||||
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
|
||||
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||
|
||||
var pos = cm.getCursor(),
|
||||
inList = cm.getStateAfter(pos.line).list,
|
||||
inList = cm.getStateAfter(pos.line).list !== false,
|
||||
match;
|
||||
|
||||
if (!inList || !(match = cm.getLine(pos.line).match(listRE))) {
|
||||
|
||||
@@ -3,25 +3,29 @@
|
||||
(document.documentMode == null || document.documentMode < 8);
|
||||
|
||||
var Pos = CodeMirror.Pos;
|
||||
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
||||
var maxLineLen = 1000;
|
||||
|
||||
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
||||
function findMatchingBracket(cm) {
|
||||
var cur = cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
|
||||
function findMatchingBracket(cm, where, strict) {
|
||||
var state = cm.state.matchBrackets;
|
||||
var maxScanLen = (state && state.maxScanLineLength) || 10000;
|
||||
var maxScanLines = (state && state.maxScanLines) || 100;
|
||||
|
||||
var cur = where || cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
|
||||
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
||||
if (!match) return null;
|
||||
var forward = match.charAt(1) == ">", d = forward ? 1 : -1;
|
||||
var style = cm.getTokenAt(Pos(cur.line, pos + 1)).type;
|
||||
if (strict && forward != (pos == cur.ch)) return null;
|
||||
var style = cm.getTokenTypeAt(Pos(cur.line, pos + 1));
|
||||
|
||||
var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
|
||||
function scan(line, lineNo, start) {
|
||||
if (!line.text) return;
|
||||
var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1;
|
||||
if (line.text.length > maxScanLen) return null;
|
||||
if (start != null) pos = start + d;
|
||||
for (; pos != end; pos += d) {
|
||||
var ch = line.text.charAt(pos);
|
||||
if (re.test(ch) && cm.getTokenAt(Pos(lineNo, pos + 1)).type == style) {
|
||||
if (re.test(ch) && cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style) {
|
||||
var match = matching[ch];
|
||||
if (match.charAt(1) == ">" == forward) stack.push(ch);
|
||||
else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};
|
||||
@@ -29,25 +33,28 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) {
|
||||
for (var i = cur.line, found, e = forward ? Math.min(i + maxScanLines, cm.lineCount()) : Math.max(-1, i - maxScanLines); i != e; i+=d) {
|
||||
if (i == cur.line) found = scan(line, i, pos);
|
||||
else found = scan(cm.getLineHandle(i), i);
|
||||
if (found) break;
|
||||
}
|
||||
return {from: Pos(cur.line, pos), to: found && Pos(i, found.pos), match: found && found.match};
|
||||
return {from: Pos(cur.line, pos), to: found && Pos(i, found.pos),
|
||||
match: found && found.match, forward: forward};
|
||||
}
|
||||
|
||||
function matchBrackets(cm, autoclear) {
|
||||
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
||||
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
||||
var found = findMatchingBracket(cm);
|
||||
if (!found || cm.getLine(found.from.line).length > maxLineLen ||
|
||||
found.to && cm.getLine(found.to.line).length > maxLineLen)
|
||||
if (!found || cm.getLine(found.from.line).length > maxHighlightLen ||
|
||||
found.to && cm.getLine(found.to.line).length > maxHighlightLen)
|
||||
return;
|
||||
|
||||
var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
||||
var one = cm.markText(found.from, Pos(found.from.line, found.from.ch + 1), {className: style});
|
||||
var two = found.to && cm.markText(found.to, Pos(found.to.line, found.to.ch + 1), {className: style});
|
||||
// Kludge to work around the IE bug from issue #1193, where text
|
||||
// input stops going to the textare whever this fires.
|
||||
// input stops going to the textarea whenever this fires.
|
||||
if (ie_lt8 && cm.state.focused) cm.display.input.focus();
|
||||
var clear = function() {
|
||||
cm.operation(function() { one.clear(); two && two.clear(); });
|
||||
@@ -64,11 +71,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
CodeMirror.defineOption("matchBrackets", false, function(cm, val) {
|
||||
if (val) cm.on("cursorActivity", doMatchBrackets);
|
||||
else cm.off("cursorActivity", doMatchBrackets);
|
||||
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
||||
if (old && old != CodeMirror.Init)
|
||||
cm.off("cursorActivity", doMatchBrackets);
|
||||
if (val) {
|
||||
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
||||
cm.on("cursorActivity", doMatchBrackets);
|
||||
}
|
||||
});
|
||||
|
||||
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
||||
CodeMirror.defineExtension("findMatchingBracket", function(){return findMatchingBracket(this);});
|
||||
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict){
|
||||
return findMatchingBracket(this, pos, strict);
|
||||
});
|
||||
})();
|
||||
|
||||
56
gulliver/js/codemirror/addon/edit/matchtags.js
vendored
Normal file
56
gulliver/js/codemirror/addon/edit/matchtags.js
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
|
||||
if (old && old != CodeMirror.Init) {
|
||||
cm.off("cursorActivity", doMatchTags);
|
||||
cm.off("viewportChange", maybeUpdateMatch);
|
||||
clear(cm);
|
||||
}
|
||||
if (val) {
|
||||
cm.state.matchBothTags = typeof val == "object" && val.bothTags;
|
||||
cm.on("cursorActivity", doMatchTags);
|
||||
cm.on("viewportChange", maybeUpdateMatch);
|
||||
doMatchTags(cm);
|
||||
}
|
||||
});
|
||||
|
||||
function clear(cm) {
|
||||
if (cm.state.tagHit) cm.state.tagHit.clear();
|
||||
if (cm.state.tagOther) cm.state.tagOther.clear();
|
||||
cm.state.tagHit = cm.state.tagOther = null;
|
||||
}
|
||||
|
||||
function doMatchTags(cm) {
|
||||
cm.state.failedTagMatch = false;
|
||||
cm.operation(function() {
|
||||
clear(cm);
|
||||
if (cm.somethingSelected()) return;
|
||||
var cur = cm.getCursor(), range = cm.getViewport();
|
||||
range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
|
||||
var match = CodeMirror.findMatchingTag(cm, cur, range);
|
||||
if (!match) return;
|
||||
if (cm.state.matchBothTags) {
|
||||
var hit = match.at == "open" ? match.open : match.close;
|
||||
if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
|
||||
}
|
||||
var other = match.at == "close" ? match.open : match.close;
|
||||
if (other)
|
||||
cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
|
||||
else
|
||||
cm.state.failedTagMatch = true;
|
||||
});
|
||||
}
|
||||
|
||||
function maybeUpdateMatch(cm) {
|
||||
if (cm.state.failedTagMatch) doMatchTags(cm);
|
||||
}
|
||||
|
||||
CodeMirror.commands.toMatchingTag = function(cm) {
|
||||
var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
|
||||
if (found) {
|
||||
var other = found.at == "close" ? found.open : found.close;
|
||||
if (other) cm.setSelection(other.to, other.from);
|
||||
}
|
||||
};
|
||||
})();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user