Skip to content

Commit fb83fe2

Browse files
author
Alena Naboka
committed
[E2E] pub/sub oss cluster tests added
1 parent f50aa1b commit fb83fe2

File tree

3 files changed

+70
-9
lines changed

3 files changed

+70
-9
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: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ export class UserAgreementPage {
1313
submitButton = Selector('[data-testid=btn-submit]');
1414
switchOptionEula = Selector('[data-testid=switch-option-eula]');
1515
switchOptionEncryption = Selector('[data-testid=switch-option-encryption]');
16-
pluginSectionWithText = Selector('[data-testid=plugin-section]')
16+
pluginSectionWithText = Selector('[data-testid=plugin-section]');
1717

18-
//Accept RedisInsight License Terms
19-
async acceptLicenseTerms():Promise<void> {
20-
if (await this.switchOptionEula.exists) {
21-
await t.click(this.switchOptionEula);
22-
await t.click(this.switchOptionEncryption);
23-
await t.click(this.submitButton);
24-
}
25-
}
18+
//Accept RedisInsight License Terms
19+
async acceptLicenseTerms(): Promise<void> {
20+
if (await this.switchOptionEula.exists) {
21+
await t.click(this.switchOptionEula);
22+
await t.click(this.switchOptionEncryption);
23+
await t.click(this.submitButton);
24+
}
25+
}
2626
}
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 } 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({ 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)