diff --git a/tests/e2e/helpers/database.ts b/tests/e2e/helpers/database.ts index 7df09b83ba..16f4b577e4 100644 --- a/tests/e2e/helpers/database.ts +++ b/tests/e2e/helpers/database.ts @@ -1,4 +1,4 @@ -import { t } from 'testcafe'; +import { Selector, t } from 'testcafe'; import { AddNewDatabaseParameters, SentinelParameters, OSSClusterParameters } from '../pageObjects/add-redis-database-page'; import { DiscoverMasterGroupsPage } from '../pageObjects/sentinel/discovered-sentinel-master-groups-page'; import { @@ -9,7 +9,7 @@ import { UserAgreementPage, CliPage } from '../pageObjects'; -import { addNewStandaloneDatabaseApi, discoverSentinelDatabaseApi } from './api/api-database'; +import { addNewStandaloneDatabaseApi, discoverSentinelDatabaseApi, getDatabaseByName } from './api/api-database'; import { Common } from './common'; const myRedisDatabasePage = new MyRedisDatabasePage(); @@ -96,19 +96,17 @@ export async function addOSSClusterDatabase(databaseParameters: OSSClusterParame export async function addNewRECloudDatabase(cloudAPIAccessKey: string, cloudAPISecretKey: string): Promise { // Fill the add database form and Submit await addRedisDatabasePage.addAutodiscoverRECloudDatabase(cloudAPIAccessKey, cloudAPISecretKey); - await t - .click(addRedisDatabasePage.addRedisDatabaseButton) + await t.click(addRedisDatabasePage.addRedisDatabaseButton); // Select subscriptions - .click(addRedisDatabasePage.selectAllCheckbox) - .click(addRedisDatabasePage.showDatabasesButton); + await t.click(addRedisDatabasePage.selectAllCheckbox); + await t.click(addRedisDatabasePage.showDatabasesButton); // Select databases for adding const databaseName = await browserPage.getDatabasesName(); - await t - .click(addRedisDatabasePage.selectAllCheckbox) - .click(autoDiscoverREDatabases.addSelectedDatabases) + await t.click(addRedisDatabasePage.selectAllCheckbox); + await t.click(autoDiscoverREDatabases.addSelectedDatabases); // Wait for database to be exist in the My redis databases list - .click(autoDiscoverREDatabases.viewDatabasesButton) - .expect(myRedisDatabasePage.dbNameList.withExactText(databaseName).exists).ok('The database not displayed', { timeout: 10000 }); + await t.click(autoDiscoverREDatabases.viewDatabasesButton); + await t.expect(myRedisDatabasePage.dbNameList.withExactText(databaseName).exists).ok('The database not displayed', { timeout: 10000 }); return databaseName; } @@ -194,6 +192,7 @@ export async function acceptLicenseTermsAndAddRECloudDatabase(databaseParameters while (!(await dbSelector.exists) && Date.now() - startTime < searchTimeout); await t.expect(myRedisDatabasePage.dbNameList.withExactText(databaseParameters.databaseName ?? '').exists).ok('The database not displayed', { timeout: 5000 }); await myRedisDatabasePage.clickOnDBByName(databaseParameters.databaseName ?? ''); + await common.waitForElementNotVisible(browserPage.progressLine); } // Accept License terms @@ -226,6 +225,17 @@ export async function clearDatabaseInCli(): Promise { * @param databaseName The database name */ export async function deleteDatabase(databaseName: string): Promise { + await t.click(myRedisDatabasePage.myRedisDBButton); + if (await addRedisDatabasePage.addDatabaseButton.exists) { + await deleteDatabaseByNameApi(databaseName); + } +} + +/** + * Delete database with custom name + * @param databaseName The database name +*/ +export async function deleteCustomDatabase(databaseName: string): Promise { await t.click(myRedisDatabasePage.myRedisDBButton); if (await addRedisDatabasePage.addDatabaseButton.exists) { await myRedisDatabasePage.deleteDatabaseByName(databaseName); @@ -245,3 +255,28 @@ export async function acceptTermsAddDatabaseOrConnectToRedisStack(databaseParame await acceptLicenseAndConnectToRedisStack(); } } + +/** + * Click on the edit database button by name + * @param databaseName The name of the database + */ +export async function clickOnEditDatabaseByName(databaseName: string): Promise { + const databaseId = await getDatabaseByName(databaseName); + const databaseEditBtn = Selector(`[data-testid=edit-instance-${databaseId}]`); + + await t.expect(databaseEditBtn.exists).ok(`"${databaseName}" database not displayed`); + await t.click(databaseEditBtn); +} + +/** + * Delete database button by name + * @param databaseName The name of the database + */ + export async function deleteDatabaseByNameApi(databaseName: string): Promise { + const databaseId = await getDatabaseByName(databaseName); + const databaseDeleteBtn = Selector(`[data-testid=delete-instance-${databaseId}-icon]`); + + await t.expect(databaseDeleteBtn.exists).ok(`"${databaseName}" database not displayed`); + await t.click(databaseDeleteBtn); + await t.click(myRedisDatabasePage.confirmDeleteButton); +} \ No newline at end of file diff --git a/tests/e2e/pageObjects/add-redis-database-page.ts b/tests/e2e/pageObjects/add-redis-database-page.ts index d7e3d77256..ff93abfd52 100644 --- a/tests/e2e/pageObjects/add-redis-database-page.ts +++ b/tests/e2e/pageObjects/add-redis-database-page.ts @@ -18,7 +18,7 @@ export class AddRedisDatabasePage { showDatabasesButton = Selector('[data-testid=btn-show-databases]'); databaseName = Selector('.euiTableCellContent.column_name'); selectAllCheckbox = Selector('[data-test-subj=checkboxSelectAll]'); - databaseIndexCheckbox = Selector('[data-testid=showDb]~div'); + databaseIndexCheckbox = Selector('[data-testid=showDb]~div', { timeout: 500 }); connectToDatabaseButton = Selector('[data-testid=connect-to-db-btn]'); connectToRedisStackButton = Selector('[aria-label="Connect to database"]'); discoverSentinelDatabaseButton = Selector('[data-testid=btn-submit]'); diff --git a/tests/e2e/pageObjects/browser-page.ts b/tests/e2e/pageObjects/browser-page.ts index d80b3e85a3..1df0b8e7f7 100644 --- a/tests/e2e/pageObjects/browser-page.ts +++ b/tests/e2e/pageObjects/browser-page.ts @@ -100,6 +100,7 @@ export class BrowserPage { virtualTableContainer = Selector('[data-testid=virtual-table-container]'); streamEntriesContainer = Selector('[data-testid=stream-entries-container]'); streamMessagesContainer = Selector('[data-testid=stream-messages-container]'); + loader = Selector('[data-testid=type-loading]'); //LINKS internalLinkToWorkbench = Selector('[data-testid=internal-workbench-link]'); userSurveyLink = Selector('[data-testid=user-survey-link]'); @@ -254,6 +255,7 @@ export class BrowserPage { */ async commonAddNewKey(keyName: string, TTL?: string): Promise { await common.waitForElementNotVisible(this.progressLine); + await common.waitForElementNotVisible(this.loader); await t .click(this.plusAddKeyButton) .click(this.addKeyNameInput) @@ -316,6 +318,7 @@ export class BrowserPage { */ async addSetKey(keyName: string, TTL = ' ', members = ' '): Promise { await common.waitForElementNotVisible(this.progressLine); + await common.waitForElementNotVisible(this.loader); await t.click(this.plusAddKeyButton); await t.click(this.keyTypeDropDown); await t.click(this.setOption); @@ -336,6 +339,7 @@ export class BrowserPage { */ async addZSetKey(keyName: string, scores = ' ', TTL = ' ', members = ' '): Promise { await common.waitForElementNotVisible(this.progressLine); + await common.waitForElementNotVisible(this.loader); await t.click(this.plusAddKeyButton); await t.click(this.keyTypeDropDown); await t.click(this.zsetOption); @@ -356,13 +360,14 @@ export class BrowserPage { */ async addListKey(keyName: string, TTL = ' ', element = ' '): Promise { await common.waitForElementNotVisible(this.progressLine); + await common.waitForElementNotVisible(this.loader); await t.click(this.plusAddKeyButton); await t.click(this.keyTypeDropDown); await t.click(this.listOption); await t.click(this.addKeyNameInput); await t.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true }); await t.click(this.keyTTLInput); - await t.typeText(this.keyTTLInput, TTL); + await t.typeText(this.keyTTLInput, TTL, { replace: true, paste: true }); await t.click(this.listKeyElementInput); await t.typeText(this.listKeyElementInput, element, { replace: true, paste: true }); await t.click(this.addKeyButton); @@ -377,6 +382,7 @@ export class BrowserPage { */ async addHashKey(keyName: string, TTL = ' ', field = ' ', value = ' '): Promise { await common.waitForElementNotVisible(this.progressLine); + await common.waitForElementNotVisible(this.loader); await t.click(this.plusAddKeyButton); await t.click(this.keyTypeDropDown); await t.click(this.hashOption); @@ -490,12 +496,21 @@ export class BrowserPage { } } + /** + * Get selector by key name + * @param keyName The name of the key + */ + async getKeySelectorByName(keyName: string): Promise { + return Selector(`[data-testid="key-${keyName}"]`); + } + /** * Verifying if the Key is in the List of keys * @param keyName The name of the key */ async isKeyIsDisplayedInTheList(keyName: string): Promise { const keyNameInTheList = Selector(`[data-testid="key-${keyName}"]`); + await common.waitForElementNotVisible(this.loader); return keyNameInTheList.exists; } diff --git a/tests/e2e/pageObjects/cli-page.ts b/tests/e2e/pageObjects/cli-page.ts index b163b9ef6a..620b4072fe 100644 --- a/tests/e2e/pageObjects/cli-page.ts +++ b/tests/e2e/pageObjects/cli-page.ts @@ -91,7 +91,7 @@ export class CliPage { await t.click(this.cliExpandButton); //Add keys const keyValueArray = await common.createArrayWithKeyValueAndDelimiter(amount); - await t.typeText(this.cliCommandInput, `${keyCommand} ${keyValueArray.join(' ')}`, { paste: true }); + await t.typeText(this.cliCommandInput, `${keyCommand} ${keyValueArray.join(' ')}`, { replace: true, paste: true }); await t.pressKey('enter'); await t.click(this.cliCollapseButton); } @@ -105,7 +105,7 @@ export class CliPage { await t.click(this.cliExpandButton); //Add keys const keyValueArray = await common.createArrayWithKeyAndDelimiter(amount); - await t.typeText(this.cliCommandInput, `DEL ${keyValueArray.join(' ')}`, { paste: true }); + await t.typeText(this.cliCommandInput, `DEL ${keyValueArray.join(' ')}`, { replace: true, paste: true }); await t.pressKey('enter'); await t.click(this.cliCollapseButton); } diff --git a/tests/e2e/pageObjects/my-redis-databases-page.ts b/tests/e2e/pageObjects/my-redis-databases-page.ts index 7250d64feb..e749a9d795 100644 --- a/tests/e2e/pageObjects/my-redis-databases-page.ts +++ b/tests/e2e/pageObjects/my-redis-databases-page.ts @@ -65,9 +65,8 @@ export class MyRedisDatabasePage { await t.click(this.toastCloseButton); } const db = this.dbNameList.withExactText(dbName.trim()); - await t - .expect(db.exists).ok(`"${dbName}" database doesn't exist`, {timeout: 10000}) - .click(db); + await t.expect(db.exists).ok(`"${dbName}" database doesn't exist`, {timeout: 10000}); + await t.click(db); } //Delete all the databases from the list @@ -115,8 +114,8 @@ export class MyRedisDatabasePage { */ async clickOnEditDBByName(databaseName: string): Promise { const dbNames = this.dbNameList; - const count = await dbNames.count; - for (let i = 0; i < count; i++) { + const count = dbNames.count; + for (let i = 0; i < await count; i++) { if ((await dbNames.nth(i).innerText || '').includes(databaseName)) { await t.click(this.editDatabaseButton.nth(i)); break; diff --git a/tests/e2e/tests/critical-path/browser/consumer-group.e2e.ts b/tests/e2e/tests/critical-path/browser/consumer-group.e2e.ts index b27b15778e..9a8a7bd78a 100644 --- a/tests/e2e/tests/critical-path/browser/consumer-group.e2e.ts +++ b/tests/e2e/tests/critical-path/browser/consumer-group.e2e.ts @@ -172,7 +172,7 @@ test('Verify that user can delete a Consumer Group', async t => { for (const id of entryIds) { const idBefore = await browserPage.streamGroupId.textContent; await t.click(browserPage.editStreamLastIdButton); - await t.typeText(browserPage.lastIdInput, id, { replace: true }); + await t.typeText(browserPage.lastIdInput, id, { replace: true, paste: true }); await t.click(browserPage.saveButton); await t.expect(browserPage.streamGroupId.textContent).notEql(idBefore, 'The last delivered ID is modified and the table is not reloaded'); } diff --git a/tests/e2e/tests/critical-path/browser/context.e2e.ts b/tests/e2e/tests/critical-path/browser/context.e2e.ts index 89474d3d4b..f162d3daf0 100644 --- a/tests/e2e/tests/critical-path/browser/context.e2e.ts +++ b/tests/e2e/tests/critical-path/browser/context.e2e.ts @@ -81,14 +81,14 @@ test('Verify that user can see saved executed commands in CLI on Browser page wh // Execute command in CLI and open Settings page await t.click(cliPage.cliExpandButton); for(const command of commands) { - await t.typeText(cliPage.cliCommandInput, command); + await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true }); await t.pressKey('enter'); } await t.click(myRedisDatabasePage.settingsButton); // Return back to Browser and check executed command in CLI await t.click(myRedisDatabasePage.browserButton); for(const command of commands) { - await t.expect(await cliPage.cliCommandExecuted.withExactText(command).exists).ok(`Executed command '${command}' in CLI is saved`); + await t.expect(cliPage.cliCommandExecuted.withExactText(command).exists).ok(`Executed command '${command}' in CLI is saved`); } }); test @@ -104,7 +104,7 @@ test await t.click(myRedisDatabasePage.settingsButton); // Return back to Browser and check key details selected await t.click(myRedisDatabasePage.browserButton); - await t.expect(await browserPage.keyNameFormDetails.withExactText(keyName).exists).ok('The key details is selected'); + await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).exists).ok('The key details is selected'); }); test .after(async() => { @@ -118,7 +118,7 @@ test await t.click(cliPage.cliExpandButton); // Create new keys keys = await common.createArrayWithKeyValue(numberOfItems); - await t.typeText(cliPage.cliCommandInput, `MSET ${keys.join(' ')}`, {paste: true}); + await t.typeText(cliPage.cliCommandInput, `MSET ${keys.join(' ')}`, { replace: true, paste: true }); await t.pressKey('enter'); await t.click(cliPage.cliCollapseButton); await t.click(browserPage.refreshKeysButton); diff --git a/tests/e2e/tests/critical-path/browser/filtering.e2e.ts b/tests/e2e/tests/critical-path/browser/filtering.e2e.ts index cbb864c59d..9348832340 100644 --- a/tests/e2e/tests/critical-path/browser/filtering.e2e.ts +++ b/tests/e2e/tests/critical-path/browser/filtering.e2e.ts @@ -46,12 +46,12 @@ test // Clear filter await t.click(browserPage.clearFilterButton); // Check the filtering starts by press Enter - await t.typeText(browserPage.filterByPatterSearchInput, 'InvalidText'); + await t.typeText(browserPage.filterByPatterSearchInput, 'InvalidText', { replace: true, paste: true }); await t.pressKey('enter'); await t.expect(browserPage.searchAdvices.exists).ok('The filtering is set'); // Check the filtering starts by clicks the control await common.reloadPage(); - await t.typeText(browserPage.filterByPatterSearchInput, 'InvalidText'); + await t.typeText(browserPage.filterByPatterSearchInput, 'InvalidText', { replace: true, paste: true }); await t.click(browserPage.searchButton); await t.expect(browserPage.searchAdvices.exists).ok('The filtering is set'); }); 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 d40c05e524..2935fb683c 100644 --- a/tests/e2e/tests/critical-path/browser/stream-key.e2e.ts +++ b/tests/e2e/tests/critical-path/browser/stream-key.e2e.ts @@ -53,11 +53,11 @@ test('Verify that user can add several fields and values during Stream key creat // Verify that user can see Entity ID filled by * by default on add Stream key form await t.expect(browserPage.streamEntryId.withAttribute('value', '*').exists).ok('Preselected Stream Entity ID field not correct'); // Verify that user can specify valid custom value for Entry ID - await t.typeText(browserPage.streamEntryId, '0-1', {replace: true}); + await t.typeText(browserPage.streamEntryId, '0-1', { replace: true, paste: true}); // Filled fields and value by different data types for (let i = 0; i < Object.keys(streamData).length; i++) { - await t.typeText(browserPage.streamField.nth(-1), Object.keys(streamData)[i]); - await t.typeText(browserPage.streamValue.nth(-1), Object.values(streamData)[i]); + await t.typeText(browserPage.streamField.nth(-1), Object.keys(streamData)[i], { replace: true, paste: true}); + await t.typeText(browserPage.streamValue.nth(-1), Object.values(streamData)[i], { replace: true, paste: true}); await t.scroll(scrollSelector, 'bottom'); await t.expect(browserPage.streamField.count).eql(i + 1, 'Number of added fields not correct'); if (i < Object.keys(streamData).length - 1) { diff --git a/tests/e2e/tests/critical-path/browser/stream-pending-messages.e2e.ts b/tests/e2e/tests/critical-path/browser/stream-pending-messages.e2e.ts index 2fe6f76ba5..f06653cd2f 100644 --- a/tests/e2e/tests/critical-path/browser/stream-pending-messages.e2e.ts +++ b/tests/e2e/tests/critical-path/browser/stream-pending-messages.e2e.ts @@ -97,7 +97,7 @@ test('Verify that claim with optional parameters, the message removed from this await t.click(browserPage.claimPendingMessageButton); await t.expect(browserPage.optionalParametersSwitcher.withAttribute('aria-checked', 'false').exists).ok('By default toggle for optional parameters is off'); await t.click(browserPage.optionalParametersSwitcher); - await t.typeText(browserPage.claimIdleTimeInput, '100', { replace: true }); + await t.typeText(browserPage.claimIdleTimeInput, '100', { replace: true, paste: true}); await t.click(browserPage.forceClaimCheckbox); await t.click(browserPage.submitButton); await t.expect(browserPage.streamMessagesContainer.textContent).contains('Your Consumer has no pending messages.', 'The messages is claimed and removed from the table'); diff --git a/tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts b/tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts index e4dcd7e5e1..8a7ecc0918 100644 --- a/tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts +++ b/tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts @@ -30,7 +30,7 @@ test('Verify Command Helper search and filter', async t => { // Verify default text await t.expect(cliPage.cliHelperText.textContent).eql(defaultHelperText, 'Default text for CLI Helper is not shown'); // Search any command - await t.typeText(cliPage.cliHelperSearch, 'SET'); + await t.typeText(cliPage.cliHelperSearch, 'SET', { replace: true, paste: true }); await t.expect(cliPage.cliHelperOutputTitles.count).gt(0, 'List of commands were not found'); // Clear search input const clearButton = cliPage.cliHelper.find('[aria-label="Clear input"]'); @@ -66,7 +66,7 @@ test('Verify Command Helper search and filter', async t => { // Verify that Command helper cleared when user runs the command in CLI await t.click(cliPage.cliExpandButton); // Enter command into CLI - await t.typeText(cliPage.cliCommandInput, COMMAND_APPEND, { speed: 0.5 }); + await t.typeText(cliPage.cliCommandInput, COMMAND_APPEND, { speed: 0.5, replace: true, paste: true }); await t.expect(cliPage.filterGroupTypeButton.textContent).notContains(COMMAND_GROUP_SET, 'Filter was not cleared'); await t.expect(cliPage.cliHelperSearch.value).eql('', 'Search was not cleared'); diff --git a/tests/e2e/tests/critical-path/cli/cli-critical.e2e.ts b/tests/e2e/tests/critical-path/cli/cli-critical.e2e.ts index 0b994256d4..fa5651197f 100644 --- a/tests/e2e/tests/critical-path/cli/cli-critical.e2e.ts +++ b/tests/e2e/tests/critical-path/cli/cli-critical.e2e.ts @@ -48,7 +48,7 @@ test await t.click(cliPage.cliExpandButton); // Add key from CLI for ([keyName, value] of pairsToSet) { - await t.typeText(cliPage.cliCommandInput, `SET ${keyName} ${value}`); + await t.typeText(cliPage.cliCommandInput, `SET ${keyName} ${value}`, { replace: true, paste: true}); await t.pressKey('enter'); } // Check that user is redirected @@ -59,13 +59,13 @@ test //Open CLI await t.click(cliPage.cliExpandButton); - await t.typeText(cliPage.cliCommandInput, 'SET key'); + await t.typeText(cliPage.cliCommandInput, 'SET key', { replace: true, paste: true}); await t.pressKey('enter'); // Check error const errWrongArgs = cliPage.cliOutputResponseFail.withText('ERR wrong number of arguments for \'set\' command'); await t.expect(errWrongArgs.exists).ok('Error with wrong number of arguments was not shown'); - await t.typeText(cliPage.cliCommandInput, 'lorem'); + await t.typeText(cliPage.cliCommandInput, 'lorem', { replace: true, paste: true}); await t.pressKey('enter'); // Check error const errWrongCmnd = cliPage.cliOutputResponseFail.withText('ERR unknown command'); @@ -77,7 +77,7 @@ test const commandStartsWith = 'I'; // Open CLI await t.click(cliPage.cliExpandButton); - await t.typeText(cliPage.cliCommandInput, commandStartsWith); + await t.typeText(cliPage.cliCommandInput, commandStartsWith, { replace: true, paste: true}); // Press tab while we won't find 'INFO' command // Avoid endless cycle let operationsCount = 0; @@ -108,13 +108,13 @@ test // Open CLI await t.click(cliPage.cliExpandButton); - await t.typeText(cliPage.cliCommandInput, command, { replace: true }); + await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true}); // Verify that user can type AI command in CLI and see agruments in hints from RedisAI commands.json await t.expect(cliPage.cliCommandAutocomplete.textContent).eql(commandHint, `The hints with arguments for command ${command} not shown`); // Enter commands and check hints with arguments for(const command of commands) { - await t.typeText(cliPage.cliCommandInput, command, { replace: true }); + await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true}); await t.expect(cliPage.cliCommandAutocomplete.textContent).eql(commandHints[commands.indexOf(command)], `The hints with arguments for command ${command} not shown`); } }); diff --git a/tests/e2e/tests/critical-path/database/clone-databases.e2e.ts b/tests/e2e/tests/critical-path/database/clone-databases.e2e.ts index 152b0e02dc..290c4712ca 100644 --- a/tests/e2e/tests/critical-path/database/clone-databases.e2e.ts +++ b/tests/e2e/tests/critical-path/database/clone-databases.e2e.ts @@ -1,7 +1,7 @@ import { rte } from '../../../helpers/constants'; import { AddRedisDatabasePage, MyRedisDatabasePage } from '../../../pageObjects'; import { commonUrl, ossClusterConfig, ossSentinelConfig, ossStandaloneConfig } from '../../../helpers/conf'; -import { acceptLicenseTerms } from '../../../helpers/database'; +import { acceptLicenseTerms, clickOnEditDatabaseByName } from '../../../helpers/database'; import { addNewOSSClusterDatabaseApi, addNewStandaloneDatabaseApi, @@ -34,12 +34,12 @@ test } }) .meta({ rte: rte.standalone })('Verify that user can clone Standalone db', async t => { - await myRedisDatabasePage.clickOnEditDBByName(ossStandaloneConfig.databaseName); + await clickOnEditDatabaseByName(ossStandaloneConfig.databaseName); // Verify that user can cancel the Clone by clicking the “Cancel” or the “x” button await t.click(addRedisDatabasePage.cloneDatabaseButton); await t.click(addRedisDatabasePage.cancelButton); await t.expect(myRedisDatabasePage.editAliasButton.withText('Clone ').exists).notOk('Clone panel is still displayed', { timeout: 2000 }); - await myRedisDatabasePage.clickOnEditDBByName(ossStandaloneConfig.databaseName); + await clickOnEditDatabaseByName(ossStandaloneConfig.databaseName); await t.click(addRedisDatabasePage.cloneDatabaseButton); // Verify that user see the “Add Database Manually” form pre-populated with all the connection data when cloning DB await t @@ -64,7 +64,7 @@ test await myRedisDatabasePage.deleteDatabaseByName(newOssDatabaseAlias); }) .meta({ rte: rte.ossCluster })('Verify that user can clone OSS Cluster', async t => { - await myRedisDatabasePage.clickOnEditDBByName(ossClusterConfig.ossClusterDatabaseName); + await clickOnEditDatabaseByName(ossClusterConfig.ossClusterDatabaseName); await t.click(addRedisDatabasePage.cloneDatabaseButton); await t .expect(myRedisDatabasePage.editAliasButton.withText('Clone ').exists).ok('Clone panel is not displayed') @@ -92,7 +92,7 @@ test await common.reloadPage(); }) .meta({ rte: rte.sentinel })('Verify that user can clone Sentinel', async t => { - await myRedisDatabasePage.clickOnEditDBByName(ossSentinelConfig.name[1]); + await clickOnEditDatabaseByName(ossSentinelConfig.name[1]); await t.click(addRedisDatabasePage.cloneDatabaseButton); // Verify that for Sentinel Host and Port fields are replaced with editable Primary Group Name field await t diff --git a/tests/e2e/tests/critical-path/memory-efficiency/memory-efficiency.e2e.ts b/tests/e2e/tests/critical-path/memory-efficiency/memory-efficiency.e2e.ts index 0ac32f5a67..7d17cf69f7 100644 --- a/tests/e2e/tests/critical-path/memory-efficiency/memory-efficiency.e2e.ts +++ b/tests/e2e/tests/critical-path/memory-efficiency/memory-efficiency.e2e.ts @@ -38,7 +38,7 @@ fixture `Memory Efficiency` test('No reports/keys message and report tooltip', async t => { const noReportsMessage = 'No Reports foundRun "New Analysis" to generate first report.'; const noKeysMessage = 'No keys to displayUse Workbench Guides and Tutorials to quickly load the data.'; - const tooltipText = 'Memory EfficiencyAnalyze up to 10K keys in your Redis database to get an overview of your data and memory efficiency recommendations.'; + const tooltipText = 'Analyze up to 10 000 keys per Redis database to get an overview of your data.'; // Verify that user can see the “No reports found” message when report wasn't generated await t.expect(memoryEfficiencyPage.noReportsText.textContent).eql(noReportsMessage, 'No reports message not displayed or text is invalid'); @@ -52,7 +52,7 @@ test('No reports/keys message and report tooltip', async t => { await t.click(myRedisDatabasePage.analysisPageButton); // Verify that user can see a tooltip when hovering over the icon on the right of the “New analysis” button await t.hover(memoryEfficiencyPage.reportTooltipIcon); - await t.expect(browserPage.tooltip.textContent).eql(tooltipText, 'Report tooltip is not displayed or text is invalid'); + await t.expect(browserPage.tooltip.textContent).contains(tooltipText, 'Report tooltip is not displayed or text is invalid'); }); test .before(async t => { @@ -92,9 +92,9 @@ test // Verify that user can quickly set the filters per keyspaces in the Browser/Tree View from the list of keyspaces await t.click(memoryEfficiencyPage.expandedItem); // Verify filter by data type applied - await t.expect(await browserPage.filteringLabel.textContent).eql('Stream', 'Key type lable is not displayed in search input'); + await t.expect(browserPage.filteringLabel.textContent).eql('Stream', 'Key type lable is not displayed in search input'); // Verify keyname in search input prepopulated - await t.expect(await browserPage.filterByPatterSearchInput.withAttribute('value', keySpaces[0]).exists).ok('Filter per key name is not applied'); + await t.expect(browserPage.filterByPatterSearchInput.withAttribute('value', keySpaces[0]).exists).ok('Filter per key name is not applied'); // Verify key is displayed await t.click(browserPage.browserViewButton); await t.expect(await browserPage.isKeyIsDisplayedInTheList(streamKeyName)).ok('Key is not found'); diff --git a/tests/e2e/tests/critical-path/workbench/autocomplete.e2e.ts b/tests/e2e/tests/critical-path/workbench/autocomplete.e2e.ts index e71b87bb9c..f3748020da 100644 --- a/tests/e2e/tests/critical-path/workbench/autocomplete.e2e.ts +++ b/tests/e2e/tests/critical-path/workbench/autocomplete.e2e.ts @@ -28,7 +28,7 @@ test('Verify that when user have selected a command (via “Enter” from the li // Start type characters and select command await t.typeText(workbenchPage.queryInput, 'LI', { replace: true }); // Verify that the list with auto-suggestions is displayed - await t.expect(await workbenchPage.monacoSuggestion.exists).ok('Auto-suggestions are displayed'); + await t.expect(workbenchPage.monacoSuggestion.exists).ok('Auto-suggestions are displayed'); // Select command and check result await t.pressKey('enter'); const script = await workbenchPage.queryInputScriptArea.textContent; diff --git a/tests/e2e/tests/critical-path/workbench/scripting-area.e2e.ts b/tests/e2e/tests/critical-path/workbench/scripting-area.e2e.ts index 849390b8bb..04e35881e1 100644 --- a/tests/e2e/tests/critical-path/workbench/scripting-area.e2e.ts +++ b/tests/e2e/tests/critical-path/workbench/scripting-area.e2e.ts @@ -36,8 +36,8 @@ test('Verify that user can resize scripting area in Workbench', async t => { await workbenchPage.sendCommandInWorkbench(commandForSend); // Verify that user can run any script from CLI in Workbench and see the results - await t.expect(await workbenchPage.queryCardContainer.exists).ok('Query card was added'); - const sentCommandText = await workbenchPage.queryCardCommand.withExactText(commandForSend); + await t.expect(workbenchPage.queryCardContainer.exists).ok('Query card was added'); + const sentCommandText = workbenchPage.queryCardCommand.withExactText(commandForSend); await t.expect(sentCommandText.exists).ok('Result of sent command exists'); await t.hover(workbenchPage.resizeButtonForScriptingAndResults); diff --git a/tests/e2e/tests/regression/browser/add-keys.e2e.ts b/tests/e2e/tests/regression/browser/add-keys.e2e.ts index 4006994a17..991628a3ed 100644 --- a/tests/e2e/tests/regression/browser/add-keys.e2e.ts +++ b/tests/e2e/tests/regression/browser/add-keys.e2e.ts @@ -27,11 +27,12 @@ fixture `Different JSON types creation` }); test('Verify that user can create different types(string, number, null, array, boolean) of JSON', async t => { for (let i = 0; i < jsonKeys.length; i++) { + const keySelector = await browserPage.getKeySelectorByName(jsonKeys[i][0]); await browserPage.addJsonKey(jsonKeys[i][0], jsonKeys[i][1]); await t.hover(browserPage.toastCloseButton); await t.click(browserPage.toastCloseButton); await t.click(browserPage.refreshKeysButton); - await t.expect(await browserPage.isKeyIsDisplayedInTheList(jsonKeys[i][0])).ok(`${jsonKeys[i][0]} key not displayed`); + await t.expect(keySelector.exists).ok(`${jsonKeys[i][0]} key not displayed`); // Add additional check for array elements if (jsonKeys[i][0].includes('array')) { for (const j of JSON.parse(jsonKeys[i][1])) { diff --git a/tests/e2e/tests/regression/browser/consumer-group.e2e.ts b/tests/e2e/tests/regression/browser/consumer-group.e2e.ts index 1e05ef7027..430b14a8c6 100644 --- a/tests/e2e/tests/regression/browser/consumer-group.e2e.ts +++ b/tests/e2e/tests/regression/browser/consumer-group.e2e.ts @@ -145,7 +145,7 @@ test('Verify that user can see error message if enter invalid last delivered ID' for(const id of invalidEntryIds){ const idBefore = await browserPage.streamGroupId.textContent; await t.click(browserPage.editStreamLastIdButton); - await t.typeText(browserPage.lastIdInput, id, { replace: true }); + await t.typeText(browserPage.lastIdInput, id, { replace: true, paste: true }); await t.click(browserPage.saveButton); await t.expect(browserPage.streamGroupId.textContent).eql(idBefore, 'The last delivered ID is not modified'); await t.expect(browserPage.entryIdError.textContent).eql(errorMessage, 'The error message not displayed'); diff --git a/tests/e2e/tests/regression/browser/context.e2e.ts b/tests/e2e/tests/regression/browser/context.e2e.ts index db836e3da9..537022163a 100644 --- a/tests/e2e/tests/regression/browser/context.e2e.ts +++ b/tests/e2e/tests/regression/browser/context.e2e.ts @@ -34,17 +34,17 @@ test('Verify that if user has saved context on Browser page and go to Settings p await browserPage.addStringKey(keyName); await browserPage.openKeyDetails(keyName); await t.click(cliPage.cliExpandButton); - await t.typeText(cliPage.cliCommandInput, command); + await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true }); await t.pressKey('enter'); await t.click(myRedisDatabasePage.settingsButton); // Verify that Browser and Workbench icons are displayed - await t.expect(await myRedisDatabasePage.browserButton.visible).ok('Browser icon is not displayed'); - await t.expect(await myRedisDatabasePage.workbenchButton.visible).ok('Workbench icon is not displayed'); + await t.expect(myRedisDatabasePage.browserButton.visible).ok('Browser icon is not displayed'); + await t.expect(myRedisDatabasePage.workbenchButton.visible).ok('Workbench icon is not displayed'); // Open Browser page and verify context await t.click(myRedisDatabasePage.browserButton); - await t.expect(await browserPage.filterByPatterSearchInput.withAttribute('value', keyName).exists).ok('Filter per key name is not applied'); - await t.expect(await browserPage.keyNameFormDetails.withExactText(keyName).exists).ok('The key details is not selected'); - await t.expect(await cliPage.cliCommandExecuted.withExactText(command).exists).ok(`Executed command '${command}' in CLI is not saved`); + await t.expect(browserPage.filterByPatterSearchInput.withAttribute('value', keyName).exists).ok('Filter per key name is not applied'); + await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).exists).ok('The key details is not selected'); + await t.expect(cliPage.cliCommandExecuted.withExactText(command).exists).ok(`Executed command '${command}' in CLI is not saved`); await t.click(cliPage.cliCollapseButton); }); test('Verify that when user reload the window with saved context(on any page), context is not saved when he returns back to Browser page', async t => { @@ -55,13 +55,13 @@ test('Verify that when user reload the window with saved context(on any page), c await t.click(myRedisDatabasePage.workbenchButton); // Open Browser page and verify context await t.click(myRedisDatabasePage.browserButton); - await t.expect(await browserPage.filterByPatterSearchInput.withAttribute('value', keyName).exists).ok('Filter per key name is not applied'); - await t.expect(await browserPage.keyNameFormDetails.withExactText(keyName).exists).ok('The key details is not selected'); + await t.expect(browserPage.filterByPatterSearchInput.withAttribute('value', keyName).exists).ok('Filter per key name is not applied'); + await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).exists).ok('The key details is not selected'); // Navigate to Workbench and reload the window await t.click(myRedisDatabasePage.workbenchButton); await common.reloadPage(); // Return back to Browser and check context is not saved await t.click(myRedisDatabasePage.browserButton); - await t.expect(await browserPage.filterByPatterSearchInput.withAttribute('value', keyName).exists).notOk('Filter per key name is applied'); - await t.expect(await browserPage.keyNameFormDetails.withExactText(keyName).exists).notOk('The key details is selected'); + await t.expect(browserPage.filterByPatterSearchInput.withAttribute('value', keyName).exists).notOk('Filter per key name is applied'); + await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).exists).notOk('The key details is selected'); }); diff --git a/tests/e2e/tests/regression/browser/database-overview-keys.e2e.ts b/tests/e2e/tests/regression/browser/database-overview-keys.e2e.ts index e6f4cf0d44..e21add28f8 100644 --- a/tests/e2e/tests/regression/browser/database-overview-keys.e2e.ts +++ b/tests/e2e/tests/regression/browser/database-overview-keys.e2e.ts @@ -1,5 +1,5 @@ import { t } from 'testcafe'; -import { acceptLicenseTermsAndAddDatabase, acceptLicenseTermsAndAddRECloudDatabase, deleteDatabase } from '../../../helpers/database'; +import { acceptLicenseTermsAndAddDatabase, acceptLicenseTermsAndAddRECloudDatabase, deleteCustomDatabase, deleteDatabase } from '../../../helpers/database'; import { MyRedisDatabasePage, CliPage, @@ -11,7 +11,6 @@ import { rte } from '../../../helpers/constants'; import { cloudDatabaseConfig, commonUrl, ossStandaloneRedisearch } from '../../../helpers/conf'; import { Common } from '../../../helpers/common'; import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database'; -import { deleteAllKeysFromDB } from '../../../helpers/keys'; const myRedisDatabasePage = new MyRedisDatabasePage(); const workbenchPage = new WorkbenchPage(); @@ -48,7 +47,7 @@ fixture `Database overview` await t.click(myRedisDatabasePage.myRedisDBButton); await myRedisDatabasePage.clickOnDBByName(`${ossStandaloneRedisearch.databaseName} [${index}]`); await cliPage.sendCommandInCli(`DEL ${keys.join(' ')}`); - await deleteDatabase(`${ossStandaloneRedisearch.databaseName} [${index}]`); + await deleteCustomDatabase(`${ossStandaloneRedisearch.databaseName} [${index}]`); await myRedisDatabasePage.clickOnDBByName(ossStandaloneRedisearch.databaseName); await browserPage.deleteKeyByName(keyName); await deleteStandaloneDatabaseApi(ossStandaloneRedisearch); diff --git a/tests/e2e/tests/regression/browser/filtering.e2e.ts b/tests/e2e/tests/regression/browser/filtering.e2e.ts index fa4e7658a7..ce320b5183 100644 --- a/tests/e2e/tests/regression/browser/filtering.e2e.ts +++ b/tests/e2e/tests/regression/browser/filtering.e2e.ts @@ -185,6 +185,6 @@ test ? Selector('[data-testid^=badge-ReJSON]') : Selector(`[data-testid^=badge-${keyTypes[i].keyName}]`); // Verify that all results have the same type as in filter - await t.expect(await browserPage.filteringLabel.count).eql(await filteredTypeKeys.count, `The keys of type ${keyTypes[i].textType} not filtered correctly`); + await t.expect(browserPage.filteringLabel.count).eql(await filteredTypeKeys.count, `The keys of type ${keyTypes[i].textType} not filtered correctly`); } }); diff --git a/tests/e2e/tests/regression/browser/stream-pending-messages.e2e.ts b/tests/e2e/tests/regression/browser/stream-pending-messages.e2e.ts index 007ccfb3b5..96e1aff4dd 100644 --- a/tests/e2e/tests/regression/browser/stream-pending-messages.e2e.ts +++ b/tests/e2e/tests/regression/browser/stream-pending-messages.e2e.ts @@ -75,7 +75,7 @@ test('Verify that the message is claimed only if its idle time is greater than t const streamMessageBefore = await browserPage.streamMessage.count; // Claim message and check result when Min Idle Time is greater than the idle time await t.click(browserPage.claimPendingMessageButton); - await t.typeText(browserPage.streamMinIdleTimeInput, '100000000'); + await t.typeText(browserPage.streamMinIdleTimeInput, '100000000', { replace: true, paste: true }); await t.click(browserPage.submitButton); await t.expect(browserPage.notificationMessage.textContent).contains('No messages claimed', 'The message is not claimed notification'); await t.expect(browserPage.streamMessage.count).eql(streamMessageBefore, 'The number of pendings in the table not correct'); diff --git a/tests/e2e/tests/regression/browser/ttl-format.e2e.ts b/tests/e2e/tests/regression/browser/ttl-format.e2e.ts index fde383b539..b63ca567f3 100644 --- a/tests/e2e/tests/regression/browser/ttl-format.e2e.ts +++ b/tests/e2e/tests/regression/browser/ttl-format.e2e.ts @@ -40,9 +40,9 @@ test('Verify that user can see TTL in the list of keys rounded down to the neare // Create new keys with TTL await t.click(cliPage.cliExpandButton); for (let i = 0; i < keysData.length; i++) { - await t.typeText(cliPage.cliCommandInput, COMMANDS_TO_CREATE_KEY[keysData[i].textType](keysData[i].keyName), {paste: true}) + await t.typeText(cliPage.cliCommandInput, COMMANDS_TO_CREATE_KEY[keysData[i].textType](keysData[i].keyName), { replace: true, paste: true }) .pressKey('enter') - .typeText(cliPage.cliCommandInput, `EXPIRE ${keysData[i].keyName} ${ttlForSet[i]}`, {paste: true}) + .typeText(cliPage.cliCommandInput, `EXPIRE ${keysData[i].keyName} ${ttlForSet[i]}`, { replace: true, paste: true }) .pressKey('enter'); } await t.click(cliPage.cliCollapseButton); diff --git a/tests/e2e/tests/regression/cli/cli-logical-db.e2e.ts b/tests/e2e/tests/regression/cli/cli-logical-db.e2e.ts index b9772349a0..1ca0fc5e20 100644 --- a/tests/e2e/tests/regression/cli/cli-logical-db.e2e.ts +++ b/tests/e2e/tests/regression/cli/cli-logical-db.e2e.ts @@ -1,4 +1,4 @@ -import { acceptLicenseTerms, deleteDatabase } from '../../../helpers/database'; +import { acceptLicenseTerms, deleteCustomDatabase } from '../../../helpers/database'; import { CliPage, AddRedisDatabasePage, MyRedisDatabasePage } from '../../../pageObjects'; import { commonUrl, @@ -28,7 +28,7 @@ fixture `CLI logical database` }) .afterEach(async() => { // Delete database - await deleteDatabase(`${ossStandaloneConfig.databaseName } [${index}]`); + await deleteCustomDatabase(`${ossStandaloneConfig.databaseName} [${index}]`); }); test .after(async() => { diff --git a/tests/e2e/tests/regression/cli/cli-re-cluster.e2e.ts b/tests/e2e/tests/regression/cli/cli-re-cluster.e2e.ts index f6d137ab50..45a64b1262 100644 --- a/tests/e2e/tests/regression/cli/cli-re-cluster.e2e.ts +++ b/tests/e2e/tests/regression/cli/cli-re-cluster.e2e.ts @@ -27,7 +27,7 @@ const verifyCommandsInCli = async(): Promise => { // Open CLI await t.click(cliPage.cliExpandButton); // Add key from CLI - await t.typeText(cliPage.cliCommandInput, `SADD ${keyName} "chinese" "japanese" "german"`); + await t.typeText(cliPage.cliCommandInput, `SADD ${keyName} "chinese" "japanese" "german"`, { replace: true, paste: true }); await t.pressKey('enter'); // Check that the key is added await browserPage.searchByKeyName(keyName); diff --git a/tests/e2e/tests/regression/cli/cli.e2e.ts b/tests/e2e/tests/regression/cli/cli.e2e.ts index d13736f5d1..991f789446 100644 --- a/tests/e2e/tests/regression/cli/cli.e2e.ts +++ b/tests/e2e/tests/regression/cli/cli.e2e.ts @@ -43,7 +43,7 @@ test('Verify that user can see results history when he re-opens CLI after minimi // Open CLI and run commands await t.click(cliPage.cliExpandButton); - await t.typeText(cliPage.cliCommandInput, command); + await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true }); await t.pressKey('enter'); // Minimize and re-open cli await t.click(cliPage.minimizeCliButton); @@ -63,7 +63,7 @@ test // Open CLI and run command with repeats await t.click(cliPage.cliExpandButton); - await t.typeText(cliPage.cliCommandInput, `${repeats} ${command}`); + await t.typeText(cliPage.cliCommandInput, `${repeats} ${command}`, { replace: true, paste: true }); await t.pressKey('enter'); // Verify result await t.expect(cliPage.cliOutputResponseSuccess.count).eql(repeats, `CLI not contains ${repeats} results`); @@ -82,7 +82,7 @@ test const command = `JSON.GET ${keyName}`; // Open CLI and run command await t.click(cliPage.cliExpandButton); - await t.typeText(cliPage.cliCommandInput, command, { paste: true }); + await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true }); await t.pressKey('enter'); // Verify result await t.expect(cliPage.cliOutputResponseSuccess.innerText).eql(jsonValueCli, 'The user can not see JSON object with escaped quotes'); diff --git a/tests/e2e/tests/regression/database/database-list-search.e2e.ts b/tests/e2e/tests/regression/database/database-list-search.e2e.ts index 9adc10aa19..74b216c1bd 100644 --- a/tests/e2e/tests/regression/database/database-list-search.e2e.ts +++ b/tests/e2e/tests/regression/database/database-list-search.e2e.ts @@ -58,47 +58,47 @@ test('Verify DB list search', async t => { const startTime = Date.now(); // Search for DB by Invalid search - await t.typeText(myRedisDatabasePage.searchInput, searchedDBHostInvalid, { replace: true }); + await t.typeText(myRedisDatabasePage.searchInput, searchedDBHostInvalid, { replace: true, paste: true }); // Verify that user sees "No results found" message when pattern doesn`t match any database await t.expect(myRedisDatabasePage.noResultsFoundMessage.exists).ok('"No results found message" not displayed'); await t.expect(myRedisDatabasePage.noResultsFoundText.exists).ok('"No databases matched your search" message not displayed'); // Search for DB by name - await t.typeText(myRedisDatabasePage.searchInput, searchedDBName, { replace: true }); + await t.typeText(myRedisDatabasePage.searchInput, searchedDBName, { replace: true, paste: true }); // Verify that user can search DB by database name on the List of databases await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[0].databaseName).exists).ok('The database with alias not found', { timeout: 10000 }); await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[1].databaseName).exists).ok('The database with alias not found', { timeout: 10000 }); await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[2].databaseName).exists).notOk('The database with other alias is found', { timeout: 10000 }); // Search for DB by host - await t.typeText(myRedisDatabasePage.searchInput, searchedDBHost, { replace: true }); + await t.typeText(myRedisDatabasePage.searchInput, searchedDBHost, { replace: true, paste: true }); // Verify that user can search DB by host on the List of databases await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[0].databaseName).exists).ok('The database with host not found', { timeout: 10000 }); await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[1].databaseName).exists).ok('The database with host not found', { timeout: 10000 }); await t.expect(myRedisDatabasePage.dbNameList.withExactText(ossSentinelConfig.name[0]).exists).notOk('The database with other host is found', { timeout: 10000 }); // Search for DB by port - await t.typeText(myRedisDatabasePage.searchInput, searchedDBPort, { replace: true }); + await t.typeText(myRedisDatabasePage.searchInput, searchedDBPort, { replace: true, paste: true }); // Verify that user can search DB by port on the List of databases await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[0].databaseName).exists).notOk('The database with port is found', { timeout: 10000 }); await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[1].databaseName).exists).notOk('The database with port is found', { timeout: 10000 }); await t.expect(myRedisDatabasePage.dbNameList.withExactText(ossSentinelConfig.name[0]).exists).ok('The database with other port is not found', { timeout: 10000 }); // Search for DB by connection type - await t.typeText(myRedisDatabasePage.searchInput, searchedDBConType, { replace: true }); + await t.typeText(myRedisDatabasePage.searchInput, searchedDBConType, { replace: true, paste: true }); // Verify that user can search DB by Connection Type on the List of databases await t.expect(myRedisDatabasePage.dbNameList.withExactText(ossClusterConfig.ossClusterDatabaseName).exists).ok('The database with connection type not found', { timeout: 10000 }); await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[0].databaseName).exists).notOk('The database with other connection type found', { timeout: 10000 }); await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[1].databaseName).exists).notOk('The database with other connection type found', { timeout: 10000 }); // Search for DB by Last Connection - await t.typeText(myRedisDatabasePage.searchInput, searchedDBFirst, { replace: true }); + await t.typeText(myRedisDatabasePage.searchInput, searchedDBFirst, { replace: true, paste: true }); // Verify that database added < 1min ago found on the list search by Last Connection await t.expect(myRedisDatabasePage.dbNameList.withExactText(databasesForSearch[1].databaseName).exists).ok('The database with Last Connection not found', { timeout: 10000 }); // Verify that database added > 1min ago found on the list search by Last Connection do { await common.reloadPage(); - await t.typeText(myRedisDatabasePage.searchInput, searchedDBSecond, { replace: true }); + await t.typeText(myRedisDatabasePage.searchInput, searchedDBSecond, { replace: true, paste: true }); } while (!(await dbSelector.exists) && Date.now() - startTime < searchTimeout); // Verify that user can search DB by Last Connection on the List of databases diff --git a/tests/e2e/tests/regression/database/database-sorting.e2e.ts b/tests/e2e/tests/regression/database/database-sorting.e2e.ts index b079dc3330..a8d1f5d061 100644 --- a/tests/e2e/tests/regression/database/database-sorting.e2e.ts +++ b/tests/e2e/tests/regression/database/database-sorting.e2e.ts @@ -1,4 +1,4 @@ -import { acceptLicenseTerms } from '../../../helpers/database'; +import { acceptLicenseTerms, clickOnEditDatabaseByName } from '../../../helpers/database'; import { discoverSentinelDatabaseApi, addNewOSSClusterDatabaseApi, @@ -77,28 +77,22 @@ test('Verify that sorting on the list of databases saved when database opened', actualDatabaseList = await myRedisDatabasePage.getAllDatabases(); await myRedisDatabasePage.compareDatabases(actualDatabaseList, sortedDatabaseHost); }); -test - .after(async() => { - // Clear and delete databases - await deleteAllDatabasesByConnectionTypeApi('STANDALONE'); - await deleteAllDatabasesByConnectionTypeApi('CLUSTER'); - await deleteAllDatabasesByConnectionTypeApi('SENTINEL'); - })('Verify that user has the same sorting if db name is changed', async t => { - // Sort by Database name - await t.click(myRedisDatabasePage.sortByDatabaseAlias); - actualDatabaseList = await myRedisDatabasePage.getAllDatabases(); - await myRedisDatabasePage.compareDatabases(actualDatabaseList, await sortList()); - // Change DB name inside of sorted list - await myRedisDatabasePage.clickOnEditDBByName(ossStandaloneConfig.databaseName); - await t.click(myRedisDatabasePage.editAliasButton); - await t.typeText(myRedisDatabasePage.aliasInput, newDBName, { replace: true }); - await t.pressKey('enter'); - // Change DB is control list - const index = databases.findIndex((item) => { - return item.databaseName === oldDBName; - }); - databases[index].databaseName = newDBName; - // Compare sorting with expected list - actualDatabaseList = await myRedisDatabasePage.getAllDatabases(); - await myRedisDatabasePage.compareDatabases(actualDatabaseList, await sortList()); +test('Verify that user has the same sorting if db name is changed', async t => { + // Sort by Database name + await t.click(myRedisDatabasePage.sortByDatabaseAlias); + actualDatabaseList = await myRedisDatabasePage.getAllDatabases(); + await myRedisDatabasePage.compareDatabases(actualDatabaseList, await sortList()); + // Change DB name inside of sorted list + await clickOnEditDatabaseByName(ossStandaloneConfig.databaseName); + await t.click(myRedisDatabasePage.editAliasButton); + await t.typeText(myRedisDatabasePage.aliasInput, newDBName, { replace: true, paste: true }); + await t.pressKey('enter'); + // Change DB is control list + const index = databases.findIndex((item) => { + return item.databaseName === oldDBName; }); + databases[index].databaseName = newDBName; + // Compare sorting with expected list + actualDatabaseList = await myRedisDatabasePage.getAllDatabases(); + await myRedisDatabasePage.compareDatabases(actualDatabaseList, await sortList()); +}); diff --git a/tests/e2e/tests/regression/database/edit-db.e2e.ts b/tests/e2e/tests/regression/database/edit-db.e2e.ts index 741787c4a6..b2311e692a 100644 --- a/tests/e2e/tests/regression/database/edit-db.e2e.ts +++ b/tests/e2e/tests/regression/database/edit-db.e2e.ts @@ -1,4 +1,4 @@ -import { acceptLicenseTermsAndAddDatabaseApi, deleteDatabase } from '../../../helpers/database'; +import { acceptLicenseTermsAndAddDatabaseApi, clickOnEditDatabaseByName, deleteDatabase } from '../../../helpers/database'; import { MyRedisDatabasePage } from '../../../pageObjects'; import { commonUrl, @@ -28,7 +28,7 @@ test })('Verify that user can edit DB alias of Standalone DB', async t => { await t.click(myRedisDatabasePage.myRedisDBButton); // Edit alias of added database - await myRedisDatabasePage.clickOnEditDBByName(database.databaseName); + await clickOnEditDatabaseByName(database.databaseName); await t.click(myRedisDatabasePage.editAliasButton); await t.typeText(myRedisDatabasePage.aliasInput, newDatabaseName, { replace: true }); await t.click(myRedisDatabasePage.applyButton); diff --git a/tests/e2e/tests/regression/database/redisstack.e2e.ts b/tests/e2e/tests/regression/database/redisstack.e2e.ts index fee79ef6b8..521a6f0406 100644 --- a/tests/e2e/tests/regression/database/redisstack.e2e.ts +++ b/tests/e2e/tests/regression/database/redisstack.e2e.ts @@ -43,7 +43,7 @@ test('Verify that user can see Redis Stack icon in Edit mode near the DB name', // Verify that user can see the Redis Stack logo is placed in the DB edit form when hover over the RedisStack logo await t.hover(myRedisDatabasePage.redisStackIcon); await t.expect(myRedisDatabasePage.tooltipRedisStackLogo.visible).ok('Redis Stack logo not found'); - const databaseName = await myRedisDatabasePage.redisStackIcon.parent().nextSibling(); + const databaseName = myRedisDatabasePage.redisStackIcon.parent().nextSibling(); await t.expect(databaseName.withAttribute('data-testid', 'edit-alias-btn').exists).ok('Edit button not found'); }); test('Verify that user can see Redis Stack icon and logo in Browser page in Overview.', async t => { diff --git a/tests/e2e/tests/regression/monitor/monitor.e2e.ts b/tests/e2e/tests/regression/monitor/monitor.e2e.ts index 61d5c91bf2..ee82af7b63 100644 --- a/tests/e2e/tests/regression/monitor/monitor.e2e.ts +++ b/tests/e2e/tests/regression/monitor/monitor.e2e.ts @@ -79,7 +79,7 @@ test('Verify Monitor refresh/stop', async t => { // Click on refresh keys to get new logs await t.click(browserPage.refreshKeysButton); // Get last timestamp - const lastTimestampSelector = await monitorPage.monitorCommandLineTimestamp.nth(-1); + const lastTimestampSelector = monitorPage.monitorCommandLineTimestamp.nth(-1); // Stop Monitor await monitorPage.stopMonitor(); // Click on Clear button diff --git a/tests/e2e/tests/regression/shortcuts/shortcuts.e2e.ts b/tests/e2e/tests/regression/shortcuts/shortcuts.e2e.ts index a2f533f441..6c2ff2f680 100644 --- a/tests/e2e/tests/regression/shortcuts/shortcuts.e2e.ts +++ b/tests/e2e/tests/regression/shortcuts/shortcuts.e2e.ts @@ -17,6 +17,8 @@ fixture `Shortcuts` }); test .meta({ env: env.web })('Verify that user can see a summary of Shortcuts by clicking "Keyboard Shortcuts" button in Help Center', async t => { + const link = 'https://github.com/RedisInsight/RedisInsight/releases'; + // Click on help center icon and verify panel await t.click(myRedisDatabasePage.helpCenterButton); await t.expect(helpCenterPage.helpCenterPanel.exists).ok('Help Center panel is not opened'); @@ -32,7 +34,6 @@ test await t.click(shortcutsPage.shortcutsCloseButton); await t.expect(shortcutsPage.shortcutsPanel.exists).notOk('Shortcuts panel is not displayed'); - const link = 'https://github.com/RedisInsight/RedisInsight/releases'; // Click on the Release Notes in Help Center await t.click(myRedisDatabasePage.helpCenterButton); await t.click(helpCenterPage.helpCenterReleaseNotesButton); diff --git a/tests/e2e/tests/regression/workbench/autocomplete.e2e.ts b/tests/e2e/tests/regression/workbench/autocomplete.e2e.ts index 3289b30782..ec8c53a0d3 100644 --- a/tests/e2e/tests/regression/workbench/autocomplete.e2e.ts +++ b/tests/e2e/tests/regression/workbench/autocomplete.e2e.ts @@ -33,13 +33,13 @@ test('Verify that user can open the "read more" about the command by clicking on await t.typeText(workbenchPage.queryInput, command, { replace: true }); // Open the read more by clicking on the "ctrl+space" and check await t.pressKey('ctrl+space'); - await t.expect(await workbenchPage.monacoCommandDetails.exists).ok('The "read more" about the command is not opened'); + await t.expect(workbenchPage.monacoCommandDetails.exists).ok('The "read more" about the command is not opened'); for(const detail of commandDetails) { - await t.expect(await workbenchPage.monacoCommandDetails.textContent).contains(detail, `The ${detail} command detail is not displayed`); + await t.expect(workbenchPage.monacoCommandDetails.textContent).contains(detail, `The ${detail} command detail is not displayed`); } // Close the command details await t.pressKey('ctrl+space'); - await t.expect(await workbenchPage.monacoCommandDetails.exists).notOk('The "read more" about the command is not closed'); + await t.expect(workbenchPage.monacoCommandDetails.exists).notOk('The "read more" about the command is not closed'); }); test('Verify that user can see static list of arguments is displayed when he enters the command in Editor in Workbench', async t => { const command = 'AI.SCRIPTEXECUTE'; @@ -66,7 +66,7 @@ test('Verify that user can see the static list of arguments when he uses “Ctrl const command = 'JSON.ARRAPPEND'; await t.typeText(workbenchPage.queryInput, command, { replace: true }); // Verify that the list with auto-suggestions is displayed - await t.expect(await workbenchPage.monacoSuggestion.exists).ok('Auto-suggestions are not displayed'); + await t.expect(workbenchPage.monacoSuggestion.exists).ok('Auto-suggestions are not displayed'); // Select the command from suggestion list await t.pressKey('enter'); // Check that the command is displayed in Editing area after selecting diff --git a/tests/e2e/tests/regression/workbench/autoexecute-button.e2e.ts b/tests/e2e/tests/regression/workbench/autoexecute-button.e2e.ts index 9e9778fe89..d369e610c0 100644 --- a/tests/e2e/tests/regression/workbench/autoexecute-button.e2e.ts +++ b/tests/e2e/tests/regression/workbench/autoexecute-button.e2e.ts @@ -22,7 +22,7 @@ fixture `Workbench Auto-Execute button` test.skip('Verify that when user clicks on auto-execute button, command is run', async t => { const command = 'INFO'; // Verify that clicking on auto-executed button, command is not inserted to Editor - await t.typeText(workbenchPage.queryInput, command); + await t.typeText(workbenchPage.queryInput, command, { replace: true, paste: true }); // Verify that admin can use redis-auto format in .md file for Guides for auto-executed button await t.click(workbenchPage.documentButtonInQuickGuides); await t.click(workbenchPage.internalLinkWorkingWithHashes); diff --git a/tests/e2e/tests/regression/workbench/command-results.e2e.ts b/tests/e2e/tests/regression/workbench/command-results.e2e.ts index 60532c1eea..08662a5a68 100644 --- a/tests/e2e/tests/regression/workbench/command-results.e2e.ts +++ b/tests/e2e/tests/regression/workbench/command-results.e2e.ts @@ -42,11 +42,11 @@ test // Send FT.INFO and switch to Text view await workbenchPage.sendCommandInWorkbench(infoCommand); await workbenchPage.selectViewTypeText(); - await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).exists).ok('The text view is not switched for command FT.INFO'); + await t.expect(workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).exists).ok('The text view is not switched for command FT.INFO'); // Switch to Table view and check result await workbenchPage.selectViewTypeTable(); await t.switchToIframe(workbenchPage.iframe); - await t.expect(await workbenchPage.queryTableResult.exists).ok('The table view is not switched for command FT.INFO'); + await t.expect(workbenchPage.queryTableResult.exists).ok('The table view is not switched for command FT.INFO'); }); test .meta({ env: env.web })('Verify that user can switches between Table and Text for FT.SEARCH and see results corresponding to their views', async t => { @@ -55,11 +55,11 @@ test // Send FT.SEARCH and switch to Text view await workbenchPage.sendCommandInWorkbench(searchCommand); await workbenchPage.selectViewTypeText(); - await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).visible).ok('The text view is not switched for command FT.SEARCH'); + await t.expect(workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).visible).ok('The text view is not switched for command FT.SEARCH'); // Switch to Table view and check result await workbenchPage.selectViewTypeTable(); await t.switchToIframe(workbenchPage.iframe); - await t.expect(await workbenchPage.queryTableResult.exists).ok('The table view is not switched for command FT.SEARCH'); + await t.expect(workbenchPage.queryTableResult.exists).ok('The table view is not switched for command FT.SEARCH'); }); test .meta({ env: env.web })('Verify that user can switches between Table and Text for FT.AGGREGATE and see results corresponding to their views', async t => { @@ -68,11 +68,11 @@ test // Send FT.AGGREGATE and switch to Text view await workbenchPage.sendCommandInWorkbench(aggregateCommand); await workbenchPage.selectViewTypeText(); - await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).visible).ok('The text view is not switched for command FT.AGGREGATE'); + await t.expect(workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).visible).ok('The text view is not switched for command FT.AGGREGATE'); // Switch to Table view and check result await workbenchPage.selectViewTypeTable(); await t.switchToIframe(workbenchPage.iframe); - await t.expect(await workbenchPage.queryTableResult.exists).ok('The table view is not switched for command FT.AGGREGATE'); + await t.expect(workbenchPage.queryTableResult.exists).ok('The table view is not switched for command FT.AGGREGATE'); }); // Skipped due to issue https://redislabs.atlassian.net/browse/RI-3524 test.skip @@ -83,10 +83,10 @@ test.skip await workbenchPage.sendCommandInWorkbench(command); await t.click(workbenchPage.fullScreenButton); await t.switchToIframe(workbenchPage.iframe); - await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTableResult).visible).ok('The search results are displayed in Table view by default'); + await t.expect(workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTableResult).visible).ok('The search results are displayed in Table view by default'); // Select Text view from dropdown await t.switchToMainWindow(); await workbenchPage.selectViewTypeText(); // Verify that search results are displayed in Text view - await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).visible).ok('The result is displayed in Text view'); + await t.expect(workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).visible).ok('The result is displayed in Text view'); }); diff --git a/tests/e2e/tests/regression/workbench/context.e2e.ts b/tests/e2e/tests/regression/workbench/context.e2e.ts index feba8a0f84..7a2b67fe59 100644 --- a/tests/e2e/tests/regression/workbench/context.e2e.ts +++ b/tests/e2e/tests/regression/workbench/context.e2e.ts @@ -30,7 +30,7 @@ test('Verify that user can see saved CLI state when navigates away to any other await t.click(myRedisDatabasePage.browserButton); // Return back to Workbench and check CLI await t.click(myRedisDatabasePage.workbenchButton); - await t.expect(await cliPage.cliCollapseButton.exists).ok('CLI is not expanded'); + await t.expect(cliPage.cliCollapseButton.exists).ok('CLI is not expanded'); }); // Update after resolving https://redislabs.atlassian.net/browse/RI-3299 test('Verify that user can see saved CLI size when navigates away to any other page', async t => { @@ -39,7 +39,7 @@ test('Verify that user can see saved CLI size when navigates away to any other p await t.click(cliPage.cliExpandButton); const cliAreaHeight = await cliPage.cliArea.clientHeight; const cliAreaHeightEnd = cliAreaHeight + 150; - const cliResizeButton = await cliPage.cliResizeButton; + const cliResizeButton = cliPage.cliResizeButton; await t.hover(cliResizeButton); // Resize CLI 50px up and navigate to the My Redis databases page await t.drag(cliResizeButton, 0, -offsetY, { speed: 0.01 }); @@ -56,12 +56,12 @@ test('Verify that user can see all the information removed when reloads the page await t.click(myRedisDatabasePage.browserButton); // Open Workbench page and verify context await t.click(myRedisDatabasePage.workbenchButton); - await t.expect(await cliPage.cliCollapseButton.exists).ok('CLI is not expanded'); - await t.expect(await workbenchPage.queryInputScriptArea.textContent).eql(command, 'Input in Editor is not saved'); + await t.expect(cliPage.cliCollapseButton.exists).ok('CLI is not expanded'); + await t.expect(workbenchPage.queryInputScriptArea.textContent).eql(command, 'Input in Editor is not saved'); // Reload the window and chek context await common.reloadPage(); - await t.expect(await cliPage.cliCollapseButton.exists).notOk('CLI is not collapsed'); - await t.expect(await workbenchPage.queryInputScriptArea.textContent).eql('', 'Input in Editor is not removed'); + await t.expect(cliPage.cliCollapseButton.exists).notOk('CLI is not collapsed'); + await t.expect(workbenchPage.queryInputScriptArea.textContent).eql('', 'Input in Editor is not removed'); }); test('Verify that user can see saved state of the Enablement area when navigates back to the Workbench from other page', async t => { // Collapse the Enablement area and open Settings diff --git a/tests/e2e/tests/regression/workbench/redis-stack-commands.e2e.ts b/tests/e2e/tests/regression/workbench/redis-stack-commands.e2e.ts index a0ff732e9f..91f1d4e794 100644 --- a/tests/e2e/tests/regression/workbench/redis-stack-commands.e2e.ts +++ b/tests/e2e/tests/regression/workbench/redis-stack-commands.e2e.ts @@ -35,11 +35,11 @@ test.skip await t.click(workbenchPage.submitCommandButton); // Switch to Text view and check result await workbenchPage.selectViewTypeText(); - await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).exists).ok('The text view is not switched for GRAPH command'); + await t.expect(workbenchPage.queryCardContainer.nth(0).find(workbenchPage.cssQueryTextResult).exists).ok('The text view is not switched for GRAPH command'); // Switch to Graph view and check result await workbenchPage.selectViewTypeGraph(); await t.switchToIframe(workbenchPage.iframe); - await t.expect(await workbenchPage.queryCardContainer.nth(0).find(workbenchPage.queryGraphContainer).exists).ok('The Graph view is not switched for GRAPH command'); + await t.expect(workbenchPage.queryCardContainer.nth(0).find(workbenchPage.queryGraphContainer).exists).ok('The Graph view is not switched for GRAPH command'); }); test .meta({ env: env.desktop })('Verify that user can see "No data to visualize" message for Graph command', async t => { diff --git a/tests/e2e/tests/regression/workbench/scripting-area.e2e.ts b/tests/e2e/tests/regression/workbench/scripting-area.e2e.ts index 4a467d65a0..f60c47e181 100644 --- a/tests/e2e/tests/regression/workbench/scripting-area.e2e.ts +++ b/tests/e2e/tests/regression/workbench/scripting-area.e2e.ts @@ -47,7 +47,7 @@ test('Verify that user can run multiple commands written in multiple lines in Wo await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n'), 0.5); // Check the result for (let i = 1; i < commandsForSend.length + 1; i++) { - const resultCommand = await workbenchPage.queryCardCommand.nth(i - 1).textContent; + const resultCommand = workbenchPage.queryCardCommand.nth(i - 1).textContent; await t.expect(resultCommand).eql(commandsForSend[commandsForSend.length - i], `The command ${commandsForSend[commandsForSend.length - i]} is in not the result`); } }); @@ -74,7 +74,7 @@ test await workbenchPage.sendCommandInWorkbench(commandsForSend.join('\n"//"'), 0.5); // Check that all commands are executed for (let i = 1; i < commandsForSend.length + 1; i++) { - const resultCommand = await workbenchPage.queryCardCommand.nth(i - 1).textContent; + const resultCommand = workbenchPage.queryCardCommand.nth(i - 1).textContent; await t.expect(resultCommand).contains(commandsForSend[commandsForSend.length - i], `The command ${commandsForSend[commandsForSend.length - i]} is not in the result`); } }); @@ -116,7 +116,7 @@ test // Select "Run Commands" from menu await t.click(workbenchPage.monacoSuggestionOption); // Check the result with sent command - await t.expect(await workbenchPage.queryCardCommand.withExactText(command).exists).ok('The result of sent command is not displayed'); + await t.expect(workbenchPage.queryCardCommand.withExactText(command).exists).ok('The result of sent command is not displayed'); }); test('Verify that user can repeat commands by entering a number of repeats before the Redis command and see separate results per each command in Workbench', async t => { const command = 'FT._LIST'; @@ -137,8 +137,8 @@ test('Verify that user can repeat commands by entering a number of repeats befor await t.expect(workbenchPage.commandExecutionResultFailed.textContent).contains(result, 'The select command unsupported message is incorrect'); // Type command and use Ctrl + Enter - await t.typeText(workbenchPage.queryInput, command, { replace: true }); + await t.typeText(workbenchPage.queryInput, command, { replace: true, paste: true }); await t.pressKey('ctrl+enter'); // Verify that user can use Ctrl + Enter to run the query in Workbench - await t.expect(await workbenchPage.queryCardCommand.withExactText(command).exists).ok('The user can not use Ctrl + Enter to run the query'); + await t.expect(workbenchPage.queryCardCommand.withExactText(command).exists).ok('The user can not use Ctrl + Enter to run the query'); }); diff --git a/tests/e2e/tests/smoke/browser/filtering.e2e.ts b/tests/e2e/tests/smoke/browser/filtering.e2e.ts index 356a9ae5e1..b2e229b99a 100644 --- a/tests/e2e/tests/smoke/browser/filtering.e2e.ts +++ b/tests/e2e/tests/smoke/browser/filtering.e2e.ts @@ -45,7 +45,7 @@ test('Verify that user can filter per exact key without using any patterns', asy // Open CLI await t.click(cliPage.cliExpandButton); // Create new key for search - await t.typeText(cliPage.cliCommandInput, `APPEND ${keyName} 1`); + await t.typeText(cliPage.cliCommandInput, `APPEND ${keyName} 1`, { replace: true, paste: true }); await t.pressKey('enter'); await t.click(cliPage.cliCollapseButton); // Filter per exact key without using any patterns diff --git a/tests/e2e/tests/smoke/browser/set-ttl-for-key.e2e.ts b/tests/e2e/tests/smoke/browser/set-ttl-for-key.e2e.ts index f7fd4fd4dc..d498b80e90 100644 --- a/tests/e2e/tests/smoke/browser/set-ttl-for-key.e2e.ts +++ b/tests/e2e/tests/smoke/browser/set-ttl-for-key.e2e.ts @@ -31,7 +31,7 @@ test('Verify that user can specify TTL for Key', async t => { // Click on TTL button to edit TTL await t.click(browserPage.editKeyTTLButton); // Set TTL value - await t.typeText(browserPage.editKeyTTLInput, ttlValue); + await t.typeText(browserPage.editKeyTTLInput, ttlValue, { replace: true, paste: true }); // Save the TTL value await t.click(browserPage.saveTTLValue); // Refresh the page in several seconds diff --git a/tests/e2e/tests/smoke/cli/cli-command-helper.e2e.ts b/tests/e2e/tests/smoke/cli/cli-command-helper.e2e.ts index cec5ad4fc9..46c928faa5 100644 --- a/tests/e2e/tests/smoke/cli/cli-command-helper.e2e.ts +++ b/tests/e2e/tests/smoke/cli/cli-command-helper.e2e.ts @@ -24,7 +24,7 @@ test('Verify that user can search per command in Command Helper and see relevant // Open Command Helper await t.click(cliPage.expandCommandHelperButton); // Search per command - await t.typeText(cliPage.cliHelperSearch, commandForSearch); + await t.typeText(cliPage.cliHelperSearch, commandForSearch, { replace: true, paste: true }); // Verify results in the output const count = await cliPage.cliHelperOutputTitles.count; for(let i = 0; i < count; i++){ @@ -53,7 +53,7 @@ test('Verify that user can click on any of searched commands in Command Helper a // Open Command Helper await t.click(cliPage.expandCommandHelperButton); // Select one command from list of searched commands - await t.typeText(cliPage.cliHelperSearch, commandForSearch); + await t.typeText(cliPage.cliHelperSearch, commandForSearch, { replace: true, paste: true }); await t.click(cliPage.cliHelperOutputTitles.withExactText(COMMAND_APPEND)); // Verify details of the command await t.expect(cliPage.cliHelperTitleArgs.textContent).eql('APPEND key value', 'Command name and syntax not correct'); @@ -67,7 +67,7 @@ test('Verify that when user enters command, he can see Command Name, Complexity, // Open Command Helper await t.click(cliPage.expandCommandHelperButton); // Select one command from list of searched commands - await t.typeText(cliPage.cliHelperSearch, commandForSearch); + await t.typeText(cliPage.cliHelperSearch, commandForSearch, { replace: true, paste: true }); await t.click(cliPage.cliHelperOutputTitles.withExactText(commandForCheck)); // Verify details of the command await t.expect(cliPage.cliHelperTitleArgs.innerText).eql('LPOP key [count]', 'Command Name not correct'); @@ -84,11 +84,11 @@ test('Verify that user can see that command is autocompleted in CLI with require await t.click(cliPage.cliExpandButton); await t.click(cliPage.expandCommandHelperButton); // Search for the command and remember arguments - await t.typeText(cliPage.cliHelperSearch, command); + await t.typeText(cliPage.cliHelperSearch, command, { replace: true, paste: true }); await t.click(cliPage.cliHelperOutputTitles.withExactText(command)); const commandArgsFromCliHelper = await cliPage.cliHelperTitleArgs.innerText; // Enter the command in CLI - await t.typeText(cliPage.cliCommandInput, command); + await t.typeText(cliPage.cliCommandInput, command, { replace: true, paste: true }); // Verify autocompleted arguments const commandAutocomplete = await cliPage.cliCommandAutocomplete.innerText; await t.expect(commandArgsFromCliHelper).contains(commandAutocomplete, 'Command autocomplete arguments not correct'); diff --git a/tests/e2e/tests/smoke/cli/cli.e2e.ts b/tests/e2e/tests/smoke/cli/cli.e2e.ts index e50bf2326b..a3d761633a 100644 --- a/tests/e2e/tests/smoke/cli/cli.e2e.ts +++ b/tests/e2e/tests/smoke/cli/cli.e2e.ts @@ -34,7 +34,7 @@ test await t.expect(cliPage.cliCommandInput.exists).ok('CLI input is not displayed'); // Add key from CLI - await t.typeText(cliPage.cliCommandInput, `SADD ${keyName} "chinese" "japanese" "german"`); + await t.typeText(cliPage.cliCommandInput, `SADD ${keyName} "chinese" "japanese" "german"`, { replace: true, paste: true }); await t.pressKey('enter'); // Check that the key is added await browserPage.searchByKeyName(keyName); @@ -47,7 +47,7 @@ test('Verify that user can use blocking command', async t => { // Check that CLI is opened await t.expect(cliPage.cliArea.visible).ok('CLI area is not displayed'); // Type blocking command - await t.typeText(cliPage.cliCommandInput, 'blpop newKey 10000'); + await t.typeText(cliPage.cliCommandInput, 'blpop newKey 10000', { replace: true, paste: true }); await t.pressKey('enter'); // Verify that user input is blocked await t.expect(cliPage.cliCommandInput.exists).notOk('Cli input is still shown'); @@ -66,7 +66,7 @@ test await t.pressKey('enter'); const clientId = (await cliPage.cliOutputResponseSuccess.textContent).replace(/^\D+/g, ''); // Type blocking command - await t.typeText(cliPage.cliCommandInput, 'blpop newKey 10000'); + await t.typeText(cliPage.cliCommandInput, 'blpop newKey 10000', { replace: true, paste: true }); await t.pressKey('enter'); // Verify that user input is blocked await t.expect(cliPage.cliCommandInput.exists).notOk('Cli input is still shown'); @@ -78,7 +78,7 @@ test // Open CLI await t.click(cliPage.cliExpandButton); // Unblock client - await t.typeText(cliPage.cliCommandInput, `client unblock ${clientId}`); + await t.typeText(cliPage.cliCommandInput, `client unblock ${clientId}`, { replace: true, paste: true }); await t.pressKey('enter'); await t.closeWindow(); await t.expect(cliPage.cliCommandInput.exists).ok('Cli input is not shown, the client still blocked', { timeout: 10000 }); diff --git a/tests/e2e/tests/smoke/workbench/scripting-area.e2e.ts b/tests/e2e/tests/smoke/workbench/scripting-area.e2e.ts index 756a8fef38..9e36b6657c 100644 --- a/tests/e2e/tests/smoke/workbench/scripting-area.e2e.ts +++ b/tests/e2e/tests/smoke/workbench/scripting-area.e2e.ts @@ -45,9 +45,9 @@ test('Verify that user can comment out any characters in scripting area and all // Check that 2 results are shown await t.expect(workbenchPage.queryCardContainer.count).eql(2); // Check that we have results with sent commands - const sentCommandText1 = await workbenchPage.queryCardCommand.withExactText(command1); + const sentCommandText1 = workbenchPage.queryCardCommand.withExactText(command1); await t.expect(sentCommandText1.exists).ok('Result of sent command not exists'); - const sentCommandText2 = await workbenchPage.queryCardCommand.withExactText(command2); + const sentCommandText2 = workbenchPage.queryCardCommand.withExactText(command2); await t.expect(sentCommandText2.exists).ok('Result of sent command not exists'); }); test('Verify that user can run multiple commands in one query in Workbench', async t => { diff --git a/tests/e2e/web.runner.ts b/tests/e2e/web.runner.ts index 9eaac2f074..587e818b36 100644 --- a/tests/e2e/web.runner.ts +++ b/tests/e2e/web.runner.ts @@ -34,6 +34,7 @@ import testcafe from 'testcafe'; skipJsErrors: true, browserInitTimeout: 60000, selectorTimeout: 5000, + assertionTimeout: 5000, speed: 1, quarantineMode: { successThreshold: '1', attemptLimit: '3' } });