Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Feature: IN ORDER TO modify Form Body
- AS A System Administrator
- I WANT to be able to update form with sections, grids, cells, etc.
- @updateFormBody1
- # FORM - 689
- Scenario: Happy Path: 1 Section x 1 Grid
- Given I am authenticated
- And form "Behat HP" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 0,
- "YPosition": 1,
- "Grids": [
- {"Rows": 1,
- "Columns": 1,
- "Cells": [
- {"RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "200"
- And I send a "GET" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "200"
- # Section Properties:
- And the "Title" property inside of section equals "Create Section Title"
- And the "HelpDescription" property inside of section equals "Create Section Description"
- And the "XPosition" property inside of section equals "0"
- And the "YPosition" property inside of section equals "1"
- And the "IsReadOnly" property inside of section equals "true"
- And the "IsRequired" property inside of section equals "true"
- And the "IsVisible" property inside of section equals "true"
- And the "IsEnabled" property inside of section equals "true"
- #Grid Properties:
- Then the "Rows" form property inside of "Grids" equals "1"
- Then the "Columns" form property inside of "Grids" equals "1"
- Then the "XPosition" form property inside of "Grids" equals "0"
- Then the "YPosition" form property inside of "Grids" equals "1"
- Then the "IsReadOnly" form property inside of "Grids" equals "true"
- Then the "IsRequired" form property inside of "Grids" equals "true"
- Then the "IsVisible" form property inside of "Grids" equals "true"
- Then the "IsEnabled" form property inside of "Grids" equals "true"
- #Cell Properties:
- Then the "AttributeId" form property inside of "Grids" and "Cells" equals "20"
- Then the "AttributeTitle" form property inside of "Grids" and "Cells" equals "Address"
- Then the "AttributeHintText" form property inside of "Grids" and "Cells" equals "Please enter full address of the client"
- Then the "AttributeFieldTypeId" form property inside of "Grids" and "Cells" equals "14"
- Then the "AttributeDefaultValue" form property inside of "Grids" and "Cells" equals "1"
- Then the "RowSpan" form property inside of "Grids" and "Cells" equals "1"
- Then the "XPosition" form property inside of "Grids" and "Cells" equals "1"
- Then the "YPosition" form property inside of "Grids" and "Cells" equals "1"
- Then the "IsReadOnly" form property inside of "Grids" and "Cells" equals "true"
- Then the "IsRequired" form property inside of "Grids" and "Cells" equals "true"
- Then the "IsVisible" form property inside of "Grids" and "Cells" equals "true"
- Then the "IsEnabled" form property inside of "Grids" and "Cells" equals "true"
- @updateFormBody2
- # FORM - 689
- Scenario: Happy Path: 2 Section x 2 Grids
- Given I am authenticated
- And form "Behat HP" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Section 1",
- "HelpDescription": "HD N 1",
- "PageBreakBefore": true,
- "XPosition": 0,
- "YPosition": 1,
- "Grids": [
- {"Rows": 1,
- "Columns": 1,
- "Cells": [
- {"RowSpan": 1,
- "AttributeId": 21,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- },
- {
- "Title": "Section 2",
- "HelpDescription": "HD N 2",
- "PageBreakBefore": true,
- "XPosition": 0,
- "YPosition": 2,
- "Grids": [
- {"Rows": 1,
- "Columns": 1,
- "Cells": [
- {"RowSpan": 1,
- "AttributeId": 22,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- },
- {"Rows": 1,
- "Columns": 2,
- "Cells": [
- {"RowSpan": 1,
- "AttributeId": 23,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- },
- { "RowSpan": 1,
- "AttributeId": 25,
- "XPosition": 2,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 2,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 2,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules": [ {
- "FormRuleTypeId": 3,
- "FormTargetId": 1,
- "Title": " FormRules FORM-689",
- "Description": "Form-689 Behat Rules"
- }
- ]
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body/" replacing _CreatedId_ with rowName "FormId" type "integer"
- And I should see a status response code "200"
- # And I send a "GET" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I send a "GET" to "/form/_CreatedId_/body/" replacing _CreatedId_ with rowName "FormId" type "integer"
- And I should see a status response code "200"
- # Section Properties:
- And the "Title" property inside of section equals "Section 1"
- And the "Title" property inside of section equals "Section 2"
- And the "HelpDescription" property inside of section equals "HD N 1"
- And the "HelpDescription" property inside of section equals "HD N 2"
- And the "YPosition" property inside of section equals "1"
- And the "YPosition" property inside of section equals "2"
- # Grid Properties:
- And the "Rows" form property inside of "Grids" equals "1"
- And the "Columns" form property inside of "Grids" equals "1"
- And the "XPosition" form property inside of "Grids" equals "0"
- And the "YPosition" form property inside of "Grids" equals "1"
- And the "YPosition" form property inside of "Grids" equals "2"
- And the "IsReadOnly" form property inside of "Grids" equals "true"
- And the "IsRequired" form property inside of "Grids" equals "true"
- And the "IsVisible" form property inside of "Grids" equals "true"
- And the "IsEnabled" form property inside of "Grids" equals "true"
- # Cell Properties:
- Then the "AttributeId" form property inside of "Grids" and "Cells" equals "21"
- Then the "AttributeId" form property inside of "Grids" and "Cells" equals "22"
- Then the "AttributeId" form property inside of "Grids" and "Cells" equals "23"
- Then the "AttributeTitle" form property inside of "Grids" and "Cells" equals "First Name"
- Then the "AttributeTitle" form property inside of "Grids" and "Cells" equals "Middle Name"
- Then the "AttributeTitle" form property inside of "Grids" and "Cells" equals "Last Surname"
- Then the "AttributeHintText" form property inside of "Grids" and "Cells" equals "Please enter the legal first name or given name of the person"
- Then the "AttributeHintText" form property inside of "Grids" and "Cells" equals "Please enter the legal middle name of the person, if avaiable"
- Then the "AttributeHintText" form property inside of "Grids" and "Cells" equals "Please enter the legal last name or surname of the person"
- Then the "AttributeHelpDescription" form property inside of "Grids" and "Cells" equals "A name given to an individual at birth, baptism, or during another naming ceremony, or through legal change."
- Then the "AttributeHelpDescription" form property inside of "Grids" and "Cells" equals "A secondary name given to an individual at birth, baptism, or during another naming ceremony."
- Then the "AttributeHelpDescription" form property inside of "Grids" and "Cells" equals "The name borne in common by members of a family."
- Then the "AttributeFieldTypeId" form property inside of "Grids" and "Cells" equals "1"
- Then the "AttributeDefaultValue" form property inside of "Grids" and "Cells" equals "DefaultFirstName"
- Then the "AttributeDefaultValue" form property inside of "Grids" and "Cells" equals ""
- Then the "AttributeDefaultValue" form property inside of "Grids" and "Cells" equals "DefaultLastName"
- Then the "RowSpan" form property inside of "Grids" and "Cells" equals "1"
- Then the "XPosition" form property inside of "Grids" and "Cells" equals "1"
- Then the "YPosition" form property inside of "Grids" and "Cells" equals "1"
- Then the "XPosition" form property inside of "Grids" and "Cells" equals "2"
- Then the "YPosition" form property inside of "Grids" and "Cells" equals "1"
- Then the "IsReadOnly" form property inside of "Grids" and "Cells" equals "true"
- Then the "IsRequired" form property inside of "Grids" and "Cells" equals "true"
- Then the "IsVisible" form property inside of "Grids" and "Cells" equals "true"
- Then the "IsEnabled" form property inside of "Grids" and "Cells" equals "true"
- # Attribute Field Parameters:
- And in the response I should see "Minimum Value"
- And in the response I should see "Maximum Value"
- And in the response I should see "Pattern"
- And in the response I should see "Password"
- And in the response I should see "Minimum Date"
- And in the response I should see "Maximum Date"
- @updateFormBody3
- # FORM - 689
- Scenario: Happy Path: Rules Validation
- Given I am authenticated
- And form "Behat HP" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Section 1",
- "HelpDescription": "Update Form Body test",
- "PageBreakBefore": true,
- "Grids": [
- {
- "Rows": 1,
- "Columns": 1,
- "Cells": [
- {
- "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules": [
- {
- "FormRuleTypeId": 1,
- "FormTargetId": 2,
- "Title": "Cell N 1",
- "Description": "cell rule N1" }
- ]
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules": [
- {
- "FormRuleTypeId": 1,
- "FormTargetId": 2,
- "Title": "Grid N 1",
- "Description": "Grid rule N1" }
- ]
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules": [
- {
- "FormRuleTypeId": 1,
- "FormTargetId": 2,
- "Title": "Section N 1",
- "Description": "Section rule N1"
- }
- ]
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "200"
- And I send a "GET" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "200"
- # Section Rules:
- And the "FormRuleTypeId" form property inside of "FormRules" equals "1"
- #remove later:
- # Then the "FormRuleTypeId" form property inside of "FormRules", "" and "" equals "1"
- And the "FormTargetId" form property inside of "FormRules" equals "2"
- And the "Title" form property inside of "FormRules" equals "Section N 1"
- And the "Description" form property inside of "FormRules" equals "Section rule N1"
- Then the "MatchValue" form property inside of "FormRules" and "Matches" equals "DefaultFirstName"
- Then the "AnyOfCounter" form property inside of "FormRules" and "Matches" equals "0"
- Then the "AttributeId" form property inside of "FormRules" and "Matches" equals "21"
- Then the "ConditionTypeId" form property inside of "FormRules" and "Matches" equals "1"
- Then the "ComparisonId" form property inside of "FormRules" and "Matches" equals "1"
- Then the "Value" form property inside of "FormRules", "Matches" and "MatchBags" equals "DefaultFirstName"
- # Grid Rules:
- Then the "FormRuleTypeId" form property inside of "Grids" and "FormRules" equals "1"
- Then the "FormTargetId" form property inside of "Grids" and "FormRules" equals "2"
- Then the "Title" form property inside of "Grids" and "FormRules" equals "Grid N 1"
- Then the "Description" form property inside of "Grids" and "FormRules" equals "Grid rule N1"
- Then the "MatchValue" form property inside of "Grids", "FormRules" and "Matches" equals "DefaultFirstName"
- Then the "AnyOfCounter" form property inside of "Grids", "FormRules" and "Matches" equals "0"
- Then the "AttributeId" form property inside of "Grids", "FormRules" and "Matches" equals "21"
- Then the "MatchValue" form property inside of "Grids", "FormRules" and "Matches" equals "DefaultFirstName"
- Then the "ConditionTypeId" form property inside of "Grids", "FormRules" and "Matches" equals "1"
- Then the "ComparisonId" form property inside of "Grids", "FormRules" and "Matches" equals "1"
- Then the "Value" form property inside of "Grids", "FormRules", "Matches" and "MatchBags" equals "DefaultFirstName"
- # Cell Rules:
- Then the "FormRuleTypeId" form property inside of "Grids", "Cells" and "FormRules" equals "1"
- Then the "FormTargetId" form property inside of "Grids", "Cells" and "FormRules" equals "2"
- Then the "Title" form property inside of "Grids", "Cells" and "FormRules" equals "Cell N 1"
- Then the "Description" form property inside of "Grids", "Cells" and "FormRules" equals "cell rule N1"
- Then the "MatchValue" form property inside of "Grids", "Cells", "FormRules" and "Matches" equals "DefaultFirstName"
- Then the "AnyOfCounter" form property inside of "Grids", "Cells", "FormRules" and "Matches" equals "0"
- Then the "AttributeId" form property inside of "Grids", "Cells", "FormRules" and "Matches" equals "21"
- Then the "ConditionTypeId" form property inside of "Grids", "Cells", "FormRules" and "Matches" equals "1"
- Then the "ComparisonId" form property inside of "Grids", "Cells", "FormRules" and "Matches" equals "1"
- #---------------------------- Negative Scenarios --------------------------------------------------
- @updateFormBody4
- # FORM-723
- Scenario: User should not be able to update Form Body if Form was Published
- Given I am authenticated
- And form "PublishedForm" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "PublishedOn": "2016-06-15T20:59:38.378Z"
- }
- """
- # When I update form publishedOn or deactivatedOn
- And I send a "PUT" to "/form/_CreatedId_/publish" replacing _CreatedId_ with rowName "FormId" type "integer"
- And I should see a status response code "200"
- And I send a form json:
- """
- {
- "Sections": [
- { "Title": "El",
- "HelpDescription": "elena test 616",
- "PageBreakBefore": true,
- "XPosition": 0,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 21,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- And I update FormBody
- And I should see a status response code "403"
- And in the response I should see "Form has a published date"
- And in the response I should see "PublishedOn"
- @updateFormBody5
- # FORM - 689
- Scenario: Negative Scenario: Section: X position must be 0
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [],
- "XPosition": 2,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "The XPosition of each section must be 0."
- @updateFormBody6
- # FORM - 689
- Scenario: Negative Scenario: Section: Y position must be > 0
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [],
- "XPosition": 0,
- "YPosition": 0,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "The YPosition of each section must be > 0."
- @updateFormBody7
- # FORM - 689
- Scenario: Negative Scenario: Y position must be unique for each section
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Section 1",
- "HelpDescription": "HD N 1",
- "PageBreakBefore": true,
- "XPosition": 0,
- "YPosition": 1,
- "Grids": [],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- },
- {
- "Title": "Section 2",
- "HelpDescription": "HD N 2",
- "PageBreakBefore": true,
- "XPosition": 0,
- "YPosition": 2,
- "Grids": [],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules": []
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body/" replacing _CreatedId_ with rowName "FormId" type "integer"
- And I should see a status response code "400"
- And in the response I should not see "The Yposition of each sectiion must be unique"
- @updateFormBody8
- # FORM - 689
- Scenario: Negative Scenario - Grid: X position must be 0
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "The XPosition of each grid must be 0."
- @updateFormBody9
- # FORM - 689
- Scenario: Negative Scenario - Grid: Y position must be > 0
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 0,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "The YPosition of each grid must be > 0."
- @updateFormBody10
- # FORM - 689
- Scenario: Negative Scenario - Grid: Y position must be unique for each grid in a section
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- },
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 21,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "The YPosition of each item in a section must be unique."
- @updateFormBody11
- # FORM - 689
- Scenario: Negative Scenario - Grid: Each X,Y position on a grid must be covered by a cell (no gaps)
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 3,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }, {
- "RowSpan": 1,
- "AttributeId": 21,
- "XPosition": 1,
- "YPosition": 2,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "No cell objects are covering position 1,3 in a grid."
- @updateFormBody12
- # FORM - 689
- Scenario: Negative Scenario - Grid: No X,Y position on a grid can be covered by more than 1 cell (no overlap)
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }, {
- "RowSpan": 1,
- "AttributeId": 21,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "2 cells are covering position 1,1 in a grid"
- @updateFormBody13
- # FORM - 689
- Scenario: Negative Scenario - Cell: X position must be > 0
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- },
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "The XPosition of each cell must be > 0"
- @updateFormBody14
- # FORM - 689
- Scenario: Negative Scenario - Cell: Y position must be > 0
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 0,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- },
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "The YPosition of each cell must be > 0"
- @updateFormBody15
- # FORM - 689
- Scenario: Negative Scenario - Cell: Rowspan must be >= 1
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- },
- {
- "RowSpan": 0,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "The rowspan of each cell must be > 0"
- # Cell: No cell can be outside of, or extend past the bounds of the grid
- @updateFormBody16
- # FORM - 689
- Scenario: Negative Scenario --> Cell: No cell can be outside of, or extend past the bounds of the grid
- Given I am authenticated
- And form "Behat NS" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections": [
- {
- "Title": "Create Section Title",
- "HelpDescription": "Create Section Description",
- "PageBreakBefore": true,
- "XPosition": 1,
- "YPosition": 1,
- "Grids": [
- { "Rows": 1,
- "Columns": 1,
- "Cells": [
- { "RowSpan": 1,
- "AttributeId": 20,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- "FormRules": [
- {
- "FormRuleTypeId": 1,
- "FormTargetId": 2,
- "Title": "CELL FORM Id = 5",
- "Description": "cell"
- }
- ]
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "400"
- And in the response I should see "Cell Yposition or rowspan extends beyond the bounds of the grid."
- # Cell: Any attributeId must exist, be not deleted, and be valid for the form
- # 4 Scenarios:
- # - Attr does not exist;
- # - Deleted Attribute Id;
- # - VLT Attr Id --> Not valid for current form:
- # a) FormAttr
- # B) Person Attr
- @updateFormBody17
- Scenario: AttributeId is DELETED
- Given I am authenticated
- And form "Deleted Attribute Id" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "AttributeTypeId": 1,
- "Title": "",
- "HintText": "Testing_Behat",
- "HelpDescription": "Testing BE Create Attributes",
- "FieldTypeId": 2,
- "DefaultValue": 1,
- "Encrypt": false,
- "Unique": false
- }
- """
- And I send a random "Title" prefix "BE_Behat_CreatePersonAttributeType_"
- When I send a "POST" to "/attribute"
- And I should see a status response code "200"
- And I save CreatedId to DB at row name "AttributeId"
- And I send a "DELETE" to "/attribute/_CreatedId_" replacing _CreatedId_ with rowName "AttributeId" type "integer"
- And I should see a status response code "204"
- And I send a form json:
- """
- {
- "Sections":
- [
- { "Title": "Behat Update Form Body NS",
- "HelpDescription": "",
- "PageBreakBefore": true,
- "XPosition": 0,
- "Grids":
- [
- {
- "Rows": 1,
- "Columns": 1,
- "Cells": [
- {
- "RowSpan": 1,
- "AttributeId": "xxxxx",
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- And I send "integer" type value from DB row "AttributeId" to field "AttributeId" inside of cell
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing _CreatedId_ with rowName "FormId" type "integer"
- And I should see a status response code "400"
- And in the response I should see " does not exist or is deleted"
- @updateFormBody18
- Scenario: AttributeId is Invalid
- Given I am authenticated
- And form "Behat Invalid Attribute Id" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And Aattribute "Person Behat Test attr" exists and AttributeTypeid equal "1"
- And I save CreatedId to DB at row name "AttributeId"
- And Attribute "Invalid Attr" does not exist
- And I save CreatedId to DB at row name "InvAttributeId"
- And I send a json:
- """
- {
- "Sections":
- [
- { "Title": "Behat Update Form Body NS",
- "HelpDescription": "",
- "PageBreakBefore": true,
- "XPosition": 0,
- "Grids":
- [
- {
- "Rows": 1,
- "Columns": 1,
- "Cells": [
- {
- "RowSpan": 1,
- "AttributeId": "1",
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send "integer" type value from DB row "InvAttributeId" to field "AttributeId" inside of cell
- And I send a "PUT" to "/form/_CreatedId_/body" replacing _CreatedId_ with rowName "FormId" type "integer"
- And I should see a status response code "400"
- And in the response I should see " does not exist or is deleted"
- # Rules: FormRuleTypeId must exist and not be deleted
- @updateFormBody19
- Scenario: RuleTypeId is Invalid
- Given I am authenticated
- And form "Behat Invalid Attribute Id" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections":
- [
- { "Title": "Behat Update Form Body NS",
- "HelpDescription": "",
- "PageBreakBefore": true,
- "XPosition": 0,
- "Grids":
- [
- {
- "Rows": 1,
- "Columns": 1,
- "Cells": [
- {
- "RowSpan": 1,
- "AttributeId": "10000000",
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules": [ {
- "FormRuleTypeId": 1000,
- "FormTargetId": 1,
- "Title": "Invalid RuleTypeId",
- "Description": "Form-689 Behat Rules"
- }
- ]
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing _CreatedId_ with rowName "FormId" type "integer"
- And I should see a status response code "400"
- And in the response I should see "FormRuleTypeId does not exist"
- # Rules: FormTargetId must exist and not be deleted
- @updateFormBody20
- Scenario: FormTargetId is Invalid
- Given I am authenticated
- And form "Behat Invalid TargetId" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- # create a Target:
- And I am calling "Form"
- And I send a json:
- """
- {
- "Title": "",
- "Description": "FORM-708 Invalid TargetId",
- "Matches": [
- {
- "AnyOfCounter":0 ,
- "ComparisonId": 1,
- "AttributeId": "21",
- "ConditionTypeId": "1",
- "MatchBags": [
- {
- "Value": "MatchBags: Test Value"
- }
- ]
- }
- ]
- }
- """
- And I send a random "Title" prefix "FORM-741 Behat BE"
- When I send a "POST" to "/target"
- And I should see a status response code "200"
- # save the created FormTargetId to studentTracBehat table in database.sqlite
- And I save CreatedId to DB at row name "FormTargetId"
- And I send a "DELETE" to "/target/_CreatedId_" replacing _CreatedId_ with rowName "FormTargetId" type "integer"
- And I send a json:
- """
- {
- "Sections":
- [
- {"Title": "Behat Update Form Body NS",
- "HelpDescription": "",
- "PageBreakBefore": true,
- "XPosition": 0,
- "Grids":
- [
- {
- "Rows": 1,
- "Columns": 1,
- "Cells":
- [
- {
- "RowSpan": 1,
- "AttributeId": "21",
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules":
- [ {
- "FormRuleTypeId": 1,
- "FormTargetId": 1,
- "Title": "Invalid Target Id",
- "Description": "Form-689 Behat Rules"
- }
- ]
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true
- }
- ]
- }
- """
- # Update FormBody
- And I send "integer" type value from DB row "FormTargetId" to field "FormTargetId" at "FormRules" array inside of cell
- And I send a "PUT" to "/form/_CreatedId_/body" replacing _CreatedId_ with rowName "FormId" type "integer"
- And I should see a status response code "400"
- And in the response I should see "FormTargetId does not exist or is deleted"
- @updateFormBody21
- # FORM - 791
- Scenario: Happy Path: 1 Section x 1 Grid
- Given I am authenticated
- And form "Behat HP" exists and associated with ClientId "1" and AppId "1"
- And I save CreatedId to DB at row name "FormId"
- And I send a json:
- """
- {
- "Sections":
- [
- {
- "Title": "El",
- "HelpDescription": "elena test",
- "PageBreakBefore": true,
- "Grids":
- [
- {
- "Rows": 1,
- "Columns": 1,
- "Cells": [
- {
- "RowSpan": 1,
- "AttributeId": 21,
- "XPosition": 1,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules": []
- }
- ],
- "XPosition": 0,
- "YPosition": 2,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules":[
- {
- "FormRuleTypeId": 1,
- "FormTargetId": 2,
- "Title": "Grid FORM Id = 5",
- "Description": "grid"
- }
- ]
- }
- ],
- "SignatureWidgets":
- [
- {
- "XPosition": 0,
- "YPosition": 3,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules":
- [
- {
- "FormRuleTypeId": 1,
- "FormTargetId": 1,
- "Title": "Widget Rule Title",
- "Description": "Widget Rule description"
- }
- ]
- }
- ],
- "XPosition": 0,
- "YPosition": 1,
- "IsReadOnly": true,
- "IsRequired": true,
- "IsVisible": true,
- "IsEnabled": true,
- "FormRules": [
- {
- "FormRuleTypeId": 1,
- "FormTargetId": 2,
- "Title": "Signature Widget Rule",
- "Description": "Signature Rule Description"
- }
- ]
- }
- ]
- }
- """
- # Update FormBody
- And I send a "PUT" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "200"
- And I send a "GET" to "/form/_CreatedId_/body" replacing variable with CreatedId
- And I should see a status response code "200"
- Then the "XPosition" form property inside of "Signatures" equals "0"
- And the "YPosition" form property inside of "Signatures" equals "3"
- Then the "IsReadOnly" form property inside of "Signatures" equals "true"
- And the "IsRequired" form property inside of "Signatures" equals "true"
- Then the "IsVisible" form property inside of "Signatures" equals "true"
- And the "IsEnabled" form property inside of "Signatures" equals "true"
- Then the "FormRuleTypeId" form property inside of "Signatures" and "FormRules" equals "1"
- Then the "FormTargetId" form property inside of "Signatures" and "FormRules" equals "1"
- Then the "Title" form property inside of "Signatures" and "FormRules" equals "Widget Rule Title"
- Then the "Description" form property inside of "Signatures" and "FormRules" equals "Widget Rule description"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement