Skip to content

Commit 23eb87f

Browse files
authored
Merge pull request #934 from RedisInsight/e2e/oss-cluster-7
[E2E] pub/sub oss cluster tests added
2 parents 805d4a7 + 9ee4003 commit 23eb87f

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

tests/e2e/pageObjects/pub-sub-page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class PubSubPage {
1616
pubSubPageContainer = Selector('[data-testid=pub-sub-page]');
1717
clientBadge = Selector('[data-testid=affected-clients-badge]');
1818
clearButtonTooltip = Selector('.euiToolTipPopover');
19+
ossClusterEmptyMessage = Selector('[data-testid=empty-messages-list-cluster]');
1920
//BUTTONS
2021
subscribeButton = Selector('[data-testid=subscribe-btn]').withText('Subscribe');
2122
unsubscribeButton = Selector('[data-testid=subscribe-btn]').withText('Unsubscribe');

tests/e2e/pageObjects/user-agreement-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class UserAgreementPage {
1515
switchOptionEncryption = Selector('[data-testid=switch-option-encryption]');
1616
pluginSectionWithText = Selector('[data-testid=plugin-section]');
1717
recommendedSwitcher = Selector('[data-testid=switch-option-recommended]');
18-
18+
1919
//Accept RedisInsight License Terms
2020
async acceptLicenseTerms(): Promise<void> {
2121
if (await this.switchOptionEula.exists) {
@@ -24,7 +24,7 @@ export class UserAgreementPage {
2424
await t.click(this.submitButton);
2525
}
2626
}
27-
27+
2828
/**
2929
* Get state of Recommended switcher
3030
*/
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import {
2+
acceptLicenseTerms
3+
} from '../../../helpers/database';
4+
import { MyRedisDatabasePage, PubSubPage, CliPage } from '../../../pageObjects';
5+
import { commonUrl, ossStandaloneConfig, ossClusterConfig } from '../../../helpers/conf';
6+
import { rte, env } from '../../../helpers/constants';
7+
import { verifyMessageDisplayingInPubSub } from '../../../helpers/pub-sub';
8+
import {
9+
addNewOSSClusterDatabaseApi, addNewStandaloneDatabaseApi,
10+
deleteOSSClusterDatabaseApi, deleteStandaloneDatabaseApi
11+
} from '../../../helpers/api/api-database';
12+
13+
const myRedisDatabasePage = new MyRedisDatabasePage();
14+
const pubSubPage = new PubSubPage();
15+
const cliPage = new CliPage();
16+
17+
fixture `PubSub OSS Cluster 7 tests`
18+
.meta({ env: env.web, type: 'regression' })
19+
.page(commonUrl);
20+
21+
test
22+
.before(async t => {
23+
await acceptLicenseTerms();
24+
await addNewOSSClusterDatabaseApi(ossClusterConfig);
25+
await t.eval(() => location.reload());
26+
await myRedisDatabasePage.clickOnDBByName(ossClusterConfig.ossClusterDatabaseName);
27+
await t.click(myRedisDatabasePage.pubSubButton);
28+
})
29+
.after(async() => {
30+
await deleteOSSClusterDatabaseApi(ossClusterConfig);
31+
})
32+
.meta({ rte: rte.ossCluster })('Verify that SPUBLISH message is displayed for OSS Cluster 7 database', async t => {
33+
await t.expect(pubSubPage.ossClusterEmptyMessage.exists).ok('SPUBLISH message');
34+
// Verify that user can see published messages for OSS Cluster 7
35+
await t.click(pubSubPage.subscribeButton);
36+
//Publish different messages
37+
await cliPage.sendCommandInCli('50 publish channel oss_cluster_message');
38+
await verifyMessageDisplayingInPubSub('oss_cluster_message', true);
39+
// Verify that SPUBLISHED messages are not displayed for OSS Cluster 7
40+
await cliPage.sendCommandInCli('10 spublish channel oss_cluster_message_spublish');
41+
await verifyMessageDisplayingInPubSub('oss_cluster_message_spublish', false);
42+
});
43+
test
44+
.before(async t => {
45+
await acceptLicenseTerms();
46+
await addNewStandaloneDatabaseApi(ossStandaloneConfig);
47+
await t.eval(() => location.reload());
48+
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
49+
await t.click(myRedisDatabasePage.pubSubButton);
50+
})
51+
.after(async() => {
52+
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
53+
})
54+
.meta({ rte: rte.standalone })('Verify that SPUBLISH message is not displayed for other databases expect OSS Cluster 7', async t => {
55+
await t.expect(pubSubPage.ossClusterEmptyMessage.exists).notOk('No SPUBLISH message');
56+
// Verify that user can't see published messages for Standalone DB
57+
await t.click(pubSubPage.subscribeButton);
58+
await cliPage.sendCommandInCli('10 spublish channel oss_cluster_message_spublish');
59+
await verifyMessageDisplayingInPubSub('oss_cluster_message_spublish', false);
60+
});

0 commit comments

Comments
 (0)