Skip to content

Commit caa6d32

Browse files
authored
Merge pull request #2222 from RedisInsight/e2e/bugfix/RI-4505-node-18-tests
E2e/bugfix/ri 4505 node 18 tests
2 parents e3189bc + 23daec0 commit caa6d32

File tree

7 files changed

+133
-130
lines changed

7 files changed

+133
-130
lines changed

tests/e2e/package.json

Lines changed: 6 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 --native-automation --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 --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",
@@ -28,8 +28,8 @@
2828
},
2929
"resolutions": {
3030
"@types/lodash": "4.14.192",
31-
"@types/node": "18.11.9",
32-
"testcafe-hammerhead": "24.2.1"
31+
"@types/node": "20.3.1",
32+
"testcafe-hammerhead": "31.4.5"
3333
},
3434
"devDependencies": {
3535
"@types/archiver": "^5.3.2",
@@ -53,12 +53,12 @@
5353
"redis": "3.1.1",
5454
"sqlite3": "^5.1.6",
5555
"supertest": "^4.0.2",
56-
"testcafe": "2.6.2",
56+
"testcafe": "3.0.0",
5757
"testcafe-browser-provider-electron": "0.0.19",
5858
"testcafe-reporter-html": "1.4.6",
5959
"testcafe-reporter-json": "2.2.0",
6060
"testcafe-reporter-spec": "2.1.1",
61-
"ts-node": "^10.5.0",
62-
"typescript": "4.1.5"
61+
"ts-node": "10.9.1",
62+
"typescript": "5.1.3"
6363
}
6464
}

tests/e2e/pageObjects/browser-page.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ export class BrowserPage extends InstancePage {
343343
* @param members The key members
344344
*/
345345
async addSetKey(keyName: string, TTL = ' ', members = ' '): Promise<void> {
346+
if (await this.Toast.toastCloseButton.exists) {
347+
await t.click(this.Toast.toastCloseButton);
348+
}
346349
await Common.waitForElementNotVisible(this.progressLine);
347350
await Common.waitForElementNotVisible(this.loader);
348351
await t.click(this.plusAddKeyButton);
@@ -407,6 +410,9 @@ export class BrowserPage extends InstancePage {
407410
* @param value The value of the key
408411
*/
409412
async addHashKey(keyName: string, TTL = ' ', field = ' ', value = ' '): Promise<void> {
413+
if (await this.Toast.toastCloseButton.exists) {
414+
await t.click(this.Toast.toastCloseButton);
415+
}
410416
await Common.waitForElementNotVisible(this.progressLine);
411417
await Common.waitForElementNotVisible(this.loader);
412418
await t.click(this.plusAddKeyButton);

tests/e2e/pageObjects/components/browser/bulk-actions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export class BulkActions {
4141
* Open Bulk Actions and confirm deletion
4242
*/
4343
async startBulkDelete(): Promise<void> {
44-
// Wait for Bulk actions animation ends
45-
await t.wait(1000);
4644
await t
4745
.click(this.actionButton)
4846
.click(this.bulkApplyButton);

tests/e2e/tests/critical-path/browser/bulk-delete.e2e.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ const keyToAddParameters2 = { keysCount: 500000, keyNameStartWith: 'hashKey' };
1717
fixture `Bulk Delete`
1818
.meta({ type: 'critical_path', rte: rte.standalone })
1919
.page(commonUrl)
20-
.beforeEach(async() => {
20+
.beforeEach(async t => {
2121
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
2222
await browserPage.addHashKey(keyNames[0], '100000', Common.generateWord(20), Common.generateWord(20));
2323
await browserPage.addSetKey(keyNames[1], '100000', Common.generateWord(20));
24+
if (await browserPage.Toast.toastCloseButton.exists) {
25+
await t.click(browserPage.Toast.toastCloseButton);
26+
}
2427
})
2528
.afterEach(async() => {
2629
// Clear and delete database
@@ -131,9 +134,12 @@ test('Verify that when bulk deletion is completed, status Action completed is di
131134
await t.expect(browserPage.BulkActions.bulkDeleteSummary.innerText).contains('Scanned 100% (2/2) and found 1 keys', 'Bulk delete summary is not correct');
132135
});
133136
test
134-
.before(async() => {
137+
.before(async t => {
135138
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch, ossStandaloneRedisearch.databaseName);
136139
await browserPage.addSetKey(keyNames[1], '100000', Common.generateWord(20));
140+
if (await browserPage.Toast.toastCloseButton.exists) {
141+
await t.click(browserPage.Toast.toastCloseButton);
142+
}
137143
// Add 10000 Hash keys
138144
await populateDBWithHashes(dbParameters.host, dbParameters.port, keyToAddParameters);
139145
// Filter by Hash keys

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,17 @@ test
148148
.after(async() => {
149149
await deleteStandaloneDatabaseApi(ossStandaloneV5Config);
150150
})('No RediSearch module message', async t => {
151-
152-
// TODO: check
153151
const noRedisearchMessage = 'Looks like RediSearch is not available for this database';
154-
const externalPageLink = 'https://redis.com/try-free/?utm_source=redisinsight&utm_medium=app&utm_campaign=redisinsight_browser_search';
152+
// const externalPageLink = 'https://redis.com/try-free/?utm_source=redisinsight&utm_medium=app&utm_campaign=redisinsight_browser_search';
155153

156154
await t.click(browserPage.redisearchModeBtn);
157155
// Verify that user can see message in the dialog when he doesn't have RediSearch module
158156
await t.expect(browserPage.noReadySearchDialogTitle.textContent).contains(noRedisearchMessage, 'Invalid text in no redisearch popover');
159157
// update after resolving testcafe Native Automation mode limitations
160158
// // Verify that user can navigate by link to create a Redis db
161-
await t.click(browserPage.redisearchFreeLink);
162-
await Common.checkURL(externalPageLink);
163-
await t.switchToParentWindow();
159+
// await t.click(browserPage.redisearchFreeLink);
160+
// await Common.checkURL(externalPageLink);
161+
// await t.switchToParentWindow();
164162
});
165163
test
166164
.before(async() => {
@@ -170,7 +168,7 @@ test
170168
await browserPage.Cli.sendCommandInCli(`FT.DROPINDEX ${indexName}`);
171169
await deleteStandaloneDatabaseApi(ossStandaloneBigConfig);
172170
})('Index creation', async t => {
173-
const createIndexLink = 'https://redis.io/commands/ft.create/';
171+
// const createIndexLink = 'https://redis.io/commands/ft.create/';
174172

175173
// Verify that user can cancel index creation
176174
await t.click(browserPage.redisearchModeBtn);

tests/e2e/web.runner.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ import testcafe from 'testcafe';
4242
assertionTimeout: 5000,
4343
speed: 1,
4444
quarantineMode: { successThreshold: 1, attemptLimit: 3 },
45-
pageRequestTimeout: 8000,
46-
nativeAutomation: true,
45+
pageRequestTimeout: 8000
4746
});
4847
})
4948
.then((failedCount) => {

0 commit comments

Comments
 (0)