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
Original file line number Diff line number Diff line change
Expand Up @@ -1387,13 +1387,15 @@ const AddStandaloneForm = (props: Props) => {
title="Database"
isCollapsible
initialIsOpen={false}
data-testid="database-nav-group-clone"
>
{SentinelMasterDatabase()}
</EuiCollapsibleNavGroup>
<EuiCollapsibleNavGroup
title="Sentinel"
isCollapsible
initialIsOpen={false}
data-testid="sentinel-nav-group-clone"
>
{DatabaseForm()}
</EuiCollapsibleNavGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"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 --concurrency 1 chrome tests/ -r html:./report/report.html,spec -e -s takeOnFails=true,path=report/screenshots,pathPattern=${USERAGENT}/${DATE}_${TIME}/${FIXTURE}_${TEST_INDEX}.png",
"test:chrome": "testcafe --concurrency 1 chrome tests/ -r html:./report/report.html,spec -e -s takeOnFails=true,path=report/screenshots,pathPattern=${OS}_${BROWSER}/${DATE}_${TIME}/${FIXTURE}_${TEST_ID}_${FILE_INDEX}.png",
"test:chrome:ci": "ts-node ./web.runner.ts",
"test": "yarn test:chrome",
"lint": "eslint . --ext .ts,.js,.tsx,.jsx",
"test:desktop:ci": "ts-node ./desktop.runner.ts",
"test:desktop:ci:win": "ts-node ./desktop.runner.win.ts",
"test:desktop": "testcafe electron tests/ --browser-init-timeout 180000 -e -r html:./report/desktop-report.html,spec -s takeOnFails=true,path=report/screenshots,pathPattern=${USERAGENT}/${DATE}_${TIME}/${FIXTURE}_${TEST_INDEX}.png"
"test:desktop": "testcafe electron tests/ --browser-init-timeout 180000 -e -r html:./report/desktop-report.html,spec -s takeOnFails=true,path=report/screenshots,pathPattern=${OS}_${BROWSER}/${DATE}_${TIME}/${FIXTURE}_${TEST_ID}_${FILE_INDEX}.png"
},
"keywords": [],
"author": "",
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/pageObjects/add-redis-database-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export class AddRedisDatabasePage {
discoverSentinelDatabaseButton = Selector('[data-testid=btn-submit]');
cloneDatabaseButton = Selector('[data-testid=clone-db-btn]');
sentinelNavigation = Selector('[data-testid=sentinel-nav-group]');
cloneSentinelNavigation = Selector('[data-testid=sentinel-nav-group-clone]');
sentinelDatabaseNavigation = Selector('[data-testid=database-nav-group]');
cloneSentinelDatabaseNavigation = Selector('[data-testid=database-nav-group-clone]');
cancelButton = Selector('[data-testid=btn-cancel]');
//TEXT INPUTS (also referred to as 'Text fields')
hostInput = Selector('[data-testid=host]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ test
.expect(addRedisDatabasePage.primaryGroupNameInput.getAttribute('value')).eql(ossSentinelConfig.name[1], 'Invalid primary group name value');
// Validate Databases section
await t
.click(addRedisDatabasePage.sentinelDatabaseNavigation)
.click(addRedisDatabasePage.cloneSentinelDatabaseNavigation)
.expect(addRedisDatabasePage.masterGroupPassword.getAttribute('value')).eql(ossSentinelConfig.masters[1].password, 'Invalid sentinel database password');
// Validate Sentinel section
await t
.click(addRedisDatabasePage.sentinelNavigation)
.click(addRedisDatabasePage.cloneSentinelNavigation)
.expect(addRedisDatabasePage.portInput.getAttribute('value')).eql(ossSentinelConfig.sentinelPort, 'Invalid sentinel port')
.expect(addRedisDatabasePage.passwordInput.getAttribute('value')).eql(ossSentinelConfig.sentinelPassword, 'Invalid sentinel password');
// Clone Sentinel Primary Group
Expand Down
25 changes: 12 additions & 13 deletions tests/e2e/tests/critical-path/monitor/save-commands.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ const tempDir = os.tmpdir();
let downloadedFilePath = '';

async function getFileDownloadPath(): Promise<string> {
return os.platform() == 'linux'
? joinPath('home', os.hostname(), 'Downloads')
: joinPath(os.homedir(), 'Downloads');
return joinPath(os.homedir(), 'Downloads');
}

async function findByFileStarts(dir: string): Promise<number> {
const matchedFiles: string[] = [];
const files = fs.readdirSync(dir);

for (const file of files) {
if (file.startsWith('test_standalone')) {
matchedFiles.push(file);
if (fs.existsSync(dir)) {
const matchedFiles: string[] = [];
const files = fs.readdirSync(dir);
for (const file of files) {
if (file.startsWith('test_standalone')) {
matchedFiles.push(file);
}
}
return matchedFiles.length;
} else {
return 0;
}

return matchedFiles.length;
}

fixture `Save commands`
Expand Down Expand Up @@ -109,8 +109,7 @@ test
await t.expect(monitorPage.resetProfilerButton.visible).ok('The Reset Profiler button visibility');
await t.expect(monitorPage.downloadLogButton.visible).ok('The Download button visibility');
});
// Skipped due to testCafe issue https://github.com/DevExpress/testcafe/issues/5574
test.skip
test
.meta({ rte: rte.standalone })('Verify that when user see the toggle is OFF - Profiler logs are not being saved', async t => {
//Remember the number of files in Temp
const numberOfDownloadFiles = await findByFileStarts(downloadedFilePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test('Verify that when manager publishes new notification, it appears in the app
await t.expect(notificationPage.notificationCategory.visible).ok('Category is not displayed in popup');
if (sortedNotifications[0].category !== undefined) {
await t.expect(notificationPage.notificationCategory.innerText).eql(sortedNotifications[0].category ?? '', 'Text for category is not correct');
await t.expect(notificationPage.notificationCategory.withExactText(sortedNotifications[0].category ?? '').withAttribute('title', `background-color: rgb${sortedNotifications[0].rbgColor}; color: rgb(0, 0, 0);`).exists).ok('Category color');
await t.expect(notificationPage.notificationCategory.withExactText(sortedNotifications[0].category ?? '').withAttribute('style', `background-color: rgb${sortedNotifications[0].rbgColor}; color: rgb(0, 0, 0);`).exists).ok('Category color');
}
// Verify that user can click on close button and received notification will be closed
await t.click(notificationPage.closeNotificationPopup);
Expand Down Expand Up @@ -79,9 +79,9 @@ test('Verify that user can open notification center by clicking on icon and see
await t.expect(notificationPage.notificationBody.withExactText(jsonNotifications[i].body).exists).ok('Displayed body');
await t.expect(notificationPage.notificationDate.withExactText(await notificationPage.convertEpochDateToMessageDate(jsonNotifications[i])).exists).ok('Displayed date');
// Verify that user can see notification with category badge and category color in the notification center
if (!jsonNotifications[i].category !== undefined) {
await t.expect(notificationPage.notificationCategory.withExactText(jsonNotifications[i].category ?? '').exists).ok('Displayed category name');
await t.expect(notificationPage.notificationCategory.withExactText(jsonNotifications[i].category ?? '').withAttribute('title', `background-color: rgb${jsonNotifications[i].rbgColor}; color: rgb(0, 0, 0);`).exists).ok('Category color');
if (jsonNotifications[i].category !== undefined) {
await t.expect(notificationPage.notificationCategory.withExactText(jsonNotifications[i].category ?? '').exists).ok(`${jsonNotifications[i].category} category name not displayed`);
await t.expect(notificationPage.notificationCategory.withExactText(jsonNotifications[i].category ?? '').withAttribute('style', `background-color: rgb${jsonNotifications[i].rbgColor}; color: rgb(0, 0, 0);`).exists).ok('Category color');
}
}
// Verify that as soon as user closes notification center, unread messages become read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Chance } from 'chance';
import { env, rte } from '../../../helpers/constants';
import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
import { MyRedisDatabasePage, WorkbenchPage } from '../../../pageObjects';
import { commonUrl, ossStandaloneRedisearch } from '../../../helpers/conf';
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';

const myRedisDatabasePage = new MyRedisDatabasePage();
Expand All @@ -17,15 +17,15 @@ fixture `Command results at Workbench`
.meta({ type: 'critical_path', rte: rte.standalone })
.page(commonUrl)
.beforeEach(async t => {
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
//Go to Workbench page
await t.click(myRedisDatabasePage.workbenchButton);
})
.afterEach(async t => {
//Drop index, documents and database
await t.switchToMainWindow();
await workbenchPage.sendCommandInWorkbench(`FT.DROPINDEX ${indexName} DD`);
await deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
});
test('Verify that user can see re-run icon near the already executed command and re-execute the command by clicking on the icon in Workbench page', async t => {
//Send commands
Expand Down Expand Up @@ -107,7 +107,7 @@ test.skip
test
.after(async() => {
//Drop database
await deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
})('Verify that user can populate commands in Editor from history by clicking keyboard “up” button', async t => {
const commands = [
'FT.INFO',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test
await t.expect(workbenchPage.queryColumns.textContent).contains('name', 'The result of the FT.INFO command');
});
test
.meta({ rte: rte.standalone })('Verify that user can edit and run automatically added "Search" script in Workbench and see the results', async t => {
.meta({ env: env.desktop, rte: rte.standalone })('Verify that user can edit and run automatically added "Search" script in Workbench and see the results', async t => {
indexName = chance.word({ length: 5 });
keyName = chance.word({ length: 5 });
const commandsForSend = [
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/tests/regression/workbench/command-results.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const commandsForIndex = [
'HMSET product:1 price 20',
'HMSET product:2 price 100'
];

fixture `Command results at Workbench`
// skip due to errors of FT.SEARCH issue https://redislabs.atlassian.net/browse/RI-3501
fixture.skip `Command results at Workbench`
.meta({type: 'regression', rte: rte.standalone })
.page(commonUrl)
.beforeEach(async t => {
Expand Down Expand Up @@ -73,7 +73,7 @@ test
await t.expect(await workbenchPage.queryTableResult.exists).ok('The table view is not switched for command FT.AGGREGATE');
});
// skip due to inaccessibility of CLIENT LIST in plugin
test.skip
test
.meta({ env: env.web })('Verify that user can switches between views and see results according to this view in full mode in Workbench', async t => {
const command = 'CLIENT LIST';
//Send command and check table view is default in full mode
Expand Down
18 changes: 9 additions & 9 deletions tests/e2e/tests/regression/workbench/editor-cleanup.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ fixture `Workbench Editor Cleanup`
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
});
test('Disabled Editor Cleanup toggle behavior', async t => {
// Go to Settings page
await t.click(myRedisDatabasePage.settingsButton);
await t.click(settingsPage.accordionWorkbenchSettings);
// Disable Editor Cleanup
await t.click(settingsPage.switchEditorCleanupOption);
// Go to Workbench page
await t.click(myRedisDatabasePage.workbenchButton);
// Send commands
Expand All @@ -36,11 +41,6 @@ test('Disabled Editor Cleanup toggle behavior', async t => {
await t.expect((await workbenchPage.queryInputScriptArea.textContent).replace(/\s/g, ' ')).eql(commandToSend, 'Input in Editor is saved');
});
test('Enabled Editor Cleanup toggle behavior', async t => {
// Go to Settings page
await t.click(myRedisDatabasePage.settingsButton);
await t.click(settingsPage.accordionWorkbenchSettings);
// Enable Editor Cleanup
await t.click(settingsPage.switchEditorCleanupOption);
// Go to Workbench page
await t.click(myRedisDatabasePage.workbenchButton);
// Send commands
Expand All @@ -65,18 +65,18 @@ test
// Go to Settings page
await t.click(myRedisDatabasePage.settingsButton);
await t.click(settingsPage.accordionWorkbenchSettings);
// Enable Editor Cleanup
await settingsPage.changeEditorCleanupSwitcher(true);
// Disable Editor Cleanup
await settingsPage.changeEditorCleanupSwitcher(false);
await common.reloadPage();
await t.click(settingsPage.accordionWorkbenchSettings);
// Verify that Editor Cleanup setting is saved when refreshing the page
await t.expect(await settingsPage.getEditorCleanupSwitcherValue()).eql('true', 'Editor Cleanup switcher changed');
await t.expect(await settingsPage.getEditorCleanupSwitcherValue()).eql('false', 'Editor Cleanup switcher changed');
// Go to another database
await t.click(myRedisDatabasePage.myRedisDBButton);
await myRedisDatabasePage.clickOnDBByName(databasesForAdding[1].databaseName);
// Go to Settings page
await t.click(myRedisDatabasePage.settingsButton);
await t.click(settingsPage.accordionWorkbenchSettings);
// Verify that Editor Cleanup setting is saved when switching between databases
await t.expect(await settingsPage.getEditorCleanupSwitcherValue()).eql('true', 'Editor Cleanup switcher changed');
await t.expect(await settingsPage.getEditorCleanupSwitcherValue()).eql('false', 'Editor Cleanup switcher changed');
});
13 changes: 7 additions & 6 deletions tests/e2e/tests/regression/workbench/raw-mode.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { acceptLicenseTerms, acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
import { WorkbenchPage, MyRedisDatabasePage, BrowserPage } from '../../../pageObjects';
import { rte } from '../../../helpers/constants';
import { env, rte } from '../../../helpers/constants';
import { commonUrl, ossStandaloneConfig, ossStandaloneRedisearch } from '../../../helpers/conf';
import { addNewStandaloneDatabasesApi, deleteStandaloneDatabaseApi, deleteStandaloneDatabasesApi } from '../../../helpers/api/api-database';
import { Common } from '../../../helpers/common';
Expand Down Expand Up @@ -91,16 +91,17 @@ test
});
test
.before(async t => {
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
// Go to Workbench page
await t.click(myRedisDatabasePage.workbenchButton);
})
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
// Go to Workbench page
await t.click(myRedisDatabasePage.workbenchButton);
})
.after(async t => {
//Drop index, documents and database
await t.switchToMainWindow();
await workbenchPage.sendCommandInWorkbench(`FT.DROPINDEX ${indexName} DD`);
await deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
})('Display Raw mode for plugins', async t => {
})
.meta({ env: env.desktop })('Display Raw mode for plugins', async t => {
const commandsForSend = [
`FT.CREATE ${indexName} ON HASH PREFIX 1 product: SCHEMA name TEXT`,
`HMSET product:1 name "${unicodeValue}"`,
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/regression/workbench/scripting-area.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test
//Go to Settings page
await t.click(myRedisDatabasePage.settingsButton);
//Specify Commands in pipeline
await t.click(settingsPage.accordionAdvancedSettings);
await t.click(settingsPage.accordionWorkbenchSettings);
await settingsPage.changeCommandsInPipeline('1');
//Go to Workbench page
await t.click(myRedisDatabasePage.workbenchButton);
Expand Down Expand Up @@ -68,7 +68,7 @@ test
//Go to Settings page
await t.click(myRedisDatabasePage.settingsButton);
//Specify Commands in pipeline
await t.click(settingsPage.accordionAdvancedSettings);
await t.click(settingsPage.accordionWorkbenchSettings);
await settingsPage.changeCommandsInPipeline('1');
//Go to Workbench page
await t.click(myRedisDatabasePage.workbenchButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fixture `Workbench Pipeline`
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneBigConfig, ossStandaloneBigConfig.databaseName);
// Go to Settings page - Pipeline mode
await t.click(myRedisDatabasePage.settingsButton);
await t.click(settingsPage.accordionAdvancedSettings);
await t.click(settingsPage.accordionWorkbenchSettings);
})
.afterEach(async () => {
//Delete database
Expand All @@ -31,7 +31,7 @@ test
.meta({ env: env.web })('Verify that user can see the text in settings for pipeline with link', async t => {
const pipelineText = 'Sets the size of a command batch for the pipeline(opens in a new tab or window) mode in Workbench. 0 or 1 pipelines every command.';
// Verify text in setting for pipeline
await t.expect(settingsPage.accordionAdvancedSettings.textContent).contains(pipelineText, 'Text is incorrect');
await t.expect(settingsPage.accordionWorkbenchSettings.textContent).contains(pipelineText, 'Text is incorrect');
await t.click(settingsPage.pipelineLink);
// Check new opened window page with the correct URL
await t.expect(getPageUrl()).eql(externalPageLink, 'The opened page is incorrect');
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/web.runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import testcafe from 'testcafe';
.screenshots({
path: 'report/screenshots/',
takeOnFails: true,
pathPattern: '${OS}_${BROWSER}/${DATE}_${TIME}/${FIXTURE}_${TEST_INDEX}.png',
pathPattern: '${OS}_${BROWSER}/${DATE}_${TIME}/${FIXTURE}_${TEST_ID}_${FILE_INDEX}.png',
})
.reporter([
'spec',
Expand Down