Skip to content

Commit e5d3df6

Browse files
author
ALENA NABOKA
committed
add Scan More redis search test
1 parent 6309b1f commit e5d3df6

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/e2e/tests/critical-path/browser/search-capabilities.e2e.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,37 @@ test
233233
await common.reloadPage();
234234
await t.expect(browserPage.keyListTable.textContent).contains(notSelectedIndexText, 'Search by Values of Keys section not opened');
235235
});
236+
test
237+
.before(async() => {
238+
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneBigConfig, ossStandaloneBigConfig.databaseName);
239+
indexName = common.generateWord(10);
240+
const command = `FT.CREATE ${indexName} ON hash SCHEMA "" text`;
241+
await cliPage.sendCommandInCli(command);
242+
})
243+
.after(async() => {
244+
// Drop index
245+
await cliPage.sendCommandInCli(`FT.DROPINDEX ${indexName}`);
246+
// Delete database
247+
await deleteStandaloneDatabaseApi(ossStandaloneBigConfig);
248+
})('Scan more Redisearch', async t => {
249+
const commandToChangeMaxSearchResults = 'FT.CONFIG SET maxsearchresults 30000';
250+
251+
await cliPage.sendCommandInCli(commandToChangeMaxSearchResults);
252+
await t.click(browserPage.redisearchModeBtn);
253+
254+
// Verify that user can not see the “Scan more” button in Browser
255+
await t.expect(browserPage.scanMoreButton.exists).notOk('Scan More button is displayed in Browser');
256+
257+
// Verify that user can see the “Scan more” button in the Tree View if the number of scanned keys is less than maxsearchresults
258+
await t.click(browserPage.treeViewButton);
259+
await browserPage.selectIndexByName(indexName);
260+
for(let i = 0; i < 2; i++) {
261+
await t.expect(browserPage.scanMoreButton.exists).ok('Scan More button is not displayed');
262+
await t.click(browserPage.scanMoreButton);
263+
await t.expect(browserPage.scannedValue.textContent).eql(`${i + 2}0 000`);
264+
await t.expect(browserPage.keysNumberOfResults.textContent).eql(`${i + 2}0 000`);
265+
}
266+
267+
// Verify that user cannot see the “Scan more” button in the Tree view if there limited number is riched
268+
await t.expect(browserPage.scanMoreButton.exists).notOk('Scan More button is displayed');
269+
});

0 commit comments

Comments
 (0)