|
| 1 | +import { t } from 'testcafe'; |
| 2 | +import { commonUrl, ossStandaloneRedisGears } from '../../../../helpers/conf'; |
| 3 | +import { DatabaseHelper } from '../../../../helpers'; |
| 4 | +import { BrowserPage, MyRedisDatabasePage } from '../../../../pageObjects'; |
| 5 | +import { ExploreTabs, RecommendationIds, RedisOverviewPage } from '../../../../helpers/constants'; |
| 6 | +import { DatabaseAPIRequests } from '../../../../helpers/api/api-database'; |
| 7 | +import { RdiInstancesListPage } from '../../../../pageObjects/rdi-instances-list-page'; |
| 8 | + |
| 9 | +const databaseHelper = new DatabaseHelper(); |
| 10 | +const myRedisDatabasePage = new MyRedisDatabasePage(); |
| 11 | +const databaseAPIRequests = new DatabaseAPIRequests(); |
| 12 | +const browserPage = new BrowserPage(); |
| 13 | +const rdiInstancesListPage = new RdiInstancesListPage(); |
| 14 | + |
| 15 | +const rdiRecommendation = RecommendationIds.rdi; |
| 16 | + |
| 17 | +//skip the tests until rdi integration is added |
| 18 | +fixture.skip `Rdi recommendation` |
| 19 | + .meta({ type: 'critical_path', feature: 'rdi' }) |
| 20 | + .page(commonUrl) |
| 21 | + .beforeEach(async() => { |
| 22 | + await databaseHelper.acceptLicenseTerms(); |
| 23 | + await myRedisDatabasePage.setActivePage(RedisOverviewPage.DataBase); |
| 24 | + await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisGears); |
| 25 | + }) |
| 26 | + .afterEach(async() => { |
| 27 | + await databaseAPIRequests.deleteAllDatabasesApi(); |
| 28 | + }); |
| 29 | +// it doesn't work until recommendation.json is not updated |
| 30 | +test('Verify that rdi recommendation is displayed for oss cluster', async() => { |
| 31 | + await browserPage.InsightsPanel.togglePanel(true); |
| 32 | + const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); |
| 33 | + await t.expect(tab.getRecommendationByName(rdiRecommendation).exists).ok('Redis Version recommendation not displayed'); |
| 34 | + await tab.clickOnNavigationButton(rdiRecommendation); |
| 35 | + |
| 36 | + await t.expect(rdiInstancesListPage.rdiInstanceButton.exists).ok('Navigation for recommendation is not correct'); |
| 37 | +}); |
0 commit comments