Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/e2e/desktop.runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import testcafe from 'testcafe';
assertionTimeout: 5000,
speed: 1,
quarantineMode: { successThreshold: 1, attemptLimit: 3 },
disableMultipleWindows: true
});
})
.then((failedCount) => {
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/desktop.runner.win.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import testcafe from 'testcafe';
assertionTimeout: 5000,
speed: 1,
quarantineMode: { successThreshold: 1, attemptLimit: 3 },
disableMultipleWindows: true
});
})
.then((failedCount) => {
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/helpers/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { ClientFunction } from 'testcafe';

export const goBackHistory = ClientFunction(() => window.history.back());
10 changes: 4 additions & 6 deletions tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build:web": "yarn --cwd ../../ build:web",
"redis:last": "docker run --name redis-last-version -p 7777:6379 -d redislabs/redismod",
"start:app": "cross-env SERVER_STATIC_CONTENT=true yarn start:api",
"test:chrome": "testcafe --compiler-options typescript.configPath=tsconfig.testcafe.json --cache --concurrency 1 chrome tests/ -r html:./report/report.html,spec -e -s takeOnFails=true,path=report/screenshots/,pathPattern=${OS}_${BROWSER}/${DATE}_${TIME}/${FIXTURE}_${TEST}_${FILE_INDEX}.png",
"test:chrome": "testcafe --compiler-options typescript.configPath=tsconfig.testcafe.json --cache --disable-multiple-windows --concurrency 1 chrome tests/ -r html:./report/report.html,spec -e -s takeOnFails=true,path=report/screenshots/,pathPattern=${OS}_${BROWSER}/${DATE}_${TIME}/${FIXTURE}_${TEST}_${FILE_INDEX}.png",
"test:chrome:ci": "ts-node ./web.runner.ts",
"test": "yarn test:chrome",
"lint": "eslint . --ext .ts,.js,.tsx,.jsx",
Expand All @@ -30,9 +30,7 @@
"@types/lodash": "4.14.192",
"@types/node": "20.3.1",
"word-wrap": "1.2.4",
"**/semver": "^7.5.2",
"testcafe-hammerhead": "31.4.5",
"testcafe-hammerhead/tough-cookie": "^4.1.3"
"**/semver": "^7.5.2"
},
"devDependencies": {
"@types/archiver": "^5.3.2",
Expand All @@ -56,11 +54,11 @@
"redis": "3.1.1",
"sqlite3": "^5.1.6",
"supertest": "^4.0.2",
"testcafe": "3.0.0",
"testcafe": "3.3.0",
"testcafe-browser-provider-electron": "0.0.19",
"testcafe-reporter-html": "1.4.6",
"testcafe-reporter-json": "2.2.0",
"testcafe-reporter-spec": "2.1.1",
"testcafe-reporter-spec": "2.2.0",
"ts-node": "10.9.1",
"typescript": "5.1.3"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ test('Verify bulk upload of different text docs formats', async t => {

// Verify that user can remove uploaded file
await t.setFilesToUpload(browserPage.BulkActions.bulkUploadInput, [filePathes.bigDataFile]);
// update after resolving testcafe Native Automation mode limitations
// await t.expect(browserPage.BulkActions.bulkUploadContainer.textContent).contains(filesToUpload[1], 'Filename not displayed in upload input');
await t.expect(browserPage.BulkActions.bulkUploadContainer.textContent).contains(filesToUpload[1], 'Filename not displayed in upload input');
await t.click(browserPage.BulkActions.removeFileBtn);
await t.expect(browserPage.BulkActions.bulkUploadContainer.textContent).contains(defaultText, 'File not removed from upload input');

Expand Down
43 changes: 24 additions & 19 deletions tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { DatabaseHelper } from '../../../../helpers/database';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { sshPrivateKey, sshPrivateKeyWithPasscode } from '../../../../test-data/sshPrivateKeys';
import { Common } from '../../../../helpers/common';
// import { BrowserActions } from '../../../common-actions/browser-actions';
import { BrowserActions } from '../../../../common-actions/browser-actions';

const myRedisDatabasePage = new MyRedisDatabasePage();
const browserPage = new BrowserPage();
const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();
// const browserActions = new BrowserActions();
const browserActions = new BrowserActions();

const sshParams = {
sshHost: '172.31.100.245',
Expand Down Expand Up @@ -43,6 +43,12 @@ fixture `Adding database with SSH`
await databaseAPIRequests.deleteStandaloneDatabasesByNamesApi([sshDbPass.databaseName, sshDbPrivateKey.databaseName, sshDbPasscode.databaseName, newClonedDatabaseAlias]);
});
test('Adding database with SSH', async t => {
const tooltipText = [
'Enter a value for required fields (3):',
'SSH Host',
'SSH Username',
'SSH Private Key'
];
const hiddenPass = '••••••••••••';
const sshWithPass = {
...sshParams,
Expand All @@ -57,25 +63,24 @@ test('Adding database with SSH', async t => {
sshPrivateKey: sshPrivateKeyWithPasscode,
sshPassphrase: 'test'
};
// update after resolving testcafe Native Automation mode limitations
// // Verify that if user have not entered any required value he can see that this field should be specified when hover over the button to add a database
// await t
// .click(myRedisDatabasePage.AddRedisDatabase.addDatabaseButton)
// .click(myRedisDatabasePage.AddRedisDatabase.addDatabaseManually)
// .click(myRedisDatabasePage.AddRedisDatabase.useSSHCheckbox)
// .click(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyRadioBtn)
// .hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
// for (const text of tooltipText) {
// await browserActions.verifyTooltipContainsText(text, true);
// }
// // Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
// await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
// for (const text of tooltipText) {
// await browserActions.verifyTooltipContainsText(text, true);
// }
// Verify that if user have not entered any required value he can see that this field should be specified when hover over the button to add a database
await t
.click(myRedisDatabasePage.AddRedisDatabase.addDatabaseButton)
.click(myRedisDatabasePage.AddRedisDatabase.addDatabaseManually)
.click(myRedisDatabasePage.AddRedisDatabase.useSSHCheckbox)
.click(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyRadioBtn)
.hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
for (const text of tooltipText) {
await browserActions.verifyTooltipContainsText(text, true);
}
// Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
for (const text of tooltipText) {
await browserActions.verifyTooltipContainsText(text, true);
}

// Verify that user can add SSH tunnel with Password for Standalone database
// await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
await myRedisDatabasePage.AddRedisDatabase.addStandaloneSSHDatabase(sshDbPass, sshWithPass);
await myRedisDatabasePage.clickOnDBByName(sshDbPass.databaseName);
await Common.checkURLContainsText('browser');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ test('Verify bulk upload of different text docs formats', async t => {

// Verify that user can remove uploaded file
await t.setFilesToUpload(browserPage.BulkActions.bulkUploadInput, [filePathes.bigDataFile]);
// update after resolving testcafe Native Automation mode limitations
// await t.expect(browserPage.BulkActions.bulkUploadContainer.textContent).contains(filesToUpload[1], 'Filename not displayed in upload input');
await t.expect(browserPage.BulkActions.bulkUploadContainer.textContent).contains(filesToUpload[1], 'Filename not displayed in upload input');
await t.click(browserPage.BulkActions.removeFileBtn);
await t.expect(browserPage.BulkActions.bulkUploadContainer.textContent).contains(defaultText, 'File not removed from upload input');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { Common } from '../../../../helpers/common';
import { verifyKeysDisplayingInTheList } from '../../../../helpers/keys';
import { APIKeyRequests } from '../../../../helpers/api/api-keys';
import { goBackHistory } from '../../../../helpers/utils';

const browserPage = new BrowserPage();
const myRedisDatabasePage = new MyRedisDatabasePage();
Expand Down Expand Up @@ -75,7 +76,7 @@ test
await t.hover(browserPage.redisearchModeBtn);
await t.expect(browserPage.tooltip.textContent).contains(redisearchModeTooltipText, 'Invalid text in redisearch mode tooltip');

// Verify that user see the "Select an index" message when he switch to Search
// Verify that user see the "Select an index" message when he switches to Search
await t.click(browserPage.redisearchModeBtn);
await t.expect(browserPage.keyListTable.textContent).contains(notSelectedIndexText, 'Select an index message not displayed');

Expand Down Expand Up @@ -112,7 +113,7 @@ test
await verifyKeysDisplayingInTheList(keyNames, true);
await t.expect(browserPage.getKeySelectorByName(keyName).exists).notOk('Key without index displayed after search');

// Verify that user see the database scanned when he switch to Pattern search mode
// Verify that user see the database scanned when he switches to Pattern search mode
await t.click(browserPage.patternModeBtn);
await t.click(browserPage.browserViewButton);
await verifyKeysDisplayingInTheList(keyNames, true);
Expand Down Expand Up @@ -154,16 +155,14 @@ test
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneV5Config);
})('No RediSearch module message', async t => {
const noRedisearchMessage = 'RediSearch is not available for this database';
// const externalPageLink = 'https://redis.com/try-free/?utm_source=redisinsight&utm_medium=app&utm_campaign=redisinsight_browser_search';
const externalPageLink = 'https://redis.com/try-free/?utm_source=redisinsight&utm_medium=app&utm_campaign=redisinsight_browser_search';

await t.click(browserPage.redisearchModeBtn);
// Verify that user can see message in the dialog when he doesn't have RediSearch module
await t.expect(browserPage.noReadySearchDialogTitle.textContent).contains(noRedisearchMessage, 'Invalid text in no redisearch popover');
// update after resolving testcafe Native Automation mode limitations
// // Verify that user can navigate by link to create a Redis db
// await t.click(browserPage.redisearchFreeLink);
// await Common.checkURL(externalPageLink);
// await t.switchToParentWindow();
// Verify that user can navigate by link to create a Redis db
await t.click(browserPage.redisearchFreeLink);
await Common.checkURL(externalPageLink);
});
test
.before(async() => {
Expand All @@ -173,7 +172,7 @@ test
await browserPage.Cli.sendCommandInCli(`FT.DROPINDEX ${indexName}`);
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneBigConfig);
})('Index creation', async t => {
// const createIndexLink = 'https://redis.io/commands/ft.create/';
const createIndexLink = 'https://redis.io/commands/ft.create/';

// Verify that user can cancel index creation
await t.click(browserPage.redisearchModeBtn);
Expand All @@ -188,13 +187,14 @@ test
await t.click(browserPage.selectIndexDdn);
await t.click(browserPage.createIndexBtn);
await t.expect(browserPage.newIndexPanel.exists).ok('New Index panel is not displayed');
// update after resolving testcafe Native Automation mode limitations
// // Verify that user can see a link to create a profound index and navigate
// await t.click(browserPage.newIndexPanel.find('a'));
// await Common.checkURL(createIndexLink);
// await t.switchToParentWindow();
// Verify that user can see a link to create a profound index and navigate
await t.click(browserPage.newIndexPanel.find('a'));
await Common.checkURL(createIndexLink);
await goBackHistory();

// Verify that user can create an index with multiple prefixes
await t.click(browserPage.selectIndexDdn);
await t.click(browserPage.createIndexBtn);
await t.click(browserPage.indexNameInput);
await t.typeText(browserPage.indexNameInput, indexName);
await t.click(browserPage.prefixFieldInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ test('Verify that user can type TS. in Command helper and see commands from Redi
await browserPage.CommandHelper.selectFilterGroupType(COMMAND_GROUP_TIMESERIES);
// Search per part of command and check all opened commands
await browserPage.CommandHelper.checkSearchedCommandInCommandHelper(commandForSearch, timeSeriesCommands);
// update after resolving testcafe Native Automation mode limitations
// // Check the first command documentation url
// await browserPage.CommandHelper.checkURLCommand(timeSeriesCommands[0], `https://redis.io/commands/${timeSeriesCommands[0].toLowerCase()}/`);
// await t.switchToParentWindow();
// Check the first command documentation url
await browserPage.CommandHelper.checkURLCommand(timeSeriesCommands[0], `https://redis.io/commands/${timeSeriesCommands[0].toLowerCase()}/`);
});
// outdated after https://redislabs.atlassian.net/browse/RI-4608
test.skip('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { DatabaseHelper } from '../../../../helpers/database';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { sshPrivateKey, sshPrivateKeyWithPasscode } from '../../../../test-data/sshPrivateKeys';
import { Common } from '../../../../helpers/common';
// import { BrowserActions } from '../../../common-actions/browser-actions';
import { BrowserActions } from '../../../../common-actions/browser-actions';

const myRedisDatabasePage = new MyRedisDatabasePage();
const browserPage = new BrowserPage();
const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();
const welcomePage = new WelcomePage();
// const browserActions = new BrowserActions();
const browserActions = new BrowserActions();

const sshParams = {
sshHost: '172.31.100.245',
Expand Down Expand Up @@ -90,12 +90,12 @@ test
await databaseAPIRequests.deleteStandaloneDatabasesByNamesApi([sshDbPass.databaseName, sshDbPrivateKey.databaseName, sshDbPasscode.databaseName, newClonedDatabaseAlias]);
})('Adding database with SSH', async t => {
const hiddenPass = '••••••••••••';
// const tooltipText = [
// 'Enter a value for required fields (3):',
// 'SSH Host',
// 'SSH Username',
// 'SSH Private Key'
// ];
const tooltipText = [
'Enter a value for required fields (3):',
'SSH Host',
'SSH Username',
'SSH Private Key'
];
const sshWithPass = {
...sshParams,
sshPassword: 'pass'
Expand All @@ -109,25 +109,24 @@ test
sshPrivateKey: sshPrivateKeyWithPasscode,
sshPassphrase: 'test'
};
// update after resolving testcafe Native Automation mode limitations
// // Verify that if user have not entered any required value he can see that this field should be specified when hover over the button to add a database
// await t
// .click(myRedisDatabasePage.AddRedisDatabase.addDatabaseButton)
// .click(myRedisDatabasePage.AddRedisDatabase.addDatabaseManually)
// .click(myRedisDatabasePage.AddRedisDatabase.useSSHCheckbox)
// .click(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyRadioBtn)
// .hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
// for (const text of tooltipText) {
// await browserActions.verifyTooltipContainsText(text, true);
// }
// // Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
// await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
// for (const text of tooltipText) {
// await browserActions.verifyTooltipContainsText(text, true);
// }
// Verify that if user have not entered any required value he can see that this field should be specified when hover over the button to add a database
await t
.click(myRedisDatabasePage.AddRedisDatabase.addDatabaseButton)
.click(myRedisDatabasePage.AddRedisDatabase.addDatabaseManually)
.click(myRedisDatabasePage.AddRedisDatabase.useSSHCheckbox)
.click(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyRadioBtn)
.hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
for (const text of tooltipText) {
await browserActions.verifyTooltipContainsText(text, true);
}
// Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
for (const text of tooltipText) {
await browserActions.verifyTooltipContainsText(text, true);
}

// Verify that user can add SSH tunnel with Password for Standalone database
// await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
await myRedisDatabasePage.AddRedisDatabase.addStandaloneSSHDatabase(sshDbPass, sshWithPass);
await myRedisDatabasePage.clickOnDBByName(sshDbPass.databaseName);
await Common.checkURLContainsText('browser');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ test.before(async() => {
await t.click(myRedisDatabasePage.closeDialogBtn);
await t.click(myRedisDatabasePage.importDatabasesBtn);
await t.setFilesToUpload(myRedisDatabasePage.importDatabaseInput, [rdmData.path]);
// update after resolving testcafe Native Automation mode limitations
// await t.expect(myRedisDatabasePage.importDbDialog.textContent).contains(fileNames.rdmFullJson, 'Filename not displayed in import input');
await t.expect(myRedisDatabasePage.importDbDialog.textContent).contains(fileNames.rdmFullJson, 'Filename not displayed in import input');
// Click on remove button
await t.click(myRedisDatabasePage.removeImportedFileBtn);
await t.expect(myRedisDatabasePage.importDbDialog.textContent).contains(defaultText, 'File not removed from import input');
Expand Down
Loading