Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/e2e/pageObjects/pub-sub-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class PubSubPage {
pubSubPageContainer = Selector('[data-testid=pub-sub-page]');
clientBadge = Selector('[data-testid=affected-clients-badge]');
clearButtonTooltip = Selector('.euiToolTipPopover');
ossClusterEmptyMessage = Selector('[data-testid=empty-messages-list-cluster]');
//BUTTONS
subscribeButton = Selector('[data-testid=subscribe-btn]').withText('Subscribe');
unsubscribeButton = Selector('[data-testid=subscribe-btn]').withText('Unsubscribe');
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/pageObjects/user-agreement-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class UserAgreementPage {
switchOptionEncryption = Selector('[data-testid=switch-option-encryption]');
pluginSectionWithText = Selector('[data-testid=plugin-section]');
recommendedSwitcher = Selector('[data-testid=switch-option-recommended]');

//Accept RedisInsight License Terms
async acceptLicenseTerms(): Promise<void> {
if (await this.switchOptionEula.exists) {
Expand All @@ -24,7 +24,7 @@ export class UserAgreementPage {
await t.click(this.submitButton);
}
}

/**
* Get state of Recommended switcher
*/
Expand Down
60 changes: 60 additions & 0 deletions tests/e2e/tests/regression/pub-sub/pub-sub-oss-cluster-7.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import {
acceptLicenseTerms
} from '../../../helpers/database';
import { MyRedisDatabasePage, PubSubPage, CliPage } from '../../../pageObjects';
import { commonUrl, ossStandaloneConfig, ossClusterConfig } from '../../../helpers/conf';
import { rte, env } from '../../../helpers/constants';
import { verifyMessageDisplayingInPubSub } from '../../../helpers/pub-sub';
import {
addNewOSSClusterDatabaseApi, addNewStandaloneDatabaseApi,
deleteOSSClusterDatabaseApi, deleteStandaloneDatabaseApi
} from '../../../helpers/api/api-database';

const myRedisDatabasePage = new MyRedisDatabasePage();
const pubSubPage = new PubSubPage();
const cliPage = new CliPage();

fixture `PubSub OSS Cluster 7 tests`
.meta({ env: env.web, type: 'regression' })
.page(commonUrl);

test
.before(async t => {
await acceptLicenseTerms();
await addNewOSSClusterDatabaseApi(ossClusterConfig);
await t.eval(() => location.reload());
await myRedisDatabasePage.clickOnDBByName(ossClusterConfig.ossClusterDatabaseName);
await t.click(myRedisDatabasePage.pubSubButton);
})
.after(async() => {
await deleteOSSClusterDatabaseApi(ossClusterConfig);
})
.meta({ rte: rte.ossCluster })('Verify that SPUBLISH message is displayed for OSS Cluster 7 database', async t => {
await t.expect(pubSubPage.ossClusterEmptyMessage.exists).ok('SPUBLISH message');
// Verify that user can see published messages for OSS Cluster 7
await t.click(pubSubPage.subscribeButton);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this button is not clickable on desktop application via testcafe emulator
so for now it would be better to add "env: env.web" in .meta for all tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

//Publish different messages
await cliPage.sendCommandInCli('50 publish channel oss_cluster_message');
await verifyMessageDisplayingInPubSub('oss_cluster_message', true);
// Verify that SPUBLISHED messages are not displayed for OSS Cluster 7
await cliPage.sendCommandInCli('10 spublish channel oss_cluster_message_spublish');
await verifyMessageDisplayingInPubSub('oss_cluster_message_spublish', false);
});
test
.before(async t => {
await acceptLicenseTerms();
await addNewStandaloneDatabaseApi(ossStandaloneConfig);
await t.eval(() => location.reload());
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
await t.click(myRedisDatabasePage.pubSubButton);
})
.after(async() => {
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
})
.meta({ rte: rte.standalone })('Verify that SPUBLISH message is not displayed for other databases expect OSS Cluster 7', async t => {
await t.expect(pubSubPage.ossClusterEmptyMessage.exists).notOk('No SPUBLISH message');
// Verify that user can't see published messages for Standalone DB
await t.click(pubSubPage.subscribeButton);
await cliPage.sendCommandInCli('10 spublish channel oss_cluster_message_spublish');
await verifyMessageDisplayingInPubSub('oss_cluster_message_spublish', false);
});