@@ -64,137 +64,23 @@ test('Verify that user can add several fields and values during Stream key creat
64
64
await t . click ( browserPage . addKeyButton ) ;
65
65
await t . expect ( browserPage . keyNameFormDetails . withExactText ( keyName ) . visible ) . ok ( 'Stream Key Name' ) ;
66
66
} ) ;
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 => {
67
+ test ( '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
+ const newField = chance . word ( { length : 20 } ) ;
69
70
// Add New Stream Key
70
- await browserPage . addStreamKey ( keyName , 'Field1' , 'Value1' ) ;
71
-
72
- // Print fields after adding
73
- const paramsBeforeEntryAdding = await browserPage . getStreamRowColumnNumber ( ) ;
74
- console . log ( `paramsBeforeEntryAdding: ${ paramsBeforeEntryAdding } ` ) ;
75
- console . log ( 'Printed fields and values after stream creation' ) ;
76
- let allColumns = await browserPage . streamEntriesContainer . find ( 'span' ) ;
77
- let allColumnsLength = await allColumns . count ;
78
- for ( let i = 0 ; i < allColumnsLength ; i ++ ) {
79
- const col = await allColumns . nth ( i ) . textContent ;
80
- console . log ( `column from span: ${ i } , ${ col } ` ) ;
81
- }
71
+ await browserPage . addStreamKey ( keyName , keyField , keyValue ) ;
82
72
// Verify that when user adds a new Entry with not existed Field name, a new Field is added to the Stream
83
- await browserPage . addEntryToStream ( 'Field2' , 'Value2' ) ;
73
+ const paramsBeforeEntryAdding = await browserPage . getStreamRowColumnNumber ( ) ;
74
+ await browserPage . addEntryToStream ( newField , chance . word ( { length : 20 } ) ) ;
84
75
// Compare that after adding new entry, new column and row were added
85
76
const paramsAfterEntryAdding = await browserPage . getStreamRowColumnNumber ( ) ;
86
77
await t . expect ( paramsAfterEntryAdding [ 0 ] ) . eql ( toString ( toNumber ( paramsBeforeEntryAdding [ 0 ] ) + 1 ) , 'Increased number of columns after adding' ) ;
87
78
await t . expect ( paramsAfterEntryAdding [ 1 ] ) . eql ( toString ( toNumber ( paramsBeforeEntryAdding [ 1 ] ) + 1 ) , 'Increased number of rows after adding' ) ;
88
- // Print all columns name in Stream
89
- allColumns = await browserPage . streamEntriesContainer . find ( 'span' ) ;
90
- allColumnsLength = await allColumns . count ;
91
- for ( let i = 0 ; i < allColumnsLength ; i ++ ) {
92
- const col = await allColumns . nth ( i ) . textContent ;
93
- console . log ( `column from span: ${ i } , ${ col } ` ) ;
94
- }
95
- // const allOtherColumns = await browserPage.streamEntriesContainer.find('[aria-colcount]').find('span');
96
- // const allOtherColumnsLength = await allOtherColumns.count;
97
- // for (let i = 0; i < allOtherColumnsLength; i++) {
98
- // const columns2 = await allOtherColumns.nth(i).textContent;
99
- // console.log(`column from entries container: ${i}, ${columns2}`);
100
- // }
101
- // Verify that when user adds a new Entry with already existed Field name, a new Field is available as column in the Stream table
102
- // const paramsBeforeExistedFieldAdding = await browserPage.getStreamRowColumnNumber();
103
- // console.log(`paramsBeforeExistedFieldAdding: ${paramsBeforeExistedFieldAdding}`);
104
- // await browserPage.addEntryToStream('Field1', 'Value3');
105
- // const paramsAfterExistedFieldAdding = await browserPage.getStreamRowColumnNumber();
106
- // console.log(`paramsAfterExistedFieldAdding: ${paramsAfterExistedFieldAdding}`);
107
- // allColumns = await browserPage.streamEntriesContainer.find('span');
108
- // allColumnsLength = await allColumns.count;
109
- // for (let i = 0; i < allColumnsLength; i++) {
110
- // const col = await allColumns.nth(i).textContent;
111
- // console.log(`column from span: ${i}, ${col}`);
112
- // }
113
- // await t.expect(paramsAfterExistedFieldAdding[1]).eql(toString(toNumber(paramsBeforeExistedFieldAdding[1]) + 1), 'Increased number of rows after adding');
114
- // await t.expect(paramsAfterExistedFieldAdding[0]).eql(paramsBeforeExistedFieldAdding[0], 'The same number of columns after adding');
115
- } ) ;
116
- test . only ( 'Stream for existed fields' , async t => {
117
- keyName = chance . word ( { length : 20 } ) ;
118
- // Add New Stream Key
119
- await browserPage . addStreamKey ( keyName , 'Field1' , 'Value1' ) ;
120
-
121
- // Print number and all fields and values
122
- const paramsBeforeEntryAdding = await browserPage . getStreamRowColumnNumber ( ) ;
123
- console . log ( `paramsBeforeEntryAdding: ${ paramsBeforeEntryAdding } ` ) ;
124
- // Print all columns name in Stream
125
- let allColumns = await browserPage . streamEntriesContainer . find ( 'span' ) ;
126
- let allColumnsLength = await allColumns . count ;
127
- for ( let i = 0 ; i < allColumnsLength ; i ++ ) {
128
- const col = await allColumns . nth ( i ) . textContent ;
129
- console . log ( `column from span: ${ i } , ${ col } ` ) ;
130
- }
131
- // const allOtherColumns = await browserPage.streamEntriesContainer.find('[aria-colcount]').find('span');
132
- // const allOtherColumnsLength = await allOtherColumns.count;
133
- // for (let i = 0; i < allOtherColumnsLength; i++) {
134
- // const columns2 = await allOtherColumns.nth(i).textContent;
135
- // console.log(`column from entries container: ${i}, ${columns2}`);
136
- // }
137
79
// Verify that when user adds a new Entry with already existed Field name, a new Field is available as column in the Stream table
138
- const paramsBeforeExistedFieldAdding = await browserPage . getStreamRowColumnNumber ( ) ;
139
-
140
- // Add entry with existed field
141
- await browserPage . addEntryToStream ( 'Field1' , 'Value3' ) ;
142
-
143
- // Print number and fields with values after adding
80
+ await browserPage . addEntryToStream ( newField , chance . word ( { length : 20 } ) ) ;
144
81
const paramsAfterExistedFieldAdding = await browserPage . getStreamRowColumnNumber ( ) ;
145
- console . log ( `paramsAfterExistedFieldAdding: ${ paramsAfterExistedFieldAdding } ` ) ;
146
-
147
- allColumns = await browserPage . streamEntriesContainer . find ( 'span' ) ;
148
- allColumnsLength = await allColumns . count ;
149
- for ( let i = 0 ; i < allColumnsLength ; i ++ ) {
150
- const col = await allColumns . nth ( i ) . textContent ;
151
- console . log ( `column from span: ${ i } , ${ col } ` ) ;
152
- }
153
-
154
- await t . expect ( paramsAfterExistedFieldAdding [ 1 ] ) . eql ( toString ( toNumber ( paramsBeforeExistedFieldAdding [ 1 ] ) + 1 ) , 'Increased number of rows after adding' ) ;
155
- await t . expect ( paramsAfterExistedFieldAdding [ 0 ] ) . eql ( paramsBeforeExistedFieldAdding [ 0 ] , 'The same number of columns after adding' ) ;
156
- } ) ;
157
- test . only ( 'Stream for existed fields with another function' , async t => {
158
- keyName = chance . word ( { length : 20 } ) ;
159
- // Add New Stream Key
160
- await browserPage . addStreamKey ( keyName , 'Field1' , 'Value1' ) ;
161
- await browserPage . addEntryToStream ( 'Field2' , 'Value2' ) ;
162
-
163
- // Print number and all fields and values
164
- const paramsBeforeEntryAdding = await browserPage . getStreamRowColumnNumber ( ) ;
165
- console . log ( `paramsBeforeEntryAdding: ${ paramsBeforeEntryAdding } ` ) ;
166
- // Print all columns name in Stream
167
- let allColumns = await browserPage . streamEntriesContainer . find ( 'span' ) ;
168
- let allColumnsLength = await allColumns . count ;
169
- for ( let i = 0 ; i < allColumnsLength ; i ++ ) {
170
- const col = await allColumns . nth ( i ) . textContent ;
171
- console . log ( `column from span: ${ i } , ${ col } ` ) ;
172
- }
173
- // const allOtherColumns = await browserPage.streamEntriesContainer.find('[aria-colcount]').find('span');
174
- // const allOtherColumnsLength = await allOtherColumns.count;
175
- // for (let i = 0; i < allOtherColumnsLength; i++) {
176
- // const columns2 = await allOtherColumns.nth(i).textContent;
177
- // console.log(`column from entries container: ${i}, ${columns2}`);
178
- // }
179
- // Verify that when user adds a new Entry with already existed Field name, a new Field is available as column in the Stream table
180
- const paramsBeforeExistedFieldAdding = await browserPage . getStreamRowColumnNumber ( ) ;
181
-
182
- // Add entry with existed field
183
- await browserPage . addEntryToStream ( 'Field2' , 'Value3' ) ;
184
-
185
- // Print number and fields with values after adding
186
- const paramsAfterExistedFieldAdding = await browserPage . getStreamRowColumnNumber ( ) ;
187
- console . log ( `paramsAfterExistedFieldAdding: ${ paramsAfterExistedFieldAdding } ` ) ;
188
-
189
- allColumns = await browserPage . streamEntriesContainer . find ( 'span' ) ;
190
- allColumnsLength = await allColumns . count ;
191
- for ( let i = 0 ; i < allColumnsLength ; i ++ ) {
192
- const col = await allColumns . nth ( i ) . textContent ;
193
- console . log ( `column from span: ${ i } , ${ col } ` ) ;
194
- }
195
-
196
- await t . expect ( paramsAfterExistedFieldAdding [ 1 ] ) . eql ( toString ( toNumber ( paramsBeforeExistedFieldAdding [ 1 ] ) + 1 ) , 'Increased number of rows after adding' ) ;
197
- await t . expect ( paramsAfterExistedFieldAdding [ 0 ] ) . eql ( paramsBeforeExistedFieldAdding [ 0 ] , 'The same number of columns after adding' ) ;
82
+ await t . expect ( paramsAfterExistedFieldAdding [ 1 ] ) . eql ( toString ( toNumber ( paramsAfterEntryAdding [ 1 ] ) + 1 ) , 'Increased number of rows after adding' ) ;
83
+ await t . expect ( paramsAfterExistedFieldAdding [ 0 ] ) . eql ( paramsAfterEntryAdding [ 0 ] , 'The same number of columns after adding' ) ;
198
84
} ) ;
199
85
test ( 'Verify that during new entry adding to existing Stream, user can clear the value and the row itself' , async t => {
200
86
keyName = chance . word ( { length : 20 } ) ;
0 commit comments