@@ -4,11 +4,49 @@ const publish = require("../../../../locators/publishWidgetspage.json");
44const dsl = require ( "../../../../fixtures/formdsl.json" ) ;
55const pages = require ( "../../../../locators/Pages.json" ) ;
66const widgetsPage = require ( "../../../../locators/Widgets.json" ) ;
7+ const explorer = require ( "../../../../locators/explorerlocators.json" ) ;
78
89describe ( "Form Widget Functionality" , function ( ) {
910 before ( ( ) => {
1011 cy . addDsl ( dsl ) ;
1112 } ) ;
13+ it ( "Defult Form text, Reset and Close button Validation" , function ( ) {
14+ cy . get ( widgetsPage . textWidget ) . should ( "be.visible" ) ;
15+ cy . get ( widgetsPage . formButtonWidget )
16+ . contains ( "Submit" )
17+ . scrollIntoView ( )
18+ . should ( "be.visible" ) ;
19+ cy . get ( widgetsPage . formButtonWidget )
20+ . contains ( "Reset" )
21+ . scrollIntoView ( )
22+ . should ( "be.visible" ) ;
23+ } ) ;
24+ it ( "Add Multiple widgets in Form" , function ( ) {
25+ cy . get ( explorer . addWidget ) . click ( ) ;
26+ cy . get ( commonlocators . entityExplorersearch ) . should ( "be.visible" ) ;
27+ cy . dragAndDropToWidget ( "multiselectwidget" , "formwidget" , {
28+ x : 100 ,
29+ y : 100 ,
30+ } ) ;
31+ cy . dragAndDropToWidget ( "inputwidget" , "formwidget" , { x : 50 , y : 200 } ) ;
32+ cy . get ( formWidgetsPage . multiselectWidget ) . should ( "be.visible" ) ;
33+ cy . get ( widgetsPage . inputWidget ) . should ( "be.visible" ) ;
34+ cy . PublishtheApp ( ) ;
35+ } ) ;
36+ it ( "Form_Widget Minimize and maximize General Validation" , function ( ) {
37+ cy . openPropertyPane ( "formwidget" ) ;
38+ cy . get ( commonlocators . generalChevran ) . click ( { force : true } ) ;
39+ cy . get ( commonlocators . generalSection ) . should ( "not.be.visible" ) ;
40+ cy . get ( commonlocators . generalChevran ) . click ( { force : true } ) ;
41+ cy . get ( commonlocators . generalSection ) . should ( "be.visible" ) ;
42+ cy . PublishtheApp ( ) ;
43+ } ) ;
44+ it ( "Rename Form widget from Entity Explorer" , function ( ) {
45+ cy . GlobalSearchEntity ( "Form1" ) ;
46+ cy . RenameEntity ( "Form" ) ;
47+ cy . wait ( 1000 ) ;
48+ cy . get ( ".t--entity" ) . should ( "contain" , "Form" ) ;
49+ } ) ;
1250 it ( "Form Widget Functionality" , function ( ) {
1351 cy . openPropertyPane ( "formwidget" ) ;
1452 /**
@@ -39,15 +77,14 @@ describe("Form Widget Functionality", function() {
3977 . scrollTo ( "bottom" )
4078 . should ( "be.visible" ) ;
4179 cy . get ( commonlocators . editPropCrossButton ) . click ( { force : true } ) ;
42- cy . PublishtheApp ( ) ;
4380 } ) ;
4481 it ( "Form Widget Functionality To Verify The Colour" , function ( ) {
82+ cy . PublishtheApp ( ) ;
4583 cy . get ( formWidgetsPage . formD )
4684 . should ( "have.css" , "background-color" )
4785 . and ( "eq" , "rgb(3, 179, 101)" ) ;
4886 } ) ;
4987 it ( "Form Widget Functionality To Unchecked Visible Widget" , function ( ) {
50- cy . get ( publish . backToEditor ) . click ( ) ;
5188 cy . openPropertyPane ( "formwidget" ) ;
5289 cy . togglebarDisable ( commonlocators . visibleCheckbox ) ;
5390 cy . PublishtheApp ( ) ;
@@ -61,7 +98,51 @@ describe("Form Widget Functionality", function() {
6198 cy . get ( publish . formWidget ) . should ( "be.visible" ) ;
6299 cy . get ( publish . backToEditor ) . click ( ) ;
63100 } ) ;
101+ it ( "Toggle JS - Form-Unckeck Visible field Validation" , function ( ) {
102+ cy . openPropertyPane ( "formwidget" ) ;
103+ //Uncheck the disabled checkbox using JS and validate
104+ cy . get ( widgetsPage . toggleVisible ) . click ( { force : true } ) ;
105+ cy . testJsontext ( "visible" , "false" ) ;
106+ cy . PublishtheApp ( ) ;
107+ cy . get ( publish . formWidget ) . should ( "not.exist" ) ;
108+ } ) ;
109+
110+ it ( "Toggle JS - Form-Check Visible field Validation" , function ( ) {
111+ cy . openPropertyPane ( "formwidget" ) ;
112+ //Check the disabled checkbox using JS and Validate
113+ cy . testJsontext ( "visible" , "true" ) ;
114+ cy . PublishtheApp ( ) ;
115+ cy . get ( publish . formWidget ) . should ( "be.visible" ) ;
116+ } ) ;
117+ it ( "Explore Widget related documents Verification" , function ( ) {
118+ // Open property pane
119+ cy . openPropertyPane ( "formwidget" ) ;
120+ // Click on "Explore widget related docs" button
121+ cy . get ( widgetsPage . exploreWidget ) . click ( ) ;
122+ // Verify the widget related document
123+ cy . get ( widgetsPage . widgetRelatedDocument ) . should ( "contain" , "Form" ) ;
124+ cy . wait ( 500 ) ;
125+ cy . get ( widgetsPage . header ) . click ( ) ;
126+ cy . PublishtheApp ( ) ;
127+ } ) ;
128+ it ( "Form-Copy Verification" , function ( ) {
129+ cy . openPropertyPane ( "formwidget" ) ;
130+ const modifierKey = Cypress . platform === "darwin" ? "meta" : "ctrl" ;
131+ //Copy Form and verify all properties
132+ cy . copyWidget ( "formwidget" , widgetsPage . formWidget ) ;
133+
134+ cy . PublishtheApp ( ) ;
135+ } ) ;
136+
137+ it ( "Form-Delete Verification" , function ( ) {
138+ cy . openPropertyPane ( "formwidget" ) ;
139+ // Delete the Form widget
140+ cy . deleteWidget ( widgetsPage . formWidget ) ;
141+ cy . PublishtheApp ( ) ;
142+ cy . get ( widgetsPage . formWidget ) . should ( "not.exist" ) ;
143+ } ) ;
64144} ) ;
65145afterEach ( ( ) => {
66146 // put your clean up code if any
147+ cy . goToEditFromPublish ( ) ;
67148} ) ;
0 commit comments