|
| 1 | +import { Selector } from 'testcafe'; |
| 2 | +import { addNewStandaloneDatabase } from '../../../helpers/database'; |
| 3 | +import { MyRedisDatabasePage, UserAgreementPage, AddRedisDatabasePage, WorkbenchPage } from '../../../pageObjects'; |
| 4 | +import { |
| 5 | + commonUrl, |
| 6 | + ossStandaloneConfig |
| 7 | +} from '../../../helpers/conf'; |
| 8 | + |
| 9 | +const myRedisDatabasePage = new MyRedisDatabasePage(); |
| 10 | +const userAgreementPage = new UserAgreementPage(); |
| 11 | +const addRedisDatabasePage = new AddRedisDatabasePage(); |
| 12 | +const workbenchPage = new WorkbenchPage(); |
| 13 | + |
| 14 | +fixture `Empty command history in Workbench` |
| 15 | + .meta({type: 'regression'}) |
| 16 | + .page(commonUrl) |
| 17 | + .beforeEach(async t => { |
| 18 | + await t.maximizeWindow(); |
| 19 | + await userAgreementPage.acceptLicenseTerms(); |
| 20 | + await t.expect(addRedisDatabasePage.addDatabaseButton.exists).ok('The add redis database view', {timeout: 20000}); |
| 21 | + await addNewStandaloneDatabase(ossStandaloneConfig); |
| 22 | + //Connect to DB |
| 23 | + await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName); |
| 24 | + //Go to Workbench page |
| 25 | + await t.click(myRedisDatabasePage.workbenchButton); |
| 26 | + }) |
| 27 | +test('Verify that user can see placeholder text in Workbench history if no commands have not been run yet', async t => { |
| 28 | + //Verify that all the elements from empty command history placeholder are displayed |
| 29 | + await t.expect(workbenchPage.noCommandHistorySection.visible).ok('No command history section is visible') |
| 30 | + await t.expect(workbenchPage.noCommandHistoryIcon.visible).ok('No command history icon is visible') |
| 31 | + await t.expect(workbenchPage.noCommandHistoryTitle.visible).ok('No command history title is visible') |
| 32 | + await t.expect(workbenchPage.noCommandHistoryText.visible).ok('No command history text is visible') |
| 33 | + //Run a command |
| 34 | + const commandToSend = 'info server'; |
| 35 | + await workbenchPage.sendCommandInWorkbench(commandToSend); |
| 36 | + //Verify that empty command history placeholder is not displayed |
| 37 | + await t.expect(workbenchPage.noCommandHistorySection.visible).notOk('No command history section is not visible') |
| 38 | + //Delete the command result |
| 39 | + await t.click(Selector(workbenchPage.cssDeleteCommandButton)); |
| 40 | + //Verify that empty command history placeholder is displayed |
| 41 | + await t.expect(workbenchPage.noCommandHistorySection.visible).ok('No command history section is visible') |
| 42 | +}); |
0 commit comments