|
| 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