|
| 1 | +import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database'; |
| 2 | +import { WorkbenchPage, MyRedisDatabasePage } from '../../../pageObjects'; |
| 3 | +import { env, rte } from '../../../helpers/constants'; |
| 4 | +import { commonUrl, ossStandaloneConfig } from '../../../helpers/conf'; |
| 5 | +import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database'; |
| 6 | + |
| 7 | +const myRedisDatabasePage = new MyRedisDatabasePage(); |
| 8 | +const workbenchPage = new WorkbenchPage(); |
| 9 | + |
| 10 | +fixture `Workbench Auto-Execute button` |
| 11 | + .meta({ type: 'regression', rte: rte.standalone, env: env.web }) |
| 12 | + .page(commonUrl) |
| 13 | + .beforeEach(async t => { |
| 14 | + await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName); |
| 15 | + await t.click(myRedisDatabasePage.workbenchButton); |
| 16 | + }) |
| 17 | + .afterEach(async() => { |
| 18 | + // Clear and delete database |
| 19 | + await deleteStandaloneDatabaseApi(ossStandaloneConfig); |
| 20 | + }); |
| 21 | +// Test is skipped until Enablement area will be updated with auto-execute buttons |
| 22 | +test.skip('Verify that when user clicks on auto-execute button, command is run', async t => { |
| 23 | + const command = 'INFO'; |
| 24 | + // Verify that clicking on auto-executed button, command is not inserted to Editor |
| 25 | + await t.typeText(workbenchPage.queryInput, command); |
| 26 | + // Verify that admin can use redis-auto format in .md file for Guides for auto-executed button |
| 27 | + await t.click(workbenchPage.documentButtonInQuickGuides); |
| 28 | + await t.click(workbenchPage.internalLinkWorkingWithHashes); |
| 29 | + await t.click(workbenchPage.preselectHashCreate); |
| 30 | + await t.expect(workbenchPage.queryInput.textContent).eql(command, 'Editor is changed'); |
| 31 | + // Verify that admin can use redis-auto format in .md file for Tutorials for auto-executed button |
| 32 | + await t.click(workbenchPage.redisStackTutorialsButton); |
| 33 | + await t.click(workbenchPage.timeSeriesLink); |
| 34 | + // Verify that when user runs auto-executed commands, selected group mode setting is considered |
| 35 | + await t.click(workbenchPage.groupMode); |
| 36 | + // Verify that when user runs auto-executed commands, selected raw mode setting is considered |
| 37 | + await t.click(workbenchPage.rawModeBtn); |
| 38 | + await t.click(workbenchPage.redisStackTimeSeriesLoadMorePoints); |
| 39 | + // Verify that user can see auto-executed command result in command history |
| 40 | + const regExp = new RegExp('66[1-9] Command(s) - \d+ success, \d+ error(s)'); |
| 41 | + await t.expect(workbenchPage.queryCardCommand.textContent).match(regExp, 'Not valid summary for group mode'); |
| 42 | + await t.expect(workbenchPage.commandExecutionDateAndTime.find('span').withExactText('-r')).ok('Not valid summary for raw mode'); |
| 43 | +}); |
0 commit comments