@@ -67,23 +67,41 @@ test('Verify that user can add several fields and values during Stream key creat
67
67
test . only ( 'Verify that user can add new Stream Entry for Stream data type key which has an Entry ID, Field and Value' , async t => {
68
68
keyName = chance . word ( { length : 20 } ) ;
69
69
// Add New Stream Key
70
- await browserPage . addStreamKey ( keyName , keyField , keyValue ) ;
70
+ await browserPage . addStreamKey ( keyName , 'Field1' , 'Value1' ) ;
71
71
console . log ( `keyField: ${ keyField } ` ) ;
72
72
// Verify that when user adds a new Entry with not existed Field name, a new Field is added to the Stream
73
73
const paramsBeforeEntryAdding = await browserPage . getStreamRowColumnNumber ( ) ;
74
74
console . log ( `paramsBeforeEntryAdding: ${ paramsBeforeEntryAdding } ` ) ;
75
- await browserPage . addEntryToStream ( chance . word ( { length : 20 } ) , chance . word ( { length : 20 } ) ) ;
75
+ await browserPage . addEntryToStream ( 'Field2' , 'Value2' ) ;
76
76
// Compare that after adding new entry, new column and row were added
77
77
const paramsAfterEntryAdding = await browserPage . getStreamRowColumnNumber ( ) ;
78
78
await t . expect ( paramsAfterEntryAdding [ 0 ] ) . eql ( toString ( toNumber ( paramsBeforeEntryAdding [ 0 ] ) + 1 ) , 'Increased number of columns after adding' ) ;
79
79
await t . expect ( paramsAfterEntryAdding [ 1 ] ) . eql ( toString ( toNumber ( paramsBeforeEntryAdding [ 1 ] ) + 1 ) , 'Increased number of rows after adding' ) ;
80
+ // Print all columns name in Stream
81
+ let allColumns = await browserPage . streamEntriesContainer . find ( 'span' ) ;
82
+ let allColumnsLength = await allColumns . count ;
83
+ for ( let i = 0 ; i < allColumnsLength ; i ++ ) {
84
+ const col = await allColumns . nth ( i ) . textContent ;
85
+ console . log ( `column from span: ${ i } , ${ col } ` ) ;
86
+ }
87
+ // const allOtherColumns = await browserPage.streamEntriesContainer.find('[aria-colcount]').find('span');
88
+ // const allOtherColumnsLength = await allOtherColumns.count;
89
+ // for (let i = 0; i < allOtherColumnsLength; i++) {
90
+ // const columns2 = await allOtherColumns.nth(i).textContent;
91
+ // console.log(`column from entries container: ${i}, ${columns2}`);
92
+ // }
80
93
// Verify that when user adds a new Entry with already existed Field name, a new Field is available as column in the Stream table
81
94
const paramsBeforeExistedFieldAdding = await browserPage . getStreamRowColumnNumber ( ) ;
82
95
console . log ( `paramsBeforeExistedFieldAdding: ${ paramsBeforeExistedFieldAdding } ` ) ;
83
- await browserPage . addEntryToStream ( keyField , chance . word ( { length : 20 } ) ) ;
84
- console . log ( `keyField: ${ keyField } ` ) ;
96
+ await browserPage . addEntryToStream ( 'Field1' , 'Value3' ) ;
85
97
const paramsAfterExistedFieldAdding = await browserPage . getStreamRowColumnNumber ( ) ;
86
98
console . log ( `paramsAfterExistedFieldAdding: ${ paramsAfterExistedFieldAdding } ` ) ;
99
+ allColumns = await browserPage . streamEntriesContainer . find ( 'span' ) ;
100
+ allColumnsLength = await allColumns . count ;
101
+ for ( let i = 0 ; i < allColumnsLength ; i ++ ) {
102
+ const col = await allColumns . nth ( i ) . textContent ;
103
+ console . log ( `column from span: ${ i } , ${ col } ` ) ;
104
+ }
87
105
await t . expect ( paramsAfterExistedFieldAdding [ 1 ] ) . eql ( toString ( toNumber ( paramsBeforeExistedFieldAdding [ 1 ] ) + 1 ) , 'Increased number of rows after adding' ) ;
88
106
await t . expect ( paramsAfterExistedFieldAdding [ 0 ] ) . eql ( paramsBeforeExistedFieldAdding [ 0 ] , 'The same number of columns after adding' ) ;
89
107
} ) ;
0 commit comments