1
- import path from 'path' ;
1
+ import * as path from 'path' ;
2
2
import { rte } from '../../../../helpers/constants' ;
3
3
import { DatabaseHelper } from '../../../../helpers/database' ;
4
4
import { BrowserPage } from '../../../../pageObjects' ;
@@ -17,7 +17,6 @@ const keyTTL = '2147476121';
17
17
const value = '{"name":"xyz"}' ;
18
18
const jsonObjectValue = '{name:"xyz"}' ;
19
19
const jsonFilePath = path . join ( '..' , '..' , '..' , '..' , 'test-data' , 'big-json' , 'big-json.json' ) ;
20
- const jsonString = Common . getJsonFileAsString ( jsonFilePath ) ;
21
20
22
21
fixture `JSON Key verification`
23
22
. meta ( { type : 'smoke' , rte : rte . standalone } )
@@ -55,15 +54,18 @@ test('Verify that user can add key with value to any level of JSON structure', a
55
54
test ( 'Verify that user can add key with value to any level of JSON structure for big JSON object' , async t => {
56
55
keyName = Common . generateWord ( 10 ) ;
57
56
// Add Json key with json object
58
- await browserPage . addJsonKey ( keyName , jsonString , keyTTL ) ;
57
+ await t . click ( browserPage . plusAddKeyButton ) ;
58
+ await t . click ( browserPage . keyTypeDropDown ) ;
59
+ await t . click ( browserPage . jsonOption ) ;
60
+ await t . click ( browserPage . addKeyNameInput ) ;
61
+ await t . typeText ( browserPage . addKeyNameInput , keyName , { replace : true , paste : true } ) ;
62
+ await t . setFilesToUpload ( browserPage . jsonUploadInput , [ jsonFilePath ] ) ;
63
+ await t . click ( browserPage . addKeyButton ) ;
59
64
// Check the notification message
60
65
const notification = browserPage . Toast . toastHeader . textContent ;
61
66
await t . expect ( notification ) . contains ( 'Key has been added' , 'The notification not found' ) ;
62
- // Verify that user can create JSON object
63
- await t . expect ( browserPage . addJsonObjectButton . exists ) . ok ( 'The add Json object button not found' , { timeout : 10000 } ) ;
64
- await t . expect ( browserPage . jsonKeyValue . textContent ) . eql ( jsonObjectValue , 'The json object value not found' ) ;
65
-
66
67
// Add key with value on the same level
68
+ await t . debug ( )
67
69
await browserPage . addJsonKeyOnTheSameLevel ( '"key1"' , '"value1"' ) ;
68
70
// Check the added key contains json object with added key
69
71
await t . expect ( browserPage . addJsonObjectButton . exists ) . ok ( 'The add Json object button not found' , { timeout : 10000 } ) ;
0 commit comments