|
| 1 | +import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database'; |
| 2 | +import { rte } from '../../../helpers/constants'; |
| 3 | +import { |
| 4 | + commonUrl, |
| 5 | + ossStandaloneConfig |
| 6 | +} from '../../../helpers/conf'; |
| 7 | +import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database'; |
| 8 | +import {MemoryEfficiencyPage, MyRedisDatabasePage} from '../../../pageObjects'; |
| 9 | +import {RecommendationsPage} from '../../../pageObjects/recommendations-page'; |
| 10 | +import {Common} from '../../../helpers/common'; |
| 11 | + |
| 12 | +const myRedisDatabasePage = new MyRedisDatabasePage(); |
| 13 | +const memoryEfficiencyPage = new MemoryEfficiencyPage(); |
| 14 | +const recommendationPage = new RecommendationsPage(); |
| 15 | +const common = new Common(); |
| 16 | + |
| 17 | +fixture `Upvote recommendations` |
| 18 | + .meta({ type: 'critical_path', rte: rte.standalone }) |
| 19 | + .page(commonUrl) |
| 20 | + .beforeEach(async t => { |
| 21 | + await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName); |
| 22 | + // Go to Analysis Tools page and create new report and open recommendations |
| 23 | + await t.click(myRedisDatabasePage.analysisPageButton); |
| 24 | + await t.click(memoryEfficiencyPage.newReportBtn); |
| 25 | + await t.click(memoryEfficiencyPage.recommendationsTab); |
| 26 | + }) |
| 27 | + .afterEach(async() => { |
| 28 | + await deleteStandaloneDatabaseApi(ossStandaloneConfig); |
| 29 | + }); |
| 30 | +test.only('Verify that user can upvote recommendations', async t => { |
| 31 | + await recommendationPage.voteForVeryUsefulAndVerifyDisabled(); |
| 32 | + // Verify that user can see previous votes when reload the page |
| 33 | + await common.reloadPage(); |
| 34 | + await t.click(memoryEfficiencyPage.recommendationsTab); |
| 35 | + await recommendationPage.verifyVoteDisabled(); |
| 36 | + |
| 37 | + await t.click(memoryEfficiencyPage.newReportBtn); |
| 38 | + await recommendationPage.voteForUsefulAndVerifyDisabled(); |
| 39 | + |
| 40 | + await t.click(memoryEfficiencyPage.newReportBtn); |
| 41 | + await recommendationPage.voteForNotUsefulAndVerifyDisabled(); |
| 42 | + // Verify that user can see the popup with link when he votes for “Not useful” |
| 43 | + await t.expect(recommendationPage.recommendationsFeedbackBtn.visible).ok(); |
| 44 | +}); |
0 commit comments