Skip to content

Commit 6b8ce15

Browse files
authored
Merge pull request #1118 from RedisInsight/e2e/bugfix/downloads-fix-profiler
regression fixes and fix for profiler skipped test
2 parents d0c1f41 + 19ea649 commit 6b8ce15

File tree

14 files changed

+53
-49
lines changed

14 files changed

+53
-49
lines changed

redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/InstanceForm.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,13 +1387,15 @@ const AddStandaloneForm = (props: Props) => {
13871387
title="Database"
13881388
isCollapsible
13891389
initialIsOpen={false}
1390+
data-testid="database-nav-group-clone"
13901391
>
13911392
{SentinelMasterDatabase()}
13921393
</EuiCollapsibleNavGroup>
13931394
<EuiCollapsibleNavGroup
13941395
title="Sentinel"
13951396
isCollapsible
13961397
initialIsOpen={false}
1398+
data-testid="sentinel-nav-group-clone"
13971399
>
13981400
{DatabaseForm()}
13991401
</EuiCollapsibleNavGroup>

tests/e2e/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"build:web": "yarn --cwd ../../ build:web",
1313
"redis:last": "docker run --name redis-last-version -p 7777:6379 -d redislabs/redismod",
1414
"start:app": "cross-env SERVER_STATIC_CONTENT=true yarn start:api",
15-
"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",
15+
"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",
1616
"test:chrome:ci": "ts-node ./web.runner.ts",
1717
"test": "yarn test:chrome",
1818
"lint": "eslint . --ext .ts,.js,.tsx,.jsx",
1919
"test:desktop:ci": "ts-node ./desktop.runner.ts",
2020
"test:desktop:ci:win": "ts-node ./desktop.runner.win.ts",
21-
"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"
21+
"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"
2222
},
2323
"keywords": [],
2424
"author": "",

tests/e2e/pageObjects/add-redis-database-page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export class AddRedisDatabasePage {
2424
discoverSentinelDatabaseButton = Selector('[data-testid=btn-submit]');
2525
cloneDatabaseButton = Selector('[data-testid=clone-db-btn]');
2626
sentinelNavigation = Selector('[data-testid=sentinel-nav-group]');
27+
cloneSentinelNavigation = Selector('[data-testid=sentinel-nav-group-clone]');
2728
sentinelDatabaseNavigation = Selector('[data-testid=database-nav-group]');
29+
cloneSentinelDatabaseNavigation = Selector('[data-testid=database-nav-group-clone]');
2830
cancelButton = Selector('[data-testid=btn-cancel]');
2931
//TEXT INPUTS (also referred to as 'Text fields')
3032
hostInput = Selector('[data-testid=host]');

tests/e2e/tests/critical-path/database/clone-databases.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ test
101101
.expect(addRedisDatabasePage.primaryGroupNameInput.getAttribute('value')).eql(ossSentinelConfig.name[1], 'Invalid primary group name value');
102102
// Validate Databases section
103103
await t
104-
.click(addRedisDatabasePage.sentinelDatabaseNavigation)
104+
.click(addRedisDatabasePage.cloneSentinelDatabaseNavigation)
105105
.expect(addRedisDatabasePage.masterGroupPassword.getAttribute('value')).eql(ossSentinelConfig.masters[1].password, 'Invalid sentinel database password');
106106
// Validate Sentinel section
107107
await t
108-
.click(addRedisDatabasePage.sentinelNavigation)
108+
.click(addRedisDatabasePage.cloneSentinelNavigation)
109109
.expect(addRedisDatabasePage.portInput.getAttribute('value')).eql(ossSentinelConfig.sentinelPort, 'Invalid sentinel port')
110110
.expect(addRedisDatabasePage.passwordInput.getAttribute('value')).eql(ossSentinelConfig.sentinelPassword, 'Invalid sentinel password');
111111
// Clone Sentinel Primary Group

tests/e2e/tests/critical-path/monitor/save-commands.e2e.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ const tempDir = os.tmpdir();
1616
let downloadedFilePath = '';
1717

1818
async function getFileDownloadPath(): Promise<string> {
19-
return os.platform() == 'linux'
20-
? joinPath('home', os.hostname(), 'Downloads')
21-
: joinPath(os.homedir(), 'Downloads');
19+
return joinPath(os.homedir(), 'Downloads');
2220
}
2321

2422
async function findByFileStarts(dir: string): Promise<number> {
25-
const matchedFiles: string[] = [];
26-
const files = fs.readdirSync(dir);
27-
28-
for (const file of files) {
29-
if (file.startsWith('test_standalone')) {
30-
matchedFiles.push(file);
23+
if (fs.existsSync(dir)) {
24+
const matchedFiles: string[] = [];
25+
const files = fs.readdirSync(dir);
26+
for (const file of files) {
27+
if (file.startsWith('test_standalone')) {
28+
matchedFiles.push(file);
29+
}
3130
}
31+
return matchedFiles.length;
32+
} else {
33+
return 0;
3234
}
33-
34-
return matchedFiles.length;
3535
}
3636

3737
fixture `Save commands`
@@ -109,8 +109,7 @@ test
109109
await t.expect(monitorPage.resetProfilerButton.visible).ok('The Reset Profiler button visibility');
110110
await t.expect(monitorPage.downloadLogButton.visible).ok('The Download button visibility');
111111
});
112-
// Skipped due to testCafe issue https://github.com/DevExpress/testcafe/issues/5574
113-
test.skip
112+
test
114113
.meta({ rte: rte.standalone })('Verify that when user see the toggle is OFF - Profiler logs are not being saved', async t => {
115114
//Remember the number of files in Temp
116115
const numberOfDownloadFiles = await findByFileStarts(downloadedFilePath);

tests/e2e/tests/critical-path/notifications/notification-center.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test('Verify that when manager publishes new notification, it appears in the app
3838
await t.expect(notificationPage.notificationCategory.visible).ok('Category is not displayed in popup');
3939
if (sortedNotifications[0].category !== undefined) {
4040
await t.expect(notificationPage.notificationCategory.innerText).eql(sortedNotifications[0].category ?? '', 'Text for category is not correct');
41-
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');
41+
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');
4242
}
4343
// Verify that user can click on close button and received notification will be closed
4444
await t.click(notificationPage.closeNotificationPopup);
@@ -79,9 +79,9 @@ test('Verify that user can open notification center by clicking on icon and see
7979
await t.expect(notificationPage.notificationBody.withExactText(jsonNotifications[i].body).exists).ok('Displayed body');
8080
await t.expect(notificationPage.notificationDate.withExactText(await notificationPage.convertEpochDateToMessageDate(jsonNotifications[i])).exists).ok('Displayed date');
8181
// Verify that user can see notification with category badge and category color in the notification center
82-
if (!jsonNotifications[i].category !== undefined) {
83-
await t.expect(notificationPage.notificationCategory.withExactText(jsonNotifications[i].category ?? '').exists).ok('Displayed category name');
84-
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');
82+
if (jsonNotifications[i].category !== undefined) {
83+
await t.expect(notificationPage.notificationCategory.withExactText(jsonNotifications[i].category ?? '').exists).ok(`${jsonNotifications[i].category} category name not displayed`);
84+
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');
8585
}
8686
}
8787
// Verify that as soon as user closes notification center, unread messages become read

tests/e2e/tests/critical-path/workbench/command-results.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Chance } from 'chance';
22
import { env, rte } from '../../../helpers/constants';
33
import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
44
import { MyRedisDatabasePage, WorkbenchPage } from '../../../pageObjects';
5-
import { commonUrl, ossStandaloneRedisearch } from '../../../helpers/conf';
5+
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
66
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
77

88
const myRedisDatabasePage = new MyRedisDatabasePage();
@@ -17,15 +17,15 @@ fixture `Command results at Workbench`
1717
.meta({ type: 'critical_path', rte: rte.standalone })
1818
.page(commonUrl)
1919
.beforeEach(async t => {
20-
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
20+
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
2121
//Go to Workbench page
2222
await t.click(myRedisDatabasePage.workbenchButton);
2323
})
2424
.afterEach(async t => {
2525
//Drop index, documents and database
2626
await t.switchToMainWindow();
2727
await workbenchPage.sendCommandInWorkbench(`FT.DROPINDEX ${indexName} DD`);
28-
await deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
28+
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
2929
});
3030
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 => {
3131
//Send commands
@@ -107,7 +107,7 @@ test.skip
107107
test
108108
.after(async() => {
109109
//Drop database
110-
await deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
110+
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
111111
})('Verify that user can populate commands in Editor from history by clicking keyboard “up” button', async t => {
112112
const commands = [
113113
'FT.INFO',

tests/e2e/tests/critical-path/workbench/default-scripts-area.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test
5555
await t.expect(workbenchPage.queryColumns.textContent).contains('name', 'The result of the FT.INFO command');
5656
});
5757
test
58-
.meta({ rte: rte.standalone })('Verify that user can edit and run automatically added "Search" script in Workbench and see the results', async t => {
58+
.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 => {
5959
indexName = chance.word({ length: 5 });
6060
keyName = chance.word({ length: 5 });
6161
const commandsForSend = [

tests/e2e/tests/regression/workbench/command-results.e2e.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const commandsForIndex = [
1919
'HMSET product:1 price 20',
2020
'HMSET product:2 price 100'
2121
];
22-
23-
fixture `Command results at Workbench`
22+
// skip due to errors of FT.SEARCH issue https://redislabs.atlassian.net/browse/RI-3501
23+
fixture.skip `Command results at Workbench`
2424
.meta({type: 'regression', rte: rte.standalone })
2525
.page(commonUrl)
2626
.beforeEach(async t => {
@@ -73,7 +73,7 @@ test
7373
await t.expect(await workbenchPage.queryTableResult.exists).ok('The table view is not switched for command FT.AGGREGATE');
7474
});
7575
// skip due to inaccessibility of CLIENT LIST in plugin
76-
test.skip
76+
test
7777
.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 => {
7878
const command = 'CLIENT LIST';
7979
//Send command and check table view is default in full mode

tests/e2e/tests/regression/workbench/editor-cleanup.e2e.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ fixture `Workbench Editor Cleanup`
2727
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
2828
});
2929
test('Disabled Editor Cleanup toggle behavior', async t => {
30+
// Go to Settings page
31+
await t.click(myRedisDatabasePage.settingsButton);
32+
await t.click(settingsPage.accordionWorkbenchSettings);
33+
// Disable Editor Cleanup
34+
await t.click(settingsPage.switchEditorCleanupOption);
3035
// Go to Workbench page
3136
await t.click(myRedisDatabasePage.workbenchButton);
3237
// Send commands
@@ -36,11 +41,6 @@ test('Disabled Editor Cleanup toggle behavior', async t => {
3641
await t.expect((await workbenchPage.queryInputScriptArea.textContent).replace(/\s/g, ' ')).eql(commandToSend, 'Input in Editor is saved');
3742
});
3843
test('Enabled Editor Cleanup toggle behavior', async t => {
39-
// Go to Settings page
40-
await t.click(myRedisDatabasePage.settingsButton);
41-
await t.click(settingsPage.accordionWorkbenchSettings);
42-
// Enable Editor Cleanup
43-
await t.click(settingsPage.switchEditorCleanupOption);
4444
// Go to Workbench page
4545
await t.click(myRedisDatabasePage.workbenchButton);
4646
// Send commands
@@ -65,18 +65,18 @@ test
6565
// Go to Settings page
6666
await t.click(myRedisDatabasePage.settingsButton);
6767
await t.click(settingsPage.accordionWorkbenchSettings);
68-
// Enable Editor Cleanup
69-
await settingsPage.changeEditorCleanupSwitcher(true);
68+
// Disable Editor Cleanup
69+
await settingsPage.changeEditorCleanupSwitcher(false);
7070
await common.reloadPage();
7171
await t.click(settingsPage.accordionWorkbenchSettings);
7272
// Verify that Editor Cleanup setting is saved when refreshing the page
73-
await t.expect(await settingsPage.getEditorCleanupSwitcherValue()).eql('true', 'Editor Cleanup switcher changed');
73+
await t.expect(await settingsPage.getEditorCleanupSwitcherValue()).eql('false', 'Editor Cleanup switcher changed');
7474
// Go to another database
7575
await t.click(myRedisDatabasePage.myRedisDBButton);
7676
await myRedisDatabasePage.clickOnDBByName(databasesForAdding[1].databaseName);
7777
// Go to Settings page
7878
await t.click(myRedisDatabasePage.settingsButton);
7979
await t.click(settingsPage.accordionWorkbenchSettings);
8080
// Verify that Editor Cleanup setting is saved when switching between databases
81-
await t.expect(await settingsPage.getEditorCleanupSwitcherValue()).eql('true', 'Editor Cleanup switcher changed');
81+
await t.expect(await settingsPage.getEditorCleanupSwitcherValue()).eql('false', 'Editor Cleanup switcher changed');
8282
});

0 commit comments

Comments
 (0)