Skip to content

Commit 485b1ed

Browse files
committed
e2e/feature/RI-4711_exact-match
1 parent a67144c commit 485b1ed

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

tests/e2e/pageObjects/browser-page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export class BrowserPage extends InstancePage {
107107
clearFilterHistoryBtn = Selector('[data-testid=clear-history-btn]');
108108
guideLinksBtn = Selector('[data-testid^=guide-button-]');
109109
backToBrowserBtn = Selector('[data-testid=back-right-panel-btn]');
110+
exactSearchBtn = Selector('[data-testid=exact-match-button]');
110111
//CONTAINERS
111112
streamGroupsContainer = Selector('[data-testid=stream-groups-container]');
112113
streamConsumersContainer = Selector('[data-testid=stream-consumers-container]');

tests/e2e/tests/regression/browser/filtering.e2e.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import { DatabaseAPIRequests } from '../../../helpers/api/api-database';
77
import { keyTypes } from '../../../helpers/keys';
88
import { Common } from '../../../helpers/common';
99
import { APIKeyRequests } from '../../../helpers/api/api-keys';
10+
import { BrowserActions } from '../../../common-actions/browser-actions';
1011

1112
const browserPage = new BrowserPage();
1213
const databaseHelper = new DatabaseHelper();
1314
const databaseAPIRequests = new DatabaseAPIRequests();
1415
const apiKeyRequests = new APIKeyRequests();
16+
const browserActions = new BrowserActions();
1517

1618
let keyName = Common.generateWord(20);
1719
let keyName2 = Common.generateWord(20);
@@ -58,8 +60,39 @@ test('Verify that user can filter per pattern with ? (matches keys with any char
5860
// Filter per pattern with ?
5961
await browserPage.searchByKeyName(searchedValue);
6062
// Verify that key was found
63+
// Verify that filter requests are sent as entered when Exact Search enabled
6164
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).ok('The key was not found');
6265
});
66+
test('Verify that filter requests are sent as entered when Exact Search enabled', async t => {
67+
const randomValue = Common.generateWord(10);
68+
const searchedValue = 'eyForSearch*?\\[]';
69+
const tooltipExactSearchEnabledText = 'Disable to see keys matching your pattern';
70+
const tooltipExactSearchDisabledText = 'Enable to see keys that exactly match your pattern';
71+
keyName = `KeyForSearch*?[]789${randomValue}`;
72+
73+
// Add new key
74+
await browserPage.addStringKey(keyName);
75+
// Filter by Exact Search
76+
await browserPage.searchByKeyName(searchedValue);
77+
// Verify that key was not found
78+
// Verify that Exact Search is enabled by default
79+
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).notOk('The key was found by Exact Search with not full name');
80+
81+
// Verify that user can see ”Exact Search Disable to see keys matching your pattern” text when hover over the icon with enabled Exact Search
82+
await t.hover(browserPage.exactSearchBtn);
83+
await browserActions.verifyTooltipContainsText(tooltipExactSearchEnabledText, true);
84+
85+
// Disable Exact Search
86+
await t.click(browserPage.exactSearchBtn);
87+
// Verify that user can see ”Exact Search Enable to see keys that exactly match your pattern” text when hover over the icon with disabled Exact Search
88+
await t.hover(browserPage.exactSearchBtn);
89+
await browserActions.verifyTooltipContainsText(tooltipExactSearchDisabledText, true);
90+
91+
await browserPage.searchByKeyName(searchedValue);
92+
// Verify that key was found
93+
// Verify that user can see results that fit into this pattern: *{request}* when Exact Search is disabled
94+
await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).ok('The key was not found with disabled Exact Search');
95+
});
6396
test
6497
.after(async() => {
6598
// Clear and delete database

0 commit comments

Comments
 (0)