Skip to content

Commit 3892ad9

Browse files
author
Alena Naboka
committed
[E2E] Add logs to stream test
1 parent a40437e commit 3892ad9

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

tests/e2e/pageObjects/browser-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ export class BrowserPage {
353353
await t.click(this.streamOption);
354354
// Verify that user can see Entity ID filled by * by default on add Stream key form
355355
await t.expect(this.streamEntryId.withAttribute('value', '*').visible).ok('Preselected Stream Entity ID field');
356-
await t.typeText(this.streamField, field);
357-
await t.typeText(this.streamValue, value);
356+
await t.typeText(this.streamField, field, {replace: true});
357+
await t.typeText(this.streamValue, value, {replace: true});
358358
await t.expect(this.addKeyButton.withAttribute('disabled').exists).notOk('Clickable Add Key button');
359359
await t.click(this.addKeyButton);
360360
await t.click(this.toastCloseButton);

tests/e2e/tests/critical-path/browser/stream-key.e2e.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,48 @@ test.only('Stream for existed fields', async t => {
154154
await t.expect(paramsAfterExistedFieldAdding[1]).eql(toString(toNumber(paramsBeforeExistedFieldAdding[1]) + 1), 'Increased number of rows after adding');
155155
await t.expect(paramsAfterExistedFieldAdding[0]).eql(paramsBeforeExistedFieldAdding[0], 'The same number of columns after adding');
156156
});
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');
198+
});
157199
test('Verify that during new entry adding to existing Stream, user can clear the value and the row itself', async t => {
158200
keyName = chance.word({ length: 20 });
159201
// Generate data for stream

0 commit comments

Comments
 (0)