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
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const InternalPage = (props: Props) => {
</EuiButtonEmpty>
)}
>
<div>
<div data-testid="explore-capability-popover">
<RocketIcon className={styles.rocketIcon} />
<EuiText className={styles.popoverTitle}>Explore Redis</EuiText>
<EuiText className={styles.popoverText}>
Expand Down
20 changes: 19 additions & 1 deletion tests/e2e/helpers/api/api-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ export class DatabaseAPIRequests {
* @param databaseParameters The database parameters
*/
async addNewStandaloneDatabaseApi(
databaseParameters: AddNewDatabaseParameters
databaseParameters: AddNewDatabaseParameters, isCloud = false
): Promise<void> {
const uniqueId = chance.string({ length: 10 });
const uniqueIdNumber = chance.integer({ min: 1, max: 1000 });
const requestBody: {
name?: string,
host: string,
Expand All @@ -42,6 +43,13 @@ export class DatabaseAPIRequests {
name: string,
certificate?: string,
key?: string
},
cloudDetails?: {
cloudId: number,
subscriptionType: string,
planMemoryLimit: number,
memoryLimitMeasurementUnit: string,
free: boolean
}
} = {
name: databaseParameters.databaseName,
Expand All @@ -64,6 +72,16 @@ export class DatabaseAPIRequests {
key: databaseParameters.clientCert!.key
};
}

if(isCloud) {
requestBody.cloudDetails = {
cloudId: uniqueIdNumber,
subscriptionType: 'fixed',
planMemoryLimit: 30,
memoryLimitMeasurementUnit: 'mb',
free: true
};
}
const response = await sendPostRequest(
ResourcePath.Databases,
requestBody
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/pageObjects/browser-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ export class BrowserPage extends InstancePage {
keyListItem = Selector('[role=rowgroup] [role=row]');
// Dialog
noReadySearchDialogTitle = Selector('[data-testid=welcome-page-title]');
closeDialogButton = Selector('[class*=euiModal__closeIcon]');

/**
* Common part for Add any new key
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/pageObjects/components/insights-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export class InsightsPanel {
recommendationsTab = Selector('[data-testid=recommendations-tab]');
exploreTab = Selector('[data-testid=explore-tab]');

existsCompatibilityPopover = Selector('[data-testid=explore-capability-popover]');

/**
* Open/Close Panel
* @param state State of panel
Expand Down
43 changes: 41 additions & 2 deletions tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { BrowserPage, WorkbenchPage } from '../../../../pageObjects';
import { BrowserPage, MyRedisDatabasePage, WorkbenchPage } from '../../../../pageObjects';
import { ExploreTabs, rte } from '../../../../helpers/constants';
import { DatabaseHelper } from '../../../../helpers/database';
import { commonUrl, ossStandaloneConfig } from '../../../../helpers/conf';
import {
commonUrl,
ossStandaloneConfig,
ossStandaloneV5Config
} from '../../../../helpers/conf';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';

const browserPage = new BrowserPage();
const workbenchPage = new WorkbenchPage();
const myRedisDatabasePage = new MyRedisDatabasePage();

const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();
Expand All @@ -30,3 +35,37 @@ test('Verify Explore redis tab is opened from empty screens', async t => {
await t.click(workbenchPage.exploreRedisBtn);
await t.expect(await browserPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Explore);
});
test
.before(async t => {
await databaseHelper.acceptLicenseTerms();
await databaseAPIRequests.deleteAllDatabasesApi();
await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneV5Config);
await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneConfig, true);
await browserPage.reloadPage();

await myRedisDatabasePage.clickOnDBByName(ossStandaloneV5Config.databaseName);

})
.after(async() => {
await databaseAPIRequests.deleteAllDatabasesApi();
})('Verify that insights panel is opened in cloud db if users db does not have some module', async t => {
await t.click(browserPage.redisearchModeBtn);
await t.click(browserPage.closeDialogButton);
await t.click(browserPage.NavigationPanel.myRedisDBButton);
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('the panel is opened');
await t.expect(await browserPage.InsightsPanel.existsCompatibilityPopover.textContent).contains('Search and Query capability', 'popover is not displayed');
const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
await t.expect(tab.preselectArea.textContent).contains('VECTOR SIMILARITY SEARCH', 'the tutorial is incorrect');

await t.click(browserPage.NavigationPanel.myRedisDBButton);
await myRedisDatabasePage.clickOnDBByName(ossStandaloneV5Config.databaseName);
await t.click(browserPage.NavigationPanel.workbenchButton);
await workbenchPage.sendCommandInWorkbench('TS.');

await t.click(browserPage.NavigationPanel.myRedisDBButton);
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('the panel is opened');
await t.expect(await browserPage.InsightsPanel.existsCompatibilityPopover.textContent).contains('time series', 'popover is not displayed');
await t.expect(tab.preselectArea.textContent).contains('REDIS FOR TIME SERIES', 'the tutorial is incorrect');
});