Details

    • Technical Testing
    • Status: Closed
    • Minor
    • Resolution: Completed
    • None
    • None
    • Pages > Page Editor
    • None

    Description

      Test Cases

      Case 1:
      When type in the configuration text field, the field can constraint min and max length

      1. Add a Page Fragments collection
      2. Add a new fragment with the following json and html code
        	{
        		"fieldSets": [
        			{
        				"fields": [
        					{
        						"label": "Component",
        						"name": "component",
        						"type": "text",
        						"typeOptions": {
        				        	"placeholder": "WCM",
        							"validation": {
        						    	"errorMessage": "Please enter 3-10 characters",
        						    	"type": "text",
        						    	"minLength": 3,
        						    	"maxLength": 10
        							}
        						}
        					}
        				]
        			}
        		]
        	}
        
        	<div class="fragment_xxxxx">
        	  <div class="portlet-msg-info">Please enter info in configuration.</div>
        	</div>
        
      3. Add a page based on Blank
      4. Add the new fragment to page
      5. Click configuration button
      6. Assert Component field is shown in panel
      7. Type WC
      8. Assert the following alert message is shown
        • Please enter 3-10 characters
      9. Type Web Content Management
      10. Assert only Web Conten is shown in field
      11. Type Search
      12. Assert Search is shown in field
      13. Assert the above alert message is not shown

      Case 2:
      When type in the configuration text field, the field can validate if it is integer

      1. Add a Page Fragments collection
      2. Add a new fragment with the following json and html code
        	{
        		"fieldSets": [
        			{
        				"fields": [
        					{
        						"label": "Integer",
        						"name": "integer",
        						"type": "text",
        						"typeOptions": {
        				        	"placeholder": "20",
        							"validation": {
        						    	"errorMessage": "Please enter an integer",
        						    	"type": "number",
        							}
        						}
        					}
        				]
        			}
        		]
        	}
        
        	<div class="fragment_xxxxx">
        	  <div class="portlet-msg-info">Please enter info in configuration.</div>
        	</div>
        
      3. Add a page based on Blank
      4. Add the new fragment to page
      5. Click configuration button
      6. Assert Integer field is shown in panel
      7. Type 2.5
      8. Assert the following alert message is shown
        • Please enter an integer
      9. Type com
      10. Assert com is not shown in field
      11. Type 10
      12. Assert 10 is shown in field
      13. Assert the above alert message is not shown

      Case 3:
      When type in the configuration text field, the field can validate if it is email address

      1. Add a Page Fragments collection
      2. Add a new fragment with the following json and html code
        	{
        		"fieldSets": [
        			{
        				"fields": [
        					{
        						"label": "Email Address",
        						"name": "emailAddress",
        						"type": "text",
        						"typeOptions": {
        			        		"placeholder": "[email protected]",
        							"validation": {
        							"errorMessage": "Please enter a valid email address",
        							"type": "email",
        							}
        						}
        					}
        				]
        			}
        		]
        	}
        
        	<div class="fragment_xxxxx">
        	  <div class="portlet-msg-info">Please enter info in configuration.</div>
        	</div>
        
      3. Add a page based on Blank
      4. Add the new fragment to page
      5. Click configuration button
      6. Assert Email Address field is shown in panel
      7. Type @liferay.com
      8. Assert the following alert message is shown
        • Please enter a valid email address
      9. Type [email protected]
      10. Assert the above alert message is not shown

      Case 4:
      When type in the configuration text field, the field can validate if it is URL

      1. Add a Page Fragments collection
      2. Add a new fragment with the following json and html code
        	{
        		"fieldSets": [
        			{
        				"fields": [
        					{
        						"label": "URL",
        						"name": "url",
        						"type": "text",
        						"typeOptions": {
        			        		"placeholder": "https://issues.liferay.com",
        							"validation": {
        								"errorMessage": "Please enter a valid URL",
        								"type": "url",
        							}
        						}
        					}
        				]
        			}
        		]
        	}
        
        	<div class="fragment_xxxxx">
        	  <div class="portlet-msg-info">Please enter info in configuration.</div>
        	</div>
        
      3. Add a page based on Blank
      4. Add the new fragment to page
      5. Click configuration button
      6. Assert URL field is shown in panel
      7. Type issues.liferay.com
      8. Assert the following alert message is shown
        • Please enter a valid URL
      9. Type https://web.liferay.com
      10. Assert the above alert message is not shown

      Case 5:
      When type in the configuration text field, the field can validate if it is a specific pattern

      1. Add a Page Fragments collection
      2. Add a new fragment with the following json and html code
        	{
        		"fieldSets": [
        			{
        				"fields": [
        					{
        						"label": "Gender",
        						"name": "gender",
        						"type": "text",
        						"typeOptions": {
        			        	"placeholder": "male",
        						"validation": {
        							"errorMessage": "Please enter a valid gender",
        							"type": "pattern",
        							"regexp": "female|male",
        							}
        						}
        					}
        				]
        			}
        		]
        	}
        
        	<div class="fragment_xxxxx">
        	  <div class="portlet-msg-info">Please enter info in configuration.</div>
        	</div>
        
      3. Add a page based on Blank
      4. Add the new fragment to page
      5. Click configuration button
      6. Assert Gender field is shown in panel
      7. Type boy
      8. Assert the following alert message is shown
        • Please enter a valid gender
      9. Type female
      10. Assert the above alert message is not shown

      Case 6:
      When type integer in the configuration text field, the field can constraint min and max value

      1. Add a Page Fragments collection
      2. Add a new fragment with the following json and html code
        	{
        		"fieldSets": [
        			{
        				"fields": [
        					{
        						"label": "Age",
        						"name": "age",
        						"type": "text",
        						"typeOptions": {
        				        	"placeholder": "25",
        							"validation": {
        						    	"errorMessage": "Please enter a valid age",
        						    	"type": "number",
        						    	"min": 18,
        						    	"max": 65
        							}
        						}
        					}
        				]
        			}
        		]
        	}
        
        	<div class="fragment_xxxxx">
        	  <div class="portlet-msg-info">Please enter info in configuration.</div>
        	</div>
        
      3. Add a page based on Blank
      4. Add the new fragment to page
      5. Click configuration button
      6. Assert Age field is shown in panel
      7. Type 10
      8. Assert the following alert message is shown
        • Please enter a valid age
      9. Type 70
      10. Assert the above alert message is shown
      11. Type 30
      12. Assert the above alert message is not shown

      Case 7:
      When type email address in the configuration text field, the field can constraint min and max length

      1. Add a Page Fragments collection
      2. Add a new fragment with the following json and html code
        	{
        		"fieldSets": [
        			{
        				"fields": [
        					{
        						"label": "Email Address",
        						"name": "emailAddress",
        						"type": "text",
        						"typeOptions": {
        			        		"placeholder": "[email protected]",
        							"validation": {
        							"errorMessage": "Please enter a email address with 14-30 characters",
        							"type": "email",
        							"minLength": 14,
        							"maxLength": 30
        							}
        						}
        					}
        				]
        			}
        		]
        	}
        
        	<div class="fragment_xxxxx">
        	  <div class="portlet-msg-info">Please enter info in configuration.</div>
        	</div>
        
      3. Add a page based on Blank
      4. Add the new fragment to page
      5. Click configuration button
      6. Assert Email Address field is shown in panel
      7. Type [email protected]
      8. Assert the following alert message is shown
        • Please enter a email address with 14-30 characters
      9. Type [email protected]
      10. Assert only [email protected] is shown in field
      11. Assert the above alert message is shown
      12. Type [email protected]
      13. Assert the above alert message is not shown

      Case 8:
      When type URL in the configuration text field, the field can constraint min and max length

      1. Add a Page Fragments collection
      2. Add a new fragment with the following json and html code
        	{
        		"fieldSets": [
        			{
        				"fields": [
        					{
        						"label": "URL",
        						"name": "url",
        						"type": "text",
        						"typeOptions": {
        			        		"placeholder": "https://issues.liferay.com",
        							"validation": {
        								"errorMessage": "Please enter a valid URL with 22-35 characters",
        								"type": "url",
        								"minLength": 22,
        								"maxLength": 35
        							}
        						}
        					}
        				]
        			}
        		]
        	}
        
        	<div class="fragment_xxxxx">
        	  <div class="portlet-msg-info">Please enter info in configuration.</div>
        	</div>
        
      3. Add a page based on Blank
      4. Add the new fragment to page
      5. Click configuration button
      6. Assert URL field is shown in panel
      7. Type https://w.liferay.com
      8. Assert the following alert message is shown
        • Please enter a valid URL with 22-35 characters
      9. Type https://giannisantetokounmpo.liferay.com
      10. Assert only https://giannisantetokounmpo.lifera is shown in field
      11. Type https://testray.liferay.com
      12. Assert the above alert message is not shown

      Attachments

        Activity

          People

            david.gutierrez David Gutiérrez Mesa
            david.gutierrez David Gutiérrez Mesa
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Packages

                Version Package