Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/e2e/pageObjects/browser-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ export class BrowserPage {
/**
* Adding a new ZSet key
* @param keyName The name of the key
* @param scores The score of the key member
* @param TTL The Time to live value of the key
* @param members The key members
* @param scores The score of the key member
*/
async addZSetKey(keyName: string, scores = ' ', TTL = ' ', members = ' '): Promise<void> {
await common.waitForElementNotVisible(this.progressLine);
Expand Down
11 changes: 11 additions & 0 deletions tests/e2e/pageObjects/memory-efficiency-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class MemoryEfficiencyPage {
cssCodeChangesLabel = '[data-testid=code_changes]';
cssConfigurationChangesLabel = '[data-testid=configuration_changes]';
cssReadMoreLink = '[data-testid=read-more-link]';
cssToTutorialsBtn = '[data-testid=RTS-to-tutorial-btn]';
// BUTTONS
newReportBtn = Selector('[data-testid=start-database-analysis-btn]');
expandArrowBtn = Selector('[data-testid^=expand-arrow-]');
Expand Down Expand Up @@ -69,4 +70,14 @@ export class MemoryEfficiencyPage {
usefulVoteBtn = Selector('[data-testid=useful-vote-btn]').nth(0);
notUsefulVoteBtn = Selector('[data-testid=not-useful-vote-btn]').nth(0);
recommendationsFeedbackBtn = Selector('[data-testid=recommendation-feedback-btn]');
toTutorialsBtn = Selector('[data-testid=RTS-to-tutorial-btn]');
rtsAccordeon = Selector('[data-testid=RTS-accordion]');

/**
* Find recommendation selector by name
* @param name A recommendation name
*/
async getRecommendationByName(name: string): Promise<Selector> {
return Selector('div').withExactText(name).parent('[data-testid=RTS-accordion]').parent();
}
}
13 changes: 10 additions & 3 deletions tests/e2e/pageObjects/workbench-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,24 +232,31 @@ export class WorkbenchPage {
await t.expect(actualCommandResult).contains(result, 'Actual command result is not equal to executed');
}
/**
* get selector with tutorial name
* Get selector with tutorial name
* @param tutorialName name of the uploaded tutorial
*/
async getAccordionButtonWithName(tutorialName: string): Promise<Selector> {
return Selector(`[data-testid=accordion-button-${tutorialName}]`);
}
/**
* get internal tutorial link with .md name
* Get internal tutorial link with .md name
* @param internalLink name of the .md file
*/
async getInternalLinkWithManifest(internalLink: string): Promise<Selector> {
return Selector(`[data-testid="internal-link-${internalLink}.md"]`);
}
/**
* get internal tutorial link without .md name
* Get internal tutorial link without .md name
* @param internalLink name of the label
*/
async getInternalLinkWithoutManifest(internalLink: string): Promise<Selector> {
return Selector(`[data-testid="internal-link-${internalLink}"]`);
}
/**
* Find tutorial selector by name
* @param name A tutorial name
*/
async getTutorialByName(name: string): Promise<Selector> {
return Selector('div').withText(name);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MyRedisDatabasePage, MemoryEfficiencyPage, BrowserPage, CliPage, AddRedisDatabasePage } from '../../../pageObjects';
import { Selector } from 'testcafe';
import { MyRedisDatabasePage, MemoryEfficiencyPage, BrowserPage, CliPage, AddRedisDatabasePage, WorkbenchPage } from '../../../pageObjects';
import { rte } from '../../../helpers/constants';
import { acceptLicenseTermsAndAddDatabaseApi, deleteCustomDatabase } from '../../../helpers/database';
import { commonUrl, ossStandaloneBigConfig, ossStandaloneConfig } from '../../../helpers/conf';
Expand All @@ -15,6 +16,7 @@ const browserPage = new BrowserPage();
const cliPage = new CliPage();
const addRedisDatabasePage = new AddRedisDatabasePage();
const memoryEfficiencyActions = new MemoryEfficiencyActions();
const workbenchPage = new WorkbenchPage();

const externalPageLink = 'https://docs.redis.com/latest/ri/memory-optimizations/';
let keyName = `recomKey-${common.generateWord(10)}`;
Expand Down Expand Up @@ -80,7 +82,7 @@ test
// Close the window with external link to switch to the application window
await t.closeWindow();
});
// skipped due to inability to receive no recommendations for now
// skipped due to inability to receive no recommendations for now
test.skip('No recommendations message', async t => {
keyName = `recomKey-${common.generateWord(10)}`;
const noRecommendationsMessage = 'No recommendations at the moment, run a new report later to keep up the good work!';
Expand Down Expand Up @@ -146,3 +148,31 @@ test
// Verify that user can see the popup with link when he votes for “Not useful”
await t.expect(memoryEfficiencyPage.recommendationsFeedbackBtn.visible).ok('popup did not appear after voting for not useful');
});
test
.before(async t => {
await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName);
keyName = `recomKey-${common.generateWord(10)}`;
await browserPage.addZSetKey(keyName, '151153320500121', '2147476121', '1511533205001:21');
// Go to Analysis Tools page
await t.click(myRedisDatabasePage.analysisPageButton);
await t.click(memoryEfficiencyPage.newReportBtn);
// Go to Recommendations tab
await t.click(memoryEfficiencyPage.recommendationsTab);
})
.after(async t => {
// Clear and delete database
await t.click(myRedisDatabasePage.browserButton);
await browserPage.deleteKeyByName(keyName);
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
})('Verify that user can see the Tutorial opened when clicking on "To Tutorial" for recommendations', async t => {
const optimizeTsRecommendation = await memoryEfficiencyPage.getRecommendationByName('Optimize the use of time series');
const toTutorialBtn = optimizeTsRecommendation.find(memoryEfficiencyPage.cssToTutorialsBtn);

// Verify that Optimize the use of time series recommendation displayed
await t.expect(optimizeTsRecommendation.exists).ok('Optimize the use of time series recommendation not displayed');
// Verify that tutorial opened
await t.click(toTutorialBtn);
await t.expect(workbenchPage.preselectArea.visible).ok('Workbench Enablement area not opened');
// Verify that REDIS FOR TIME SERIES tutorial expanded
await t.expect((await workbenchPage.getTutorialByName('REDIS FOR TIME SERIES')).visible).ok('REDIS FOR TIME SERIES tutorial is not expanded');
});