@@ -5,12 +5,15 @@ import { commonUrl, ossStandaloneBigConfig, ossStandaloneConfig } from '../../..
5
5
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database' ;
6
6
import { Common } from '../../../../helpers/common' ;
7
7
import { BrowserActions } from '../../../../common-actions/browser-actions' ;
8
+ import path from 'path' ;
8
9
9
10
const browserPage = new BrowserPage ( ) ;
10
11
const browserActions = new BrowserActions ( ) ;
11
12
const databaseHelper = new DatabaseHelper ( ) ;
12
13
const databaseAPIRequests = new DatabaseAPIRequests ( ) ;
13
14
15
+ const jsonFilePath = path . join ( '..' , '..' , '..' , '..' , 'test-data' , 'big-json' , 'json-BigInt.json' ) ;
16
+
14
17
const jsonKeys = [ [ 'JSON-string' , '"test"' ] , [ 'JSON-number' , '782364' ] , [ 'JSON-boolean' , 'true' ] , [ 'JSON-null' , 'null' ] , [ 'JSON-array' , '[1, 2, 3]' ] ] ;
15
18
let keyNames : string [ ] ;
16
19
let indexName : string ;
@@ -105,3 +108,32 @@ test
105
108
// Verify that the new key is not displayed at the top for the Search capability
106
109
await browserActions . verifyKeyIsNotDisplayedTop ( keyName3 ) ;
107
110
} ) ;
111
+ test ( 'Verify that user can add json with BigInt' , async t => {
112
+ const keyName = Common . generateWord ( 12 ) ;
113
+
114
+ // Add Json key with json object
115
+ await t . click ( browserPage . plusAddKeyButton ) ;
116
+ await t . click ( browserPage . keyTypeDropDown ) ;
117
+ await t . click ( browserPage . jsonOption ) ;
118
+ await t . click ( browserPage . addKeyNameInput ) ;
119
+ await t . typeText ( browserPage . addKeyNameInput , keyName , { replace : true , paste : true } ) ;
120
+ await t . setFilesToUpload ( browserPage . jsonUploadInput , [ jsonFilePath ] ) ;
121
+ await t . click ( browserPage . addKeyButton ) ;
122
+
123
+ await t . click ( browserPage . editJsonObjectButton ) ;
124
+ await t . expect ( await browserPage . jsonValueInput . textContent ) . contains ( 'result' , 'edit value is empty' ) ;
125
+ await t . click ( browserPage . cancelEditButton ) ;
126
+
127
+ await t . click ( browserPage . expandJsonObject ) ;
128
+ await t . click ( browserPage . expandJsonObject ) ;
129
+ await t . expect ( await browserPage . jsonKeyValue . textContent ) . contains ( '1.2345678998765432e+24' , 'BigInt is not displayed' ) ;
130
+ await t . expect ( await browserPage . jsonKeyValue . textContent ) . contains ( '123456789987654321' , 'BigInt is not displayed' ) ;
131
+
132
+ await browserPage . addJsonKeyOnTheSameLevel ( '"key2"' , '7777777777888889455' ) ;
133
+ await t . expect ( await browserPage . jsonKeyValue . textContent ) . contains ( '7777777777888889455' , 'BigInt is not displayed' ) ;
134
+
135
+ await t . click ( browserPage . editJsonObjectButton . nth ( 3 ) ) ;
136
+ await t . typeText ( browserPage . jsonValueInput , '121212121111112121212111' , { paste : true , replace : true } ) ;
137
+ await t . click ( browserPage . applyEditButton ) ;
138
+ await t . expect ( await browserPage . jsonKeyValue . textContent ) . contains ( '1.2121212111111212e+23' , 'BigInt is not displayed' ) ;
139
+ } ) ;
0 commit comments