Skip to content

Commit 56e0c1a

Browse files
authored
Merge pull request #338 from RedisInsight/feature/e2e-overview
Feature/e2e-overview
2 parents eebbc0d + b7f1d2f commit 56e0c1a

File tree

7 files changed

+72
-5
lines changed

7 files changed

+72
-5
lines changed

redisinsight/ui/src/components/database-overview/components/MoreInfoPopover/MoreInfoPopover.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ const MoreInfoPopover = ({ metrics, modules }: IProps) => {
3434
iconType="boxesVertical"
3535
onClick={() => setIsShowMoreInfoPopover((isOpenPopover) => !isOpenPopover)}
3636
aria-labelledby="more info"
37+
data-testid="overview-more-info-button"
3738
/>
3839
)}
3940
>
40-
<div className="flex-row space-between">
41+
<div className="flex-row space-between" data-testid="overview-more-info-tooltip">
4142
{!!metrics.length && (
4243
<div className={styles.metricsContainer}>
43-
<h4 className={styles.mi_fieldName}>Database statistics</h4>
44+
<h4 className={styles.mi_fieldName} data-testid="overview-db-stat-title">Database statistics</h4>
4445
{metrics.map((overviewItem) => (
4546
<EuiFlexGroup
4647
className={styles.moreInfoOverviewItem}

tests/e2e/docker.web.docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ services:
1515
'./upload-custom-plugins.sh',
1616
]
1717
environment:
18-
TEST_FILES: $TEST_FILES
18+
E2E_CLOUD_DATABASE_HOST: $E2E_CLOUD_DATABASE_HOST
19+
E2E_CLOUD_DATABASE_PORT: $E2E_CLOUD_DATABASE_PORT
20+
E2E_CLOUD_DATABASE_PASSWORD: $E2E_CLOUD_DATABASE_PASSWORD
21+
E2E_CLOUD_DATABASE_USERNAME: $E2E_CLOUD_DATABASE_USERNAME
22+
E2E_CLOUD_DATABASE_NAME: $E2E_CLOUD_DATABASE_NAME
1923
command: [
2024
'./wait-for-it.sh', 'redis-enterprise:12000', '-s', '-t', '120',
2125
'--',

tests/e2e/helpers/conf.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ export const ossStandaloneBigConfig = {
6666
databasePassword: process.env.OSS_STANDALONE_BIG_PASSWORD
6767
};
6868

69+
export const cloudDatabaseConfig = {
70+
host: process.env.E2E_CLOUD_DATABASE_HOST || '',
71+
port: process.env.E2E_CLOUD_DATABASE_PORT || '',
72+
databaseName: `${process.env.E2E_CLOUD_DATABASE_NAME || 'cloud-database'}-${uniqueId}`,
73+
databaseUsername: process.env.E2E_CLOUD_DATABASE_USERNAME,
74+
databasePassword: process.env.E2E_CLOUD_DATABASE_PASSWORD
75+
};
76+
6977
export const ossStandaloneNoPermissionsConfig = {
7078
host: process.env.OSS_STANDALONE_BIG_HOST || 'oss-standalone',
7179
port: process.env.OSS_STANDALONE_BIG_PORT || '6379',

tests/e2e/local.web.docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ services:
1313
- ./.env
1414
environment:
1515
COMMON_URL: 'http://app:5000'
16-
TEST_FILES: $TEST_FILES
16+
E2E_CLOUD_DATABASE_HOST: $E2E_CLOUD_DATABASE_HOST
17+
E2E_CLOUD_DATABASE_PORT: $E2E_CLOUD_DATABASE_PORT
18+
E2E_CLOUD_DATABASE_PASSWORD: $E2E_CLOUD_DATABASE_PASSWORD
19+
E2E_CLOUD_DATABASE_USERNAME: $E2E_CLOUD_DATABASE_USERNAME
20+
E2E_CLOUD_DATABASE_NAME: $E2E_CLOUD_DATABASE_NAME
1721
entrypoint: [
1822
'./upload-custom-plugins.sh',
1923
]

tests/e2e/pageObjects/browser-page.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ export class BrowserPage {
110110
overviewCommandsSec: Selector
111111
overviewCpu: Selector
112112
modulesButton: Selector
113+
overviewMoreInfo: Selector
114+
overviewTooltip: Selector
115+
overviewTooltipStatTitle: Selector
113116
treeViewButton: Selector
114117
treeViewArea: Selector
115118
browserViewButton: Selector
@@ -187,6 +190,9 @@ export class BrowserPage {
187190
this.scanMoreButton = Selector('[data-testid=scan-more]');
188191
this.resizeBtnKeyList = Selector('[data-test-subj=resize-btn-keyList-keyDetails]');
189192
this.modulesButton = Selector('[data-testid$=_module]');
193+
this.overviewMoreInfo = Selector('[data-testid=overview-more-info-button]');
194+
this.overviewTooltip = Selector('[data-testid=overview-more-info-tooltip]');
195+
this.overviewTooltipStatTitle = Selector('[data-testid=overview-db-stat-title]');
190196
this.databaseInfoIcon = Selector('[data-testid=db-info-icon]');
191197
this.treeViewButton = Selector('');
192198
this.browserViewButton = Selector('');
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
});

tests/e2e/tests/regression/shortcuts/shortcuts.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const shortcutsPage = new ShortcutsPage();
1010
fixture `Shortcuts`
1111
.meta({ type: 'regression' })
1212
.page(commonUrl)
13-
.beforeEach(async () => {
13+
.beforeEach(async() => {
1414
await acceptLicenseTerms();
1515
})
1616
test

0 commit comments

Comments
 (0)