Skip to content

Commit 2abbe95

Browse files
Merge branch 'feature/RI-4943_rework-tutorials' into fe/feature/RI-4950_tutorials-home-page
# Conflicts: # tests/e2e/tests/web/regression/workbench/default-scripts-area.e2e.ts
2 parents 1723f44 + f10d6d4 commit 2abbe95

File tree

5 files changed

+45
-20
lines changed

5 files changed

+45
-20
lines changed

redisinsight/ui/src/components/database-side-panels/panels/enablement-area/EnablementArea/components/CodeButtonBlock/CodeButtonBlock.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPopover, EuiSpacer, EuiTitle } from '@elastic/eui'
1+
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPopover, EuiSpacer, EuiTitle, EuiToolTip } from '@elastic/eui'
22
import cx from 'classnames'
33
import React, { useEffect, useState } from 'react'
44
import { monaco } from 'react-monaco-editor'
@@ -30,7 +30,7 @@ export interface Props {
3030
params?: CodeButtonParams
3131
}
3232

33-
const FINISHED_COMMAND_INDICATOR_TIME_MS = 3_000
33+
const FINISHED_COMMAND_INDICATOR_TIME_MS = 5_000
3434

3535
const CodeButtonBlock = (props: Props) => {
3636
const {
@@ -148,20 +148,25 @@ const CodeButtonBlock = (props: Props) => {
148148
scrollLock: true
149149
}}
150150
button={(
151-
<EuiButton
152-
onClick={handleRunClicked}
153-
iconType={isRunned ? 'check' : 'play'}
154-
iconSide="right"
155-
color="success"
156-
size="s"
157-
disabled={isLoading || isRunned}
158-
isLoading={isLoading}
159-
className={cx(styles.actionBtn, styles.runBtn)}
160-
{...rest}
161-
data-testid={`run-btn-${label}`}
151+
<EuiToolTip
152+
content={isPopoverOpen ? undefined : 'Open Workbench in the left menu to see the command results.'}
153+
data-testid="run-btn-open-workbench-tooltip"
162154
>
163-
Run
164-
</EuiButton>
155+
<EuiButton
156+
onClick={handleRunClicked}
157+
iconType={isRunned ? 'check' : 'play'}
158+
iconSide="right"
159+
color="success"
160+
size="s"
161+
disabled={isLoading || isRunned}
162+
isLoading={isLoading}
163+
className={cx(styles.actionBtn, styles.runBtn)}
164+
{...rest}
165+
data-testid={`run-btn-${label}`}
166+
>
167+
Run
168+
</EuiButton>
169+
</EuiToolTip>
165170
)}
166171
>
167172
{getPopoverMessage()}

redisinsight/ui/src/components/database-side-panels/panels/enablement-area/EnablementArea/components/InternalPage/InternalPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const InternalPage = (props: Props) => {
205205
{!!pagination?.length && (
206206
<>
207207
<div className={styles.footer}>
208-
<Pagination sourcePath={sourcePath} items={pagination} activePageKey={activeKey} />
208+
<Pagination sourcePath={sourcePath} items={pagination} activePageKey={activeKey} compressed />
209209
</div>
210210
</>
211211
)}

redisinsight/ui/src/components/database-side-panels/panels/enablement-area/EnablementArea/components/Pagination/styles.module.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
}
1414

1515
.paginationCompressed {
16-
padding: 8px 6px;
16+
padding: 8px 16px;
1717
& > div:first-of-type, & > div:last-of-type {
1818
min-width: 70px;
1919
}
20+
21+
:global(.euiButtonContent .euiIcon) {
22+
width: 14px;
23+
height: 14px;
24+
}
2025
}
2126

2227
.panel {

tests/e2e/pageObjects/components/explore-tab.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export class ExploreTab {
7575
* get run selector
7676
* @param block Name of the block
7777
*/
78-
async getRunSelector(block: string): Promise<Selector> {
79-
return Selector(this.runMask.replace(/\$name/g, block));
78+
getRunSelector(block: string): Selector {
79+
return Selector(this.runMask.replace(/\$name/g, block));
8080
}
8181

8282
/**

tests/e2e/tests/web/regression/workbench/default-scripts-area.e2e.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { ExploreTabs, rte } from '../../../../helpers/constants';
22
import { DatabaseHelper } from '../../../../helpers/database';
3-
import { MyRedisDatabasePage, WorkbenchPage } from '../../../../pageObjects';
3+
import { BrowserPage, MyRedisDatabasePage, WorkbenchPage } from '../../../../pageObjects';
44
import { commonUrl, ossStandaloneConfig } from '../../../../helpers/conf';
55
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
66

77
const myRedisDatabasePage = new MyRedisDatabasePage();
88
const workbenchPage = new WorkbenchPage();
99
const databaseHelper = new DatabaseHelper();
1010
const databaseAPIRequests = new DatabaseAPIRequests();
11+
const browserPage = new BrowserPage();
1112

1213
fixture `Default scripts area at Workbench`
1314
.meta({ type: 'regression', rte: rte.standalone })
@@ -42,16 +43,30 @@ test('Verify that user can see the [Manual] option in the Enablement area', asyn
4243
}
4344
});
4445
test('Verify that user can see saved article in Enablement area when he leaves Workbench page and goes back again', async t => {
46+
const tooltipText = 'Open Workbench in the left menu to see the command results.';
4547
await workbenchPage.InsightsPanel.togglePanel(true);
4648
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
4749
await t.click(tutorials.dataStructureAccordionTutorialButton);
4850
await t.expect(tutorials.internalLinkWorkingWithHashes.visible).ok('The working with hashes link is not visible', { timeout: 5000 });
4951
// Open Working with Hashes section
5052
await t.click(tutorials.internalLinkWorkingWithHashes);
53+
let selector = tutorials.getRunSelector('Create');
54+
55+
// https://redislabs.atlassian.net/browse/RI-5340
56+
// Verify that user can see “Open Workbench in the left menu to see the command results.” tooltip when hovering over Run button
57+
await t.hover(selector);
58+
await t.expect(browserPage.tooltip.textContent).eql(tooltipText, 'Tooltip is not displayed or text is invalid');
59+
5160
// Check the button from Hash page is visible
5261
await tutorials.runBlockCode('Create a hash');
5362
let selector = await tutorials.getRunSelector('Create a hash');
5463
await t.expect(selector.visible).ok('The end of the page is not visible');
64+
65+
// Verify that user can see the “success” icon during 5 s after a command has been run and button can't be clicked at that time
66+
await t.expect(selector.withAttribute('disabled').exists).ok('Run button is not disabled', { timeout: 5000 });
67+
await t.wait(5000);
68+
await t.expect(selector.withAttribute('disabled').exists).notOk('Run button is still disabled');
69+
5570
// Go to Browser page
5671
await t.click(myRedisDatabasePage.NavigationPanel.browserButton);
5772
// Go back to Workbench page

0 commit comments

Comments
 (0)