From ba2a4a8c95a70441a8951adb5fe597e579c6ddd8 Mon Sep 17 00:00:00 2001 From: "tatsiana.trayanava" Date: Wed, 25 May 2022 11:41:33 +0300 Subject: [PATCH] fix e2es --- tests/e2e/pageObjects/browser-page.ts | 3 ++- .../critical-path/browser/stream-key-entry-deletion.e2e.ts | 2 +- tests/e2e/tests/critical-path/browser/stream-key.e2e.ts | 6 +++++- tests/e2e/tests/regression/browser/stream-key.e2e.ts | 6 ++++-- tests/e2e/tests/regression/cli/cli-command-helper.e2e.ts | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/e2e/pageObjects/browser-page.ts b/tests/e2e/pageObjects/browser-page.ts index 8eab09a736..0299211b78 100644 --- a/tests/e2e/pageObjects/browser-page.ts +++ b/tests/e2e/pageObjects/browser-page.ts @@ -172,9 +172,10 @@ export class BrowserPage { streamEntryColumns = Selector(this.streamEntriesContainer.find('[aria-colcount]')); streamEntryRows = Selector(this.streamEntriesContainer.find('[aria-rowcount]')); streamEntryDate = Selector('[data-testid*=-date][data-testid*=stream-entry]'); + streamEntryIdValue = Selector('.streamEntryId[data-testid*=stream-entry]'); streamFields = Selector('[data-test-id=stream-entries-container] .truncateText span'); streamEntryFields = Selector('[data-testid^=stream-entry-field]'); - confirmationMessagePopover = Selector('div.euiPopover__panel'); + confirmationMessagePopover = Selector('div.euiPopover__panel .euiText '); /** * Common part for Add any new key diff --git a/tests/e2e/tests/critical-path/browser/stream-key-entry-deletion.e2e.ts b/tests/e2e/tests/critical-path/browser/stream-key-entry-deletion.e2e.ts index ce031fbbe1..ade40b0724 100644 --- a/tests/e2e/tests/critical-path/browser/stream-key-entry-deletion.e2e.ts +++ b/tests/e2e/tests/critical-path/browser/stream-key-entry-deletion.e2e.ts @@ -55,7 +55,7 @@ test('Verify that the Stream information is refreshed and the deleted entry is r const fieldName = await browserPage.streamFields.nth(i).textContent; await t.expect(fieldName).notEql(fieldForDeletion, 'The deleted entry is removed from the Stream'); } - await t.click(browserPage.fullScreenModeButton.nth(1)); + await t.click(browserPage.fullScreenModeButton); }); test('Verify that when user delete the last Entry from the Stream the Stream key is not deleted', async t => { keyName = chance.word({length: 20}); diff --git a/tests/e2e/tests/critical-path/browser/stream-key.e2e.ts b/tests/e2e/tests/critical-path/browser/stream-key.e2e.ts index 0ea1051234..07aa093181 100644 --- a/tests/e2e/tests/critical-path/browser/stream-key.e2e.ts +++ b/tests/e2e/tests/critical-path/browser/stream-key.e2e.ts @@ -12,7 +12,7 @@ import { const browserPage = new BrowserPage(); const chance = new Chance(); -const keyName = chance.word({ length: 20 }); +let keyName = chance.word({ length: 20 }); const keyField = chance.word({ length: 20 }); const keyValue = chance.word({ length: 20 }); @@ -28,6 +28,7 @@ fixture `Stream Key` await deleteDatabase(ossStandaloneConfig.databaseName); }); test('Verify that user can create Stream key via Add New Key form', async t => { + keyName = chance.word({ length: 20 }); // Add New Stream Key await browserPage.addStreamKey(keyName, keyField, keyValue); // Verify that user can see Stream details opened after key creation @@ -64,6 +65,7 @@ test('Verify that user can add several fields and values during Stream key creat await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).visible).ok('Stream Key Name'); }); test('Verify that user can add new Stream Entry for Stream data type key which has an Entry ID, Field and Value', async t => { + keyName = chance.word({ length: 20 }); // Add New Stream Key await browserPage.addStreamKey(keyName, keyField, keyValue); // Verify that when user adds a new Entry with not existed Field name, a new Field is added to the Stream @@ -81,6 +83,7 @@ test('Verify that user can add new Stream Entry for Stream data type key which h await t.expect(paramsAfterExistedFieldAdding[1]).eql(toString(toNumber(paramsBeforeExistedFieldAdding[1]) + 1), 'Increased number of rows after adding'); }); test('Verify that during new entry adding to existing Stream, user can clear the value and the row itself', async t => { + keyName = chance.word({ length: 20 }); // Generate data for stream const fields = [keyField, chance.word({ length: 20 })]; const values = [keyValue, chance.word({ length: 20 })]; @@ -107,6 +110,7 @@ test('Verify that during new entry adding to existing Stream, user can clear the await t.expect(browserPage.streamField.count).eql(fieldsNumberAfterDeletion, 'Number of fields after deletion'); }); test('Verify that user can add several fields and values to the existing Stream Key', async t => { + keyName = chance.word({ length: 20 }); // Generate field value data const entryQuantity = 10; const fields: string[] = []; diff --git a/tests/e2e/tests/regression/browser/stream-key.e2e.ts b/tests/e2e/tests/regression/browser/stream-key.e2e.ts index e695eba7b2..968e194018 100644 --- a/tests/e2e/tests/regression/browser/stream-key.e2e.ts +++ b/tests/e2e/tests/regression/browser/stream-key.e2e.ts @@ -90,7 +90,7 @@ test('Verify that user can see all the columns are displayed by default for Stre const fieldName = await browserPage.streamFields.nth(i).textContent; await t.expect(fieldName).eql(fields[i], 'All the columns are displayed by default for Stream'); } - await t.click(browserPage.fullScreenModeButton.nth(1)); + await t.click(browserPage.fullScreenModeButton); }); test('Verify that the multi-line cell value tooltip is available on hover as per standard key details behavior', async t => { keyName = chance.word({length: 20}); @@ -111,12 +111,14 @@ test('Verify that the multi-line cell value tooltip is available on hover as per test('Verify that user can see a confirmation message when request to delete an entry in the Stream', async t => { keyName = chance.word({length: 20}); field = 'fieldForRemoving'; - const confirmationMessage = 'This Entry will be removed from'; + const confirmationMessage = `will be removed from ${keyName}`; //Add new Stream key with 1 field await cliPage.sendCommandInCli(`XADD ${keyName} * ${field} ${value}`); //Open key details and click on delete entry await browserPage.openKeyDetails(keyName); + const entryId = await browserPage.streamEntryIdValue.textContent; await t.click(browserPage.removeEntryButton); //Check the confirmation message await t.expect(browserPage.confirmationMessagePopover.textContent).contains(confirmationMessage, `The confirmation message ${keyName}`); + await t.expect(browserPage.confirmationMessagePopover.textContent).contains(entryId, `The confirmation message for removing Entry`); }); diff --git a/tests/e2e/tests/regression/cli/cli-command-helper.e2e.ts b/tests/e2e/tests/regression/cli/cli-command-helper.e2e.ts index c1bea61a99..6a0d8210ad 100644 --- a/tests/e2e/tests/regression/cli/cli-command-helper.e2e.ts +++ b/tests/e2e/tests/regression/cli/cli-command-helper.e2e.ts @@ -217,7 +217,7 @@ test 'BF.MEXISTS key item [item ...]', 'CMS.QUERY key item [item ...]', 'TDIGEST.RESET key', - 'TOPK.LIST key numKeys withcount', + 'TOPK.LIST key withcount', 'CF.ADD key item' ]; externalPageLinks = [