|
| 1 | +import { t } from 'testcafe'; |
| 2 | +import { rte } from '../../../helpers/constants'; |
| 3 | +import {acceptLicenseTerms, deleteDatabase} from '../../../helpers/database'; |
| 4 | +import { BrowserPage, AddRedisDatabasePage, MyRedisDatabasePage } from '../../../pageObjects'; |
| 5 | +import { commonUrl, cloudDatabaseConfig } from '../../../helpers/conf'; |
| 6 | + |
| 7 | +const browserPage = new BrowserPage(); |
| 8 | +const addRedisDatabasePage = new AddRedisDatabasePage(); |
| 9 | +const myRedisDatabasePage = new MyRedisDatabasePage(); |
| 10 | + |
| 11 | +fixture `Overview` |
| 12 | + .meta({ type: 'regression' }) |
| 13 | + .page(commonUrl) |
| 14 | + .beforeEach(async() => { |
| 15 | + await acceptLicenseTerms(); |
| 16 | + await addRedisDatabasePage.addRedisDataBase(cloudDatabaseConfig); |
| 17 | + //Click for saving |
| 18 | + await t.click(addRedisDatabasePage.addRedisDatabaseButton); |
| 19 | + //Increase timeout to add Cloud DB (due to RI-1993 issue) |
| 20 | + await t.wait(5000); |
| 21 | + //Refresh the page |
| 22 | + await t.eval(() => location.reload(true)); |
| 23 | + //Wait for database to be exist |
| 24 | + await t.expect(myRedisDatabasePage.dbNameList.withExactText(cloudDatabaseConfig.databaseName).exists).ok('The existence of the database', { timeout: 5000 }); |
| 25 | + await myRedisDatabasePage.clickOnDBByName(cloudDatabaseConfig.databaseName); |
| 26 | + }) |
| 27 | + .afterEach(async() => { |
| 28 | + //Delete database |
| 29 | + await deleteDatabase(cloudDatabaseConfig.databaseName); |
| 30 | + }) |
| 31 | +test |
| 32 | + .meta({ rte: rte.standalone }) |
| 33 | + ('Verify that user can see not available metrics from Overview in tooltip with the text "<Metric_name> is/are not available"', async t => { |
| 34 | + //Verify that CPU parameter is not displayed in Overview |
| 35 | + await t.expect(browserPage.overviewCpu.visible).notOk('Not available CPU'); |
| 36 | + //Click on More Info icon |
| 37 | + await t.click(browserPage.overviewMoreInfo); |
| 38 | + //Check that tooltip was opened |
| 39 | + await t.expect(browserPage.overviewTooltip.visible).ok('Overview tooltip'); |
| 40 | + //Verify that Database statistics title is displayed in tooltip |
| 41 | + await t.expect(browserPage.overviewTooltipStatTitle.visible).ok('Statistics title'); |
| 42 | + //Verify that CPU parameter is displayed in tooltip |
| 43 | + await t.expect(browserPage.overviewCpu.find('i').textContent).eql('CPU is not available'); |
| 44 | + }); |
0 commit comments