Skip to content

Commit a1fa3a6

Browse files
Merge pull request #2796 from RedisInsight/e2e/bugfix/remove_multiple_window_comments
E2e/bugfix/remove multiple window comments
2 parents eff999f + fe6ad91 commit a1fa3a6

22 files changed

+248
-212
lines changed

tests/e2e/desktop.runner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import testcafe from 'testcafe';
3939
assertionTimeout: 5000,
4040
speed: 1,
4141
quarantineMode: { successThreshold: 1, attemptLimit: 3 },
42+
disableMultipleWindows: true
4243
});
4344
})
4445
.then((failedCount) => {

tests/e2e/desktop.runner.win.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import testcafe from 'testcafe';
3939
assertionTimeout: 5000,
4040
speed: 1,
4141
quarantineMode: { successThreshold: 1, attemptLimit: 3 },
42+
disableMultipleWindows: true
4243
});
4344
})
4445
.then((failedCount) => {

tests/e2e/helpers/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ClientFunction } from 'testcafe';
2+
3+
export const goBackHistory = ClientFunction(() => window.history.back());

tests/e2e/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build:web": "yarn --cwd ../../ build:web",
1414
"redis:last": "docker run --name redis-last-version -p 7777:6379 -d redislabs/redismod",
1515
"start:app": "cross-env SERVER_STATIC_CONTENT=true yarn start:api",
16-
"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",
16+
"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",
1717
"test:chrome:ci": "ts-node ./web.runner.ts",
1818
"test": "yarn test:chrome",
1919
"lint": "eslint . --ext .ts,.js,.tsx,.jsx",
@@ -30,9 +30,7 @@
3030
"@types/lodash": "4.14.192",
3131
"@types/node": "20.3.1",
3232
"word-wrap": "1.2.4",
33-
"**/semver": "^7.5.2",
34-
"testcafe-hammerhead": "31.4.5",
35-
"testcafe-hammerhead/tough-cookie": "^4.1.3"
33+
"**/semver": "^7.5.2"
3634
},
3735
"devDependencies": {
3836
"@types/archiver": "^5.3.2",
@@ -56,11 +54,11 @@
5654
"redis": "3.1.1",
5755
"sqlite3": "^5.1.6",
5856
"supertest": "^4.0.2",
59-
"testcafe": "3.0.0",
57+
"testcafe": "3.3.0",
6058
"testcafe-browser-provider-electron": "0.0.19",
6159
"testcafe-reporter-html": "1.4.6",
6260
"testcafe-reporter-json": "2.2.0",
63-
"testcafe-reporter-spec": "2.1.1",
61+
"testcafe-reporter-spec": "2.2.0",
6462
"ts-node": "10.9.1",
6563
"typescript": "5.1.3"
6664
}

tests/e2e/tests/electron/critical-path/browser/bulk-upload.e2e.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ test('Verify bulk upload of different text docs formats', async t => {
6161

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

tests/e2e/tests/electron/critical-path/database/add-ssh-db.e2e.ts

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { DatabaseHelper } from '../../../../helpers/database';
55
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
66
import { sshPrivateKey, sshPrivateKeyWithPasscode } from '../../../../test-data/sshPrivateKeys';
77
import { Common } from '../../../../helpers/common';
8-
// import { BrowserActions } from '../../../common-actions/browser-actions';
8+
import { BrowserActions } from '../../../../common-actions/browser-actions';
99

1010
const myRedisDatabasePage = new MyRedisDatabasePage();
1111
const browserPage = new BrowserPage();
1212
const databaseHelper = new DatabaseHelper();
1313
const databaseAPIRequests = new DatabaseAPIRequests();
14-
// const browserActions = new BrowserActions();
14+
const browserActions = new BrowserActions();
1515

1616
const sshParams = {
1717
sshHost: '172.31.100.245',
@@ -43,6 +43,12 @@ fixture `Adding database with SSH`
4343
await databaseAPIRequests.deleteStandaloneDatabasesByNamesApi([sshDbPass.databaseName, sshDbPrivateKey.databaseName, sshDbPasscode.databaseName, newClonedDatabaseAlias]);
4444
});
4545
test('Adding database with SSH', async t => {
46+
const tooltipText = [
47+
'Enter a value for required fields (3):',
48+
'SSH Host',
49+
'SSH Username',
50+
'SSH Private Key'
51+
];
4652
const hiddenPass = '••••••••••••';
4753
const sshWithPass = {
4854
...sshParams,
@@ -57,25 +63,24 @@ test('Adding database with SSH', async t => {
5763
sshPrivateKey: sshPrivateKeyWithPasscode,
5864
sshPassphrase: 'test'
5965
};
60-
// update after resolving testcafe Native Automation mode limitations
61-
// // 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
62-
// await t
63-
// .click(myRedisDatabasePage.AddRedisDatabase.addDatabaseButton)
64-
// .click(myRedisDatabasePage.AddRedisDatabase.addDatabaseManually)
65-
// .click(myRedisDatabasePage.AddRedisDatabase.useSSHCheckbox)
66-
// .click(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyRadioBtn)
67-
// .hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
68-
// for (const text of tooltipText) {
69-
// await browserActions.verifyTooltipContainsText(text, true);
70-
// }
71-
// // Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
72-
// await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
73-
// for (const text of tooltipText) {
74-
// await browserActions.verifyTooltipContainsText(text, true);
75-
// }
66+
// 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
67+
await t
68+
.click(myRedisDatabasePage.AddRedisDatabase.addDatabaseButton)
69+
.click(myRedisDatabasePage.AddRedisDatabase.addDatabaseManually)
70+
.click(myRedisDatabasePage.AddRedisDatabase.useSSHCheckbox)
71+
.click(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyRadioBtn)
72+
.hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
73+
for (const text of tooltipText) {
74+
await browserActions.verifyTooltipContainsText(text, true);
75+
}
76+
// Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
77+
await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
78+
for (const text of tooltipText) {
79+
await browserActions.verifyTooltipContainsText(text, true);
80+
}
7681

7782
// Verify that user can add SSH tunnel with Password for Standalone database
78-
// await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
83+
await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
7984
await myRedisDatabasePage.AddRedisDatabase.addStandaloneSSHDatabase(sshDbPass, sshWithPass);
8085
await myRedisDatabasePage.clickOnDBByName(sshDbPass.databaseName);
8186
await Common.checkURLContainsText('browser');

tests/e2e/tests/web/critical-path/browser/bulk-upload.e2e.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ test('Verify bulk upload of different text docs formats', async t => {
6161

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

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
1212
import { Common } from '../../../../helpers/common';
1313
import { verifyKeysDisplayingInTheList } from '../../../../helpers/keys';
1414
import { APIKeyRequests } from '../../../../helpers/api/api-keys';
15+
import { goBackHistory } from '../../../../helpers/utils';
1516

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

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

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

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

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

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

197195
// Verify that user can create an index with multiple prefixes
196+
await t.click(browserPage.selectIndexDdn);
197+
await t.click(browserPage.createIndexBtn);
198198
await t.click(browserPage.indexNameInput);
199199
await t.typeText(browserPage.indexNameInput, indexName);
200200
await t.click(browserPage.prefixFieldInput);

tests/e2e/tests/web/critical-path/cli/cli-command-helper.e2e.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ test('Verify that user can type TS. in Command helper and see commands from Redi
9090
await browserPage.CommandHelper.selectFilterGroupType(COMMAND_GROUP_TIMESERIES);
9191
// Search per part of command and check all opened commands
9292
await browserPage.CommandHelper.checkSearchedCommandInCommandHelper(commandForSearch, timeSeriesCommands);
93-
// update after resolving testcafe Native Automation mode limitations
94-
// // Check the first command documentation url
95-
// await browserPage.CommandHelper.checkURLCommand(timeSeriesCommands[0], `https://redis.io/commands/${timeSeriesCommands[0].toLowerCase()}/`);
96-
// await t.switchToParentWindow();
93+
// Check the first command documentation url
94+
await browserPage.CommandHelper.checkURLCommand(timeSeriesCommands[0], `https://redis.io/commands/${timeSeriesCommands[0].toLowerCase()}/`);
9795
});
9896
// outdated after https://redislabs.atlassian.net/browse/RI-4608
9997
test.skip('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {

tests/e2e/tests/web/critical-path/database/connecting-to-the-db.e2e.ts

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { DatabaseHelper } from '../../../../helpers/database';
55
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
66
import { sshPrivateKey, sshPrivateKeyWithPasscode } from '../../../../test-data/sshPrivateKeys';
77
import { Common } from '../../../../helpers/common';
8-
// import { BrowserActions } from '../../../common-actions/browser-actions';
8+
import { BrowserActions } from '../../../../common-actions/browser-actions';
99

1010
const myRedisDatabasePage = new MyRedisDatabasePage();
1111
const browserPage = new BrowserPage();
1212
const databaseHelper = new DatabaseHelper();
1313
const databaseAPIRequests = new DatabaseAPIRequests();
1414
const welcomePage = new WelcomePage();
15-
// const browserActions = new BrowserActions();
15+
const browserActions = new BrowserActions();
1616

1717
const sshParams = {
1818
sshHost: '172.31.100.245',
@@ -90,12 +90,12 @@ test
9090
await databaseAPIRequests.deleteStandaloneDatabasesByNamesApi([sshDbPass.databaseName, sshDbPrivateKey.databaseName, sshDbPasscode.databaseName, newClonedDatabaseAlias]);
9191
})('Adding database with SSH', async t => {
9292
const hiddenPass = '••••••••••••';
93-
// const tooltipText = [
94-
// 'Enter a value for required fields (3):',
95-
// 'SSH Host',
96-
// 'SSH Username',
97-
// 'SSH Private Key'
98-
// ];
93+
const tooltipText = [
94+
'Enter a value for required fields (3):',
95+
'SSH Host',
96+
'SSH Username',
97+
'SSH Private Key'
98+
];
9999
const sshWithPass = {
100100
...sshParams,
101101
sshPassword: 'pass'
@@ -109,25 +109,24 @@ test
109109
sshPrivateKey: sshPrivateKeyWithPasscode,
110110
sshPassphrase: 'test'
111111
};
112-
// update after resolving testcafe Native Automation mode limitations
113-
// // 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
114-
// await t
115-
// .click(myRedisDatabasePage.AddRedisDatabase.addDatabaseButton)
116-
// .click(myRedisDatabasePage.AddRedisDatabase.addDatabaseManually)
117-
// .click(myRedisDatabasePage.AddRedisDatabase.useSSHCheckbox)
118-
// .click(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyRadioBtn)
119-
// .hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
120-
// for (const text of tooltipText) {
121-
// await browserActions.verifyTooltipContainsText(text, true);
122-
// }
123-
// // Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
124-
// await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
125-
// for (const text of tooltipText) {
126-
// await browserActions.verifyTooltipContainsText(text, true);
127-
// }
112+
// 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
113+
await t
114+
.click(myRedisDatabasePage.AddRedisDatabase.addDatabaseButton)
115+
.click(myRedisDatabasePage.AddRedisDatabase.addDatabaseManually)
116+
.click(myRedisDatabasePage.AddRedisDatabase.useSSHCheckbox)
117+
.click(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyRadioBtn)
118+
.hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
119+
for (const text of tooltipText) {
120+
await browserActions.verifyTooltipContainsText(text, true);
121+
}
122+
// Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
123+
await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
124+
for (const text of tooltipText) {
125+
await browserActions.verifyTooltipContainsText(text, true);
126+
}
128127

129128
// Verify that user can add SSH tunnel with Password for Standalone database
130-
// await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
129+
await t.click(myRedisDatabasePage.AddRedisDatabase.cancelButton);
131130
await myRedisDatabasePage.AddRedisDatabase.addStandaloneSSHDatabase(sshDbPass, sshWithPass);
132131
await myRedisDatabasePage.clickOnDBByName(sshDbPass.databaseName);
133132
await Common.checkURLContainsText('browser');

0 commit comments

Comments
 (0)