File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -859,6 +859,17 @@ export class BrowserPage extends InstancePage {
859
859
await t . click ( this . applyButton ) ;
860
860
}
861
861
862
+ /**
863
+ * Add json value inside the Json structure
864
+ * @param jsonKeyValue The value of the json key
865
+ */
866
+ async addJsonValueInsideStructure ( jsonKeyValue : string ) : Promise < void > {
867
+ await t . click ( this . expandJsonObject ) ;
868
+ await t . click ( this . addJsonFieldButton ) ;
869
+ await t . typeText ( this . jsonValueInput , jsonKeyValue , { paste : true } ) ;
870
+ await t . click ( this . applyButton ) ;
871
+ }
872
+
862
873
/**
863
874
* Add json structure
864
875
* @param jsonStructure The structure of the json key
Original file line number Diff line number Diff line change @@ -69,9 +69,8 @@ test('Verify that user can add key with value to any level of JSON structure for
69
69
// Check the added key contains json object with added key
70
70
await t . expect ( browserPage . addJsonObjectButton . exists ) . ok ( 'The add Json object button not found' , { timeout : 10000 } ) ;
71
71
await t . expect ( browserPage . jsonKeyValue . textContent ) . contains ( '"key1:"value1"}' , 'The json object value not found' ) ;
72
- // Add key with value inside the json
73
- await browserPage . addJsonKeyOnTheSameLevel ( '"key2"' , '{}' ) ;
74
- await browserPage . addJsonKeyInsideStructure ( '"key2222"' , '12345' ) ;
72
+ // Add value inside the json array
73
+ await browserPage . addJsonValueInsideStructure ( '12345' ) ;
75
74
// Check the added key contains json object with added key
76
- await t . expect ( browserPage . jsonKeyValue . textContent ) . contains ( 'key1:"value1"key2:{key2222: 12345}} ' , 'The json object value not found' ) ;
75
+ await t . expect ( browserPage . jsonKeyValue . textContent ) . contains ( '"70": 12345] ' , 'The json object value not found' ) ;
77
76
} ) ;
You can’t perform that action at this time.
0 commit comments