|
1 | 1 | import { acceptLicenseTermsAndAddDatabaseApi, acceptLicenseTerms } from '../../../helpers/database';
|
2 |
| -import { MyRedisDatabasePage, PubSubPage } from '../../../pageObjects'; |
| 2 | +import { MyRedisDatabasePage, PubSubPage, WorkbenchPage } from '../../../pageObjects'; |
3 | 3 | import { commonUrl, ossStandaloneConfig, ossStandaloneV5Config } from '../../../helpers/conf';
|
4 | 4 | import { env, rte } from '../../../helpers/constants';
|
5 | 5 | import { verifyMessageDisplayingInPubSub } from '../../../helpers/pub-sub';
|
6 | 6 | import { addNewStandaloneDatabaseApi, deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database';
|
7 | 7 |
|
8 | 8 | const myRedisDatabasePage = new MyRedisDatabasePage();
|
9 | 9 | const pubSubPage = new PubSubPage();
|
| 10 | +const workbenchPage = new WorkbenchPage(); |
10 | 11 |
|
11 | 12 | fixture `Subscribe/Unsubscribe from a channel`
|
12 | 13 | .meta({ env: env.web, rte: rte.standalone, type: 'critical_path' })
|
|
90 | 91 | await verifyMessageDisplayingInPubSub('message', false);
|
91 | 92 | await t.expect(pubSubPage.totalMessagesCount.exists).notOk('Total counter is still displayed');
|
92 | 93 | });
|
93 |
| -test('Verify that user can see a internal link to pubsub window under word “Pub/Sub” when he try to run PSUBSCRIBE command in CLI or Workbench', async t => { |
| 94 | +test('Verify that user can see a internal link to pubsub window under word “Pub/Sub” when he tries to run PSUBSCRIBE or SUBSCRIBE commands in CLI or Workbench', async t => { |
| 95 | + const commandFirst = 'PSUBSCRIBE'; |
| 96 | + const commandSecond = 'SUBSCRIBE'; |
| 97 | + |
94 | 98 | // Go to Browser Page
|
95 | 99 | await t.click(myRedisDatabasePage.NavigationPanel.browserButton);
|
96 |
| - // Verify that user can see a custom message when he try to run PSUBSCRIBE command in CLI or Workbench: “Use Pub/Sub to see the messages published to all channels in your database” |
97 |
| - await pubSubPage.Cli.sendCommandInCli('PSUBSCRIBE'); |
| 100 | + // Verify that user can see a custom message when he tries to run PSUBSCRIBE command in CLI or Workbench: “Use Pub/Sub to see the messages published to all channels in your database” |
| 101 | + await pubSubPage.Cli.sendCommandInCli(commandFirst); |
98 | 102 | await t.click(pubSubPage.Cli.cliExpandButton);
|
99 |
| - await t.expect(pubSubPage.Cli.cliWarningMessage.textContent).eql('Use Pub/Sub to see the messages published to all channels in your database.', 'Message is not displayed', { timeout: 10000 }); |
| 103 | + await t.expect(await pubSubPage.Cli.getWarningMessageText(commandFirst)).eql('Use Pub/Sub to see the messages published to all channels in your database.', 'Message is not displayed', { timeout: 10000 }); |
| 104 | + |
100 | 105 | // Verify internal link to pubsub page in CLI
|
101 | 106 | await t.expect(pubSubPage.Cli.cliLinkToPubSub.exists).ok('Link to pubsub page is not displayed');
|
102 | 107 | await t.click(pubSubPage.Cli.cliLinkToPubSub);
|
103 | 108 | await t.expect(pubSubPage.pubSubPageContainer.exists).ok('Pubsub page is opened');
|
| 109 | + |
| 110 | + // Verify that user can see a custom message when he tries to run SUBSCRIBE command in CLI: “Use Pub/Sub tool to subscribe to channels.” |
| 111 | + await t.click(pubSubPage.Cli.cliCollapseButton); |
| 112 | + await pubSubPage.Cli.sendCommandInCli(commandSecond); |
| 113 | + await t.click(pubSubPage.Cli.cliExpandButton); |
| 114 | + await t.expect(await pubSubPage.Cli.getWarningMessageText(commandSecond)).eql('Use Pub/Sub tool to subscribe to channels.', 'Message is not displayed', { timeout: 10000 }); |
| 115 | + |
| 116 | + // Verify internal link to pubsub page in CLI |
| 117 | + await t.expect(pubSubPage.Cli.cliLinkToPubSub.exists).ok('Link to pubsub page is not displayed'); |
| 118 | + await t.click(pubSubPage.Cli.cliLinkToPubSub); |
| 119 | + await t.expect(pubSubPage.pubSubPageContainer.exists).ok('Pubsub page is opened'); |
| 120 | + |
| 121 | + // Verify that user can see a custom message when he tries to run SUBSCRIBE command in Workbench: “Use Pub/Sub tool to subscribe to channels.” |
| 122 | + await t.click(pubSubPage.NavigationPanel.workbenchButton); |
| 123 | + await workbenchPage.sendCommandInWorkbench(commandSecond); |
| 124 | + await t.expect(await workbenchPage.commandExecutionResult.textContent).eql('Use Pub/Sub tool to subscribe to channels.', 'Message is not displayed', { timeout: 10000 }); |
| 125 | + |
104 | 126 | });
|
105 | 127 | test('Verify that the Message field input is preserved until user Publish a message', async t => {
|
106 | 128 | // Fill in Channel and Message inputs
|
|
0 commit comments