Skip to content

Commit cc1e0be

Browse files
authored
Merge pull request #926 from RedisInsight/e2e/fix-for-tests
updates for e2e tests
2 parents 847ff5a + af9b373 commit cc1e0be

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

tests/e2e/helpers/api/api-database.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as request from 'supertest';
33
import { asyncFilter, doAsyncStuff } from '../async-helper';
44
import { AddNewDatabaseParameters, OSSClusterParameters, databaseParameters } from '../../pageObjects/add-redis-database-page';
55
import { apiUrl } from '../../helpers/conf';
6-
import { parseAsync } from '@babel/core';
76

87
const endpoint = apiUrl;
98
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // lgtm[js/disabling-certificate-validation]

tests/e2e/tests/critical-path/pub-sub/subscribe-unsubscribe.e2e.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { acceptLicenseTermsAndAddDatabase, deleteDatabase, addNewStandaloneDatabase } from '../../../helpers/database';
1+
import { acceptLicenseTermsAndAddDatabaseApi, acceptLicenseTerms } from '../../../helpers/database';
22
import { MyRedisDatabasePage, PubSubPage, CliPage } from '../../../pageObjects';
33
import { commonUrl, ossStandaloneConfig, ossStandaloneV5Config } from '../../../helpers/conf';
44
import { env, rte } from '../../../helpers/constants';
55
import { verifyMessageDisplayingInPubSub } from '../../../helpers/pub-sub';
6+
import { addNewStandaloneDatabaseApi, deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
67

78
const myRedisDatabasePage = new MyRedisDatabasePage();
89
const pubSubPage = new PubSubPage();
@@ -12,12 +13,12 @@ fixture `Subscribe/Unsubscribe from a channel`
1213
.meta({ env: env.web, rte: rte.standalone, type: 'critical_path' })
1314
.page(commonUrl)
1415
.beforeEach(async t => {
15-
await acceptLicenseTermsAndAddDatabase(ossStandaloneConfig, ossStandaloneConfig.databaseName);
16+
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
1617
//Go to PubSub page
1718
await t.click(myRedisDatabasePage.pubSubButton);
1819
})
1920
.afterEach(async() => {
20-
await deleteDatabase(ossStandaloneConfig.databaseName);
21+
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
2122
});
2223
test('Verify that user is unsubscribed from the pubsub channel when he go to the pubsub window after launching application for the first time', async t => {
2324
//Verify that the Channel field placeholder is 'Enter Channel Name'
@@ -61,16 +62,17 @@ test('Verify that the focus gets always shifted to a newest message (auto-scroll
6162
});
6263
test
6364
.before(async t => {
64-
await acceptLicenseTermsAndAddDatabase(ossStandaloneV5Config, ossStandaloneV5Config.databaseName);
65-
await t.click(myRedisDatabasePage.myRedisDBButton);
66-
await addNewStandaloneDatabase(ossStandaloneConfig);
65+
await acceptLicenseTerms();
66+
await addNewStandaloneDatabaseApi(ossStandaloneV5Config);
67+
await addNewStandaloneDatabaseApi(ossStandaloneConfig);
68+
await t.eval(() => location.reload());
6769
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
6870
//Go to PubSub page
6971
await t.click(myRedisDatabasePage.pubSubButton);
7072
})
7173
.after(async() => {
72-
await deleteDatabase(ossStandaloneV5Config.databaseName);
73-
await deleteDatabase(ossStandaloneConfig.databaseName);
74+
await deleteStandaloneDatabaseApi(ossStandaloneV5Config);
75+
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
7476
})('Verify that user subscription state is changed to unsubscribed, all the messages are cleared and total message counter is reset when user connect to another database', async t => {
7577
await t.click(pubSubPage.subscribeButton);
7678
//Publish 10 messages

tests/e2e/tests/regression/browser/database-overview-keys.e2e.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Chance } from 'chance';
2-
import { ClientFunction, t } from 'testcafe';
2+
import { t } from 'testcafe';
33
import { acceptLicenseTerms, acceptLicenseTermsAndAddDatabase, deleteDatabase } from '../../../helpers/database';
44
import {
55
MyRedisDatabasePage,
@@ -11,6 +11,7 @@ import {
1111
import { rte } from '../../../helpers/constants';
1212
import { cloudDatabaseConfig, commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
1313
import { Common } from '../../../helpers/common';
14+
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
1415

1516
const myRedisDatabasePage = new MyRedisDatabasePage();
1617
const workbenchPage = new WorkbenchPage();
@@ -51,7 +52,7 @@ fixture `Database overview`
5152
await deleteDatabase(`${ossStandaloneConfig.databaseName} [${index}]`);
5253
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
5354
await browserPage.deleteKeyByName(keyName);
54-
await deleteDatabase(ossStandaloneConfig.databaseName);
55+
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
5556
});
5657
test('Verify that user can see total and current logical database number of keys (if there are any keys in other logical DBs)', async t => {
5758
//Wait for Total Keys number refreshed

tests/e2e/tests/regression/pub-sub/debug-mode.e2e.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { acceptLicenseTermsAndAddDatabase, deleteDatabase } from '../../../helpers/database';
1+
import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
22
import { MyRedisDatabasePage, PubSubPage, CliPage } from '../../../pageObjects';
33
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
44
import { env, rte } from '../../../helpers/constants';
55
import { verifyMessageDisplayingInPubSub } from '../../../helpers/pub-sub';
6+
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
67

78
const myRedisDatabasePage = new MyRedisDatabasePage();
89
const pubSubPage = new PubSubPage();
@@ -12,7 +13,7 @@ fixture `PubSub debug mode`
1213
.meta({ env: env.web, rte: rte.standalone, type: 'regression' })
1314
.page(commonUrl)
1415
.beforeEach(async t => {
15-
await acceptLicenseTermsAndAddDatabase(ossStandaloneConfig, ossStandaloneConfig.databaseName);
16+
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
1617
//Go to PubSub page and subscribe to channel
1718
await t.click(myRedisDatabasePage.pubSubButton);
1819
await t.click(pubSubPage.subscribeButton);
@@ -22,7 +23,7 @@ fixture `PubSub debug mode`
2223
await cliPage.sendCommandInCli('10 publish channel third');
2324
})
2425
.afterEach(async() => {
25-
await deleteDatabase(ossStandaloneConfig.databaseName);
26+
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
2627
});
2728

2829
test('Verify that when user navigating away and back to pubsub window the debug mode state will be reset to default auto-scroll', async t => {

tests/e2e/tests/regression/workbench/workbench-pipeline.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { ClientFunction } from 'testcafe';
22
import { env, rte } from '../../../helpers/constants';
3-
import { acceptLicenseTermsAndAddDatabase } from '../../../helpers/database';
3+
import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database';
44
import { MyRedisDatabasePage, SettingsPage, WorkbenchPage } from '../../../pageObjects';
55
import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf';
6-
import { deleteStandaloneDatabase } from '../../../helpers/api/api-database';
6+
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
77

88
const myRedisDatabasePage = new MyRedisDatabasePage();
99
const workbenchPage = new WorkbenchPage();
@@ -18,14 +18,14 @@ fixture `Workbench Pipeline`
1818
.meta({ type: 'regression' })
1919
.page(commonUrl)
2020
.beforeEach(async t => {
21-
await acceptLicenseTermsAndAddDatabase(ossStandaloneConfig, ossStandaloneConfig.databaseName);
21+
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
2222
// Go to Settings page - Pipeline mode
2323
await t.click(myRedisDatabasePage.settingsButton);
2424
await t.click(settingsPage.accordionAdvancedSettings);
2525
})
2626
.afterEach(async() => {
2727
//Delete database
28-
await deleteStandaloneDatabase(ossStandaloneConfig);
28+
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
2929
});
3030
test
3131
.meta({ env: env.web, rte: rte.standalone })('Verify that user can see the text in settings for pipeline with link', async t => {

0 commit comments

Comments
 (0)