Skip to content

Commit e44412c

Browse files
author
Alena Naboka
committed
[E2E] Fix Stream Test
1 parent 3892ad9 commit e44412c

File tree

2 files changed

+10
-124
lines changed

2 files changed

+10
-124
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, {replace: true});
357-
await t.typeText(this.streamValue, value, {replace: true});
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: 8 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -64,137 +64,23 @@ test('Verify that user can add several fields and values during Stream key creat
6464
await t.click(browserPage.addKeyButton);
6565
await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).visible).ok('Stream Key Name');
6666
});
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 => {
6868
keyName = chance.word({ length: 20 });
69+
const newField = chance.word({ length: 20 });
6970
// 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);
8272
// 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 }));
8475
// Compare that after adding new entry, new column and row were added
8576
const paramsAfterEntryAdding = await browserPage.getStreamRowColumnNumber();
8677
await t.expect(paramsAfterEntryAdding[0]).eql(toString(toNumber(paramsBeforeEntryAdding[0]) + 1), 'Increased number of columns after adding');
8778
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-
// }
13779
// 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 }));
14481
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');
19884
});
19985
test('Verify that during new entry adding to existing Stream, user can clear the value and the row itself', async t => {
20086
keyName = chance.word({ length: 20 });

0 commit comments

Comments
 (0)