diff --git a/redisinsight/ui/src/components/database-side-panels/DatabaseSidePanels.test.tsx b/redisinsight/ui/src/components/database-side-panels/DatabaseSidePanels.test.tsx index 5bbdb03057..864f29e7f1 100644 --- a/redisinsight/ui/src/components/database-side-panels/DatabaseSidePanels.test.tsx +++ b/redisinsight/ui/src/components/database-side-panels/DatabaseSidePanels.test.tsx @@ -112,7 +112,7 @@ describe('DatabaseSidePanels', () => { (insightsPanelSelector as jest.Mock).mockReturnValue({ isOpen: true, - tabSelected: 'recommendations' + tabSelected: 'tips' }) render() @@ -138,7 +138,7 @@ describe('DatabaseSidePanels', () => { it('should render recommendations count with totalUnread > 0', () => { (insightsPanelSelector as jest.Mock).mockReturnValue({ isOpen: true, - tabSelected: 'recommendations' + tabSelected: 'tips' }); (recommendationsSelector as jest.Mock).mockImplementationOnce(() => ({ @@ -161,7 +161,7 @@ describe('DatabaseSidePanels', () => { (insightsPanelSelector as jest.Mock).mockReturnValue({ isOpen: true, - tabSelected: 'recommendations' + tabSelected: 'tips' }) render() @@ -174,7 +174,7 @@ describe('DatabaseSidePanels', () => { databaseId: 'instanceId', provider: 'RE_CLOUD', page: '/triggered-functions/libraries', - tab: 'recommendations' + tab: 'tips' }, }); @@ -189,7 +189,7 @@ describe('DatabaseSidePanels', () => { (insightsPanelSelector as jest.Mock).mockReturnValue({ isOpen: true, - tabSelected: 'recommendations' + tabSelected: 'tips' }) render() @@ -200,7 +200,7 @@ describe('DatabaseSidePanels', () => { event: TelemetryEvent.INSIGHTS_PANEL_TAB_CHANGED, eventData: { databaseId: 'instanceId', - prevTab: 'recommendations', + prevTab: 'tips', currentTab: 'explore', }, }); diff --git a/redisinsight/ui/src/components/database-side-panels/DatabaseSidePanels.tsx b/redisinsight/ui/src/components/database-side-panels/DatabaseSidePanels.tsx index 99de2c9993..48cdc20a64 100644 --- a/redisinsight/ui/src/components/database-side-panels/DatabaseSidePanels.tsx +++ b/redisinsight/ui/src/components/database-side-panels/DatabaseSidePanels.tsx @@ -143,7 +143,7 @@ const DatabaseSidePanels = (props: Props) => { anchorWrapperClassName={styles.onboardingAnchorWrapper} fullSize > - Explore Redis + Explore { data-testid="recommendations-tab" > <> - Redis Tips + Tips {!!totalUnread && (
{ expect(pushMock).toHaveBeenCalledWith(Pages.databaseAnalysis('instanceId')) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED, eventData: { databaseId: 'instanceId', total: 1, @@ -151,7 +151,7 @@ describe('LiveTimeRecommendations', () => { fireEvent.click(queryByTestId('checkbox-show-hidden')!) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_SHOW_HIDDEN, + event: TelemetryEvent.INSIGHTS_TIPS_SHOW_HIDDEN, eventData: { databaseId: 'instanceId', list: RECOMMENDATIONS_DATA_MOCK.recommendations?.map(({ name }) => diff --git a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/LiveTimeRecommendations.tsx b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/LiveTimeRecommendations.tsx index 42514e1196..54dbb78a69 100644 --- a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/LiveTimeRecommendations.tsx +++ b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/LiveTimeRecommendations.tsx @@ -69,7 +69,7 @@ const LiveTimeRecommendations = () => { dispatch(createNewAnalysis(instanceId, delimiter)) history.push(Pages.databaseAnalysis(instanceId)) sendEventTelemetry({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED, eventData: { databaseId: instanceId, total: recommendations?.length, @@ -83,7 +83,7 @@ const LiveTimeRecommendations = () => { dispatch(setRecommendationsShowHidden(value)) sendEventTelemetry({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_SHOW_HIDDEN, + event: TelemetryEvent.INSIGHTS_TIPS_SHOW_HIDDEN, eventData: { action: !value ? 'hide' : 'show', ...getTelemetryData(recommendations) @@ -129,19 +129,19 @@ const LiveTimeRecommendations = () => { {!!recommendations.length && (
- Our Recommendations + Our Tips - Recommendations will help you improve your database. + Tips will help you improve your database.
- New recommendations appear while you work with your database, + New tips appear while you work with your database, including how to improve performance and optimize memory usage.
- Eager for more recommendations? Run Database Analysis to get started. + Eager for more tips? Run Database Analysis to get started. )} > @@ -220,7 +220,7 @@ const LiveTimeRecommendations = () => { Database Analysis - {' to get more recommendations'} + {' to get more tips'}
diff --git a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.spec.tsx b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.spec.tsx index 7979d7781f..7571b2bf61 100644 --- a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.spec.tsx +++ b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.spec.tsx @@ -77,7 +77,7 @@ describe('Recommendation', () => { expect(pushMock).toHaveBeenCalledWith({ search: 'guidePath=' }) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_TUTORIAL_CLICKED, eventData: { databaseId: INSTANCE_ID_MOCK, name: 'searchJSON', @@ -110,7 +110,7 @@ describe('Recommendation', () => { search: 'guidePath=quick-guides/working-with-hash.html' }) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_TUTORIAL_CLICKED, eventData: { databaseId: INSTANCE_ID_MOCK, name: 'searchJSON', @@ -144,7 +144,7 @@ describe('Recommendation', () => { search: 'guidePath=/redis_stack/working_with_json.md' }) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_TUTORIAL_CLICKED, eventData: { databaseId: INSTANCE_ID_MOCK, name: 'searchJSON', diff --git a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.tsx b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.tsx index f02cd6e7be..efc966750b 100644 --- a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.tsx +++ b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.tsx @@ -70,7 +70,7 @@ const Recommendation = ({ const handleRedirect = () => { sendEventTelemetry({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_TUTORIAL_CLICKED, eventData: { databaseId: instanceId, name: recommendationsContent[name].telemetryEvent || name, @@ -89,7 +89,7 @@ const Recommendation = ({ id, { hide: !hide }, ({ hide, name }) => sendEventTelemetry({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_HIDE, + event: TelemetryEvent.INSIGHTS_TIPS_HIDE, eventData: { databaseId: instanceId, action: hide ? 'hide' : 'show', @@ -114,7 +114,7 @@ const Recommendation = ({ const onSuccessActionDelete = () => { sendEventTelemetry({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_SNOOZED, + event: TelemetryEvent.INSIGHTS_TIPS_SNOOZED, eventData: { databaseId: instanceId, name: recommendationsContent[name]?.telemetryEvent ?? name, @@ -125,7 +125,7 @@ const Recommendation = ({ const onRecommendationLinkClick = () => { sendEventTelemetry({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_LINK_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_LINK_CLICKED, eventData: { databaseId: instanceId, name: recommendationsContent[name]?.telemetryEvent ?? name, @@ -210,8 +210,8 @@ const Recommendation = ({ diff --git a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/welcome-screen/WelcomeScreen.spec.tsx b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/welcome-screen/WelcomeScreen.spec.tsx index 463376473f..d736b660be 100644 --- a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/welcome-screen/WelcomeScreen.spec.tsx +++ b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/welcome-screen/WelcomeScreen.spec.tsx @@ -92,7 +92,7 @@ describe('WelcomeScreen', () => { fireEvent.click(screen.getByTestId('approve-insights-db-analysis-btn')) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED, eventData: { databaseId: 'instanceId', total: 1, diff --git a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/welcome-screen/WelcomeScreen.tsx b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/welcome-screen/WelcomeScreen.tsx index e65b282437..f271052995 100644 --- a/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/welcome-screen/WelcomeScreen.tsx +++ b/redisinsight/ui/src/components/database-side-panels/panels/live-time-recommendations/components/welcome-screen/WelcomeScreen.tsx @@ -31,7 +31,7 @@ const NoRecommendationsScreen = () => { dispatch(createNewAnalysis(instanceId, delimiter)) history.push(Pages.databaseAnalysis(instanceId)) sendEventTelemetry({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED, + event: TelemetryEvent.INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED, eventData: { databaseId: instanceId, total: recommendations?.length, @@ -44,15 +44,15 @@ const NoRecommendationsScreen = () => { return (
Welcome to - Recommendations! + Tips! Where we help improve your database. - New recommendations appear while you work with your database, + New tips appear while you work with your database, including how to improve performance and optimize memory usage. - Eager for more recommendations? Run Database Analysis to get started. + Eager for more tips? Run Database Analysis to get started. { provider: 'RE_CLOUD', source: 'overview', page: '/browser', - tab: 'recommendations' + tab: 'tips' }, - }) + }); - sendEventTelemetry.mockRestore() + (sendEventTelemetry as jest.Mock).mockRestore() }) }) diff --git a/redisinsight/ui/src/components/insights-trigger/InsightsTrigger.tsx b/redisinsight/ui/src/components/insights-trigger/InsightsTrigger.tsx index 2782f35986..cb913c87f9 100644 --- a/redisinsight/ui/src/components/insights-trigger/InsightsTrigger.tsx +++ b/redisinsight/ui/src/components/insights-trigger/InsightsTrigger.tsx @@ -63,8 +63,8 @@ const InsightsTrigger = () => { { expect( render() ).toBeTruthy() - expect(screen.getByTestId('step-content')).toHaveTextContent('See recommendations to optimize the memory usage, performance') + expect(screen.getByTestId('step-content')).toHaveTextContent('See tips to optimize the memory usage, performance') }) it('should call proper telemetry events', () => { diff --git a/redisinsight/ui/src/components/onboarding-features/OnboardingFeatures.tsx b/redisinsight/ui/src/components/onboarding-features/OnboardingFeatures.tsx index 5ee47e55bf..91081462fe 100644 --- a/redisinsight/ui/src/components/onboarding-features/OnboardingFeatures.tsx +++ b/redisinsight/ui/src/components/onboarding-features/OnboardingFeatures.tsx @@ -358,10 +358,10 @@ const ONBOARDING_FEATURES = { content: ( <> Use Database Analysis to get summary of your database and receive - recommendations to improve memory usage and performance. + tips to improve memory usage and performance. Run a new report to get an overview of the database and receive - recommendations to optimize your database usage. + tips to optimize your database usage. ), onSkip: () => sendClosedTelemetryEvent(...telemetryArgs), @@ -389,14 +389,14 @@ const ONBOARDING_FEATURES = { }, ANALYTICS_RECOMMENDATIONS: { step: OnboardingSteps.AnalyticsRecommendations, - title: 'Database Recommendations', + title: 'Database Tips', Inner: () => { const { id: connectedInstanceId = '' } = useSelector(connectedInstanceSelector) const history = useHistory() const telemetryArgs: TelemetryArgs = [connectedInstanceId, OnboardingStepName.DatabaseAnalysisRecommendations] return { - content: 'See recommendations to optimize the memory usage, performance and increase the security of your Redis database', + content: 'See tips to optimize the memory usage, performance and increase the security of your Redis database', onSkip: () => sendClosedTelemetryEvent(...telemetryArgs), onBack: () => sendBackTelemetryEvent(...telemetryArgs), onNext: () => { diff --git a/redisinsight/ui/src/components/recommendation-copy-component/RecommendationCopyComponent.spec.tsx b/redisinsight/ui/src/components/recommendation-copy-component/RecommendationCopyComponent.spec.tsx index 3750ffdd5d..e7a8a26de5 100644 --- a/redisinsight/ui/src/components/recommendation-copy-component/RecommendationCopyComponent.spec.tsx +++ b/redisinsight/ui/src/components/recommendation-copy-component/RecommendationCopyComponent.spec.tsx @@ -38,7 +38,7 @@ describe('RecommendationCopyComponent', () => { }) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.INSIGHTS_RECOMMENDATION_KEY_COPIED, + event: TelemetryEvent.INSIGHTS_TIPS_KEY_COPIED, eventData: { databaseId: INSTANCE_ID_MOCK, name: mockTelemetryEvent, @@ -65,7 +65,7 @@ describe('RecommendationCopyComponent', () => { }) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.DATABASE_RECOMMENDATIONS_KEY_COPIED, + event: TelemetryEvent.DATABASE_TIPS_KEY_COPIED, eventData: { databaseId: INSTANCE_ID_MOCK, name: mockTelemetryEvent, diff --git a/redisinsight/ui/src/components/recommendation-copy-component/RecommendationCopyComponent.tsx b/redisinsight/ui/src/components/recommendation-copy-component/RecommendationCopyComponent.tsx index c8d858539e..93e1a3f3d5 100644 --- a/redisinsight/ui/src/components/recommendation-copy-component/RecommendationCopyComponent.tsx +++ b/redisinsight/ui/src/components/recommendation-copy-component/RecommendationCopyComponent.tsx @@ -23,8 +23,8 @@ const RecommendationCopyComponent = ({ live = false, keyName, telemetryEvent, pr const handleCopy = () => { sendEventTelemetry({ event: live - ? TelemetryEvent.INSIGHTS_RECOMMENDATION_KEY_COPIED - : TelemetryEvent.DATABASE_RECOMMENDATIONS_KEY_COPIED, + ? TelemetryEvent.INSIGHTS_TIPS_KEY_COPIED + : TelemetryEvent.DATABASE_TIPS_KEY_COPIED, eventData: { databaseId: instanceId, name: telemetryEvent, diff --git a/redisinsight/ui/src/components/recommendation-voting/RecommendationVoting.spec.tsx b/redisinsight/ui/src/components/recommendation-voting/RecommendationVoting.spec.tsx index 63bf4f313b..292d1c3775 100644 --- a/redisinsight/ui/src/components/recommendation-voting/RecommendationVoting.spec.tsx +++ b/redisinsight/ui/src/components/recommendation-voting/RecommendationVoting.spec.tsx @@ -57,7 +57,7 @@ describe('RecommendationVoting', () => { }) it('should render proper popover and btn should be disabled"', async () => { - userSettingsConfigSelector.mockImplementation(() => ({ + (userSettingsConfigSelector as jest.Mock).mockImplementation(() => ({ agreements: { analytics: false, }, @@ -69,7 +69,7 @@ describe('RecommendationVoting', () => { }) await waitForEuiToolTipVisible() - expect(screen.getByTestId('not useful-vote-tooltip')).toHaveTextContent('Enable Analytics on the Settings page to vote for a recommendation') + expect(screen.getByTestId('not useful-vote-tooltip')).toHaveTextContent('Enable Analytics on the Settings page to vote for a tip') expect(screen.getByTestId('not useful-vote-btn')).toBeDisabled() }) }) diff --git a/redisinsight/ui/src/components/recommendation-voting/components/vote-option/VoteOption.tsx b/redisinsight/ui/src/components/recommendation-voting/components/vote-option/VoteOption.tsx index 3d08318336..62e5bcfaed 100644 --- a/redisinsight/ui/src/components/recommendation-voting/components/vote-option/VoteOption.tsx +++ b/redisinsight/ui/src/components/recommendation-voting/components/vote-option/VoteOption.tsx @@ -55,8 +55,8 @@ const VoteOption = (props: Props) => { const onSuccessVoted = ({ vote, name }: { name: string, vote: Nullable }) => { sendEventTelemetry({ event: live - ? TelemetryEvent.INSIGHTS_RECOMMENDATION_VOTED - : TelemetryEvent.DATABASE_ANALYSIS_RECOMMENDATIONS_VOTED, + ? TelemetryEvent.INSIGHTS_TIPS_VOTED + : TelemetryEvent.DATABASE_ANALYSIS_TIPS_VOTED, eventData: { databaseId: instanceId, name: recommendationsContent[name]?.telemetryEvent ?? name, @@ -78,7 +78,7 @@ const VoteOption = (props: Props) => { const getTooltipContent = (voteOption: Vote) => (isAnalyticsEnable ? voteTooltip[voteOption] - : 'Enable Analytics on the Settings page to vote for a recommendation') + : 'Enable Analytics on the Settings page to vote for a tip') return ( { className={styles.exploreBtn} data-testid="explore-msg-btn" > - Explore Redis + Explore
diff --git a/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.spec.tsx b/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.spec.tsx index 88daddb2f7..4de9040be4 100644 --- a/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.spec.tsx +++ b/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.spec.tsx @@ -10,6 +10,7 @@ import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry' import { MOCK_RECOMMENDATIONS } from 'uiSrc/constants/mocks/mock-recommendations' import { recommendationsSelector } from 'uiSrc/slices/recommendations/recommendations' +import { ShortDatabaseAnalysis } from 'apiSrc/modules/database-analysis/models' import DatabaseAnalysisTabs, { Props } from './DatabaseAnalysisTabs' const mockRecommendationsSelector = jest.requireActual('uiSrc/slices/recommendations/recommendations') @@ -31,10 +32,10 @@ jest.mock('uiSrc/slices/recommendations/recommendations', () => ({ const mockedProps = mock() -const mockReports = [ +const mockReports: ShortDatabaseAnalysis[] = [ { id: MOCK_ANALYSIS_REPORT_DATA.id, - createdAt: '2022-09-23T05:30:23.000Z' + createdAt: '2022-09-23T05:30:23.000Z' as any } ] @@ -76,7 +77,7 @@ describe('DatabaseAnalysisTabs', () => { }) it('should render encrypt message', () => { - const mockData = { + const mockData: any = { totalKeys: null } render() @@ -85,8 +86,8 @@ describe('DatabaseAnalysisTabs', () => { }) describe('recommendations count', () => { - it('should render "Recommendation (3)" in the tab name', () => { - const mockData = { + it('should render "Tips (3)" in the tab name', () => { + const mockData: any = { recommendations: [ { name: 'luaScript' }, { name: 'luaScript' }, @@ -96,34 +97,34 @@ describe('DatabaseAnalysisTabs', () => { render() - expect(screen.queryByTestId(`${DatabaseAnalysisViewTab.Recommendations}-tab`)).toHaveTextContent('Recommendations (3)') + expect(screen.queryByTestId(`${DatabaseAnalysisViewTab.Recommendations}-tab`)).toHaveTextContent('Tips (3)') }) - it('should render "Recommendation (3)" in the tab name', () => { - const mockData = { + it('should render "Tips (3)" in the tab name', () => { + const mockData: any = { recommendations: [{ name: 'luaScript' }] } render() - expect(screen.queryByTestId(`${DatabaseAnalysisViewTab.Recommendations}-tab`)).toHaveTextContent('Recommendations (1)') + expect(screen.queryByTestId(`${DatabaseAnalysisViewTab.Recommendations}-tab`)).toHaveTextContent('Tips (1)') }) - it('should render "Recommendation" in the tab name', () => { - const mockData = { + it('should render "Tips" in the tab name', () => { + const mockData: any = { recommendations: [] } render() - expect(screen.queryByTestId(`${DatabaseAnalysisViewTab.Recommendations}-tab`)).toHaveTextContent('Recommendations') + expect(screen.queryByTestId(`${DatabaseAnalysisViewTab.Recommendations}-tab`)).toHaveTextContent('Tips') }) }) describe('Telemetry', () => { it('should call DATABASE_ANALYSIS_DATA_SUMMARY_CLICKED telemetry event with 0 count', () => { - const sendEventTelemetryMock = jest.fn() - sendEventTelemetry.mockImplementation(() => sendEventTelemetryMock) + const sendEventTelemetryMock = jest.fn(); + (sendEventTelemetry as jest.Mock).mockImplementation(() => sendEventTelemetryMock) - const mockData = { + const mockData: any = { recommendations: [] } render() @@ -136,15 +137,15 @@ describe('DatabaseAnalysisTabs', () => { databaseId: INSTANCE_ID_MOCK, provider: 'RE_CLOUD', } - }) - sendEventTelemetry.mockRestore() + }); + (sendEventTelemetry as jest.Mock).mockRestore() }) it('should call DATABASE_ANALYSIS_RECOMMENDATIONS_CLICKED telemetry event with 0 count', () => { - const sendEventTelemetryMock = jest.fn() - sendEventTelemetry.mockImplementation(() => sendEventTelemetryMock) + const sendEventTelemetryMock = jest.fn(); + (sendEventTelemetry as jest.Mock).mockImplementation(() => sendEventTelemetryMock) - const mockData = { + const mockData: any = { recommendations: [] } render() @@ -152,22 +153,22 @@ describe('DatabaseAnalysisTabs', () => { fireEvent.click(screen.getByTestId(`${DatabaseAnalysisViewTab.Recommendations}-tab`)) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.DATABASE_ANALYSIS_RECOMMENDATIONS_CLICKED, + event: TelemetryEvent.DATABASE_ANALYSIS_TIPS_CLICKED, eventData: { databaseId: INSTANCE_ID_MOCK, - recommendationsCount: 0, + tipsCount: 0, list: [], provider: 'RE_CLOUD' } - }) - sendEventTelemetry.mockRestore() + }); + (sendEventTelemetry as jest.Mock).mockRestore() }) it('should call DATABASE_ANALYSIS_RECOMMENDATIONS_CLICKED telemetry event with 2 count', () => { - const sendEventTelemetryMock = jest.fn() - sendEventTelemetry.mockImplementation(() => sendEventTelemetryMock) + const sendEventTelemetryMock = jest.fn(); + (sendEventTelemetry as jest.Mock).mockImplementation(() => sendEventTelemetryMock) - const mockData = { + const mockData: any = { recommendations: [{ name: 'luaScript' }, { name: 'bigHashes' }] } render() @@ -175,15 +176,15 @@ describe('DatabaseAnalysisTabs', () => { fireEvent.click(screen.getByTestId(`${DatabaseAnalysisViewTab.Recommendations}-tab`)) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.DATABASE_ANALYSIS_RECOMMENDATIONS_CLICKED, + event: TelemetryEvent.DATABASE_ANALYSIS_TIPS_CLICKED, eventData: { databaseId: INSTANCE_ID_MOCK, - recommendationsCount: 2, + tipsCount: 2, list: ['luaScript', 'shardHashes'], provider: 'RE_CLOUD' } - }) - sendEventTelemetry.mockRestore() + }); + (sendEventTelemetry as jest.Mock).mockRestore() }) }) }) diff --git a/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.tsx b/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.tsx index 8a2557eca8..20eaba4faa 100644 --- a/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.tsx +++ b/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/DatabaseAnalysisTabs.tsx @@ -45,10 +45,10 @@ const DatabaseAnalysisTabs = (props: Props) => { } if (id === DatabaseAnalysisViewTab.Recommendations) { sendEventTelemetry({ - event: TelemetryEvent.DATABASE_ANALYSIS_RECOMMENDATIONS_CLICKED, + event: TelemetryEvent.DATABASE_ANALYSIS_TIPS_CLICKED, eventData: { databaseId: instanceId, - recommendationsCount: data?.recommendations?.length, + tipsCount: data?.recommendations?.length, list: data?.recommendations?.map(({ name }) => recommendationsContent[name]?.telemetryEvent || name), provider, } diff --git a/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/constants.tsx b/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/constants.tsx index 5b135d1d45..51b89700a5 100644 --- a/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/constants.tsx +++ b/redisinsight/ui/src/pages/database-analysis/components/data-nav-tabs/constants.tsx @@ -22,7 +22,7 @@ export const databaseAnalysisTabs: DatabaseAnalysisTabs[] = [ }, { id: DatabaseAnalysisViewTab.Recommendations, - name: (count?: number) => (count ? `Recommendations (${count})` : 'Recommendations'), + name: (count?: number) => (count ? `Tips (${count})` : 'Tips'), content: , onboard: ONBOARDING_FEATURES?.ANALYTICS_RECOMMENDATIONS }, diff --git a/redisinsight/ui/src/pages/database-analysis/components/header/Header.spec.tsx b/redisinsight/ui/src/pages/database-analysis/components/header/Header.spec.tsx index 3ae2dc2359..c4a2dba11f 100644 --- a/redisinsight/ui/src/pages/database-analysis/components/header/Header.spec.tsx +++ b/redisinsight/ui/src/pages/database-analysis/components/header/Header.spec.tsx @@ -21,7 +21,7 @@ import Header, { Props } from './Header' const mockedProps = mock() -const mockReports = [ +const mockReports: any = [ { id: 'id_1', createdAt: '2022-09-23T05:30:23.000Z' }, { id: 'id_2', createdAt: '2022-09-23T05:15:19.000Z' } ] @@ -96,9 +96,9 @@ describe('DatabaseAnalysisHeader', () => { expect(store.getActions()).toEqual(expectedActions) }) it('should send telemetry event after click "new analysis" btn', async () => { - const sendEventTelemetryMock = jest.fn() + const sendEventTelemetryMock = jest.fn(); - sendEventTelemetry.mockImplementation(() => sendEventTelemetryMock) + (sendEventTelemetry as jest.Mock).mockImplementation(() => sendEventTelemetryMock) render(
) @@ -110,9 +110,9 @@ describe('DatabaseAnalysisHeader', () => { databaseId: INSTANCE_ID_MOCK, provider: 'RE_CLOUD' } - }) + }); - sendEventTelemetry.mockRestore() + (sendEventTelemetry as jest.Mock).mockRestore() }) it.skip('should call onChangeSelectedAnalysis after change selector', async () => { @@ -148,7 +148,7 @@ describe('CLUSTER db', () => { }) await waitForEuiToolTipVisible() - expect(screen.getByTestId('db-new-reports-tooltip')).toHaveTextContent('Analyze up to 10 000 keys per shard to get an overview of your data and recommendations on how to save memory and optimize the usage of your database.') + expect(screen.getByTestId('db-new-reports-tooltip')).toHaveTextContent('Analyze up to 10 000 keys per shard to get an overview of your data and tips on how to save memory and optimize the usage of your database.') }) }) @@ -166,7 +166,7 @@ describe('STANDALONE db', () => { }) await waitForEuiToolTipVisible() - expect(screen.getByTestId('db-new-reports-tooltip')).toHaveTextContent('Analyze up to 10 000 keys to get an overview of your data and recommendations on how to save memory and optimize the usage of your database.') + expect(screen.getByTestId('db-new-reports-tooltip')).toHaveTextContent('Analyze up to 10 000 keys to get an overview of your data and tips on how to save memory and optimize the usage of your database.') }) }) @@ -184,6 +184,6 @@ describe('SENTINEL db', () => { }) await waitForEuiToolTipVisible() - expect(screen.getByTestId('db-new-reports-tooltip')).toHaveTextContent('Analyze up to 10 000 keys to get an overview of your data and recommendations on how to save memory and optimize the usage of your database.') + expect(screen.getByTestId('db-new-reports-tooltip')).toHaveTextContent('Analyze up to 10 000 keys to get an overview of your data and tips on how to save memory and optimize the usage of your database.') }) }) diff --git a/redisinsight/ui/src/pages/database-analysis/components/recommendations-view/Recommendations.spec.tsx b/redisinsight/ui/src/pages/database-analysis/components/recommendations-view/Recommendations.spec.tsx index ad3ffde462..d41a968f45 100644 --- a/redisinsight/ui/src/pages/database-analysis/components/recommendations-view/Recommendations.spec.tsx +++ b/redisinsight/ui/src/pages/database-analysis/components/recommendations-view/Recommendations.spec.tsx @@ -352,9 +352,9 @@ describe('Recommendations', () => { } })) - const sendEventTelemetryMock = jest.fn() + const sendEventTelemetryMock = jest.fn(); - sendEventTelemetry.mockImplementation(() => sendEventTelemetryMock) + (sendEventTelemetry as jest.Mock).mockImplementation(() => sendEventTelemetryMock) const { container } = render() @@ -364,27 +364,27 @@ describe('Recommendations', () => { expect(screen.queryAllByTestId('luaScript-accordion')[0]?.classList.contains('euiAccordion-isOpen')).not.toBeTruthy() expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.DATABASE_ANALYSIS_RECOMMENDATIONS_COLLAPSED, + event: TelemetryEvent.DATABASE_ANALYSIS_TIPS_COLLAPSED, eventData: { databaseId: INSTANCE_ID_MOCK, recommendation: 'luaScript', provider: 'RE_CLOUD' } - }) - sendEventTelemetry.mockRestore() + }); + (sendEventTelemetry as jest.Mock).mockRestore() fireEvent.click(container.querySelector('[data-test-subj="luaScript-button"]') as HTMLInputElement) expect(screen.queryAllByTestId('luaScript-accordion')[0]?.classList.contains('euiAccordion-isOpen')).toBeTruthy() expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.DATABASE_ANALYSIS_RECOMMENDATIONS_EXPANDED, + event: TelemetryEvent.DATABASE_ANALYSIS_TIPS_EXPANDED, eventData: { databaseId: INSTANCE_ID_MOCK, recommendation: 'luaScript', provider: 'RE_CLOUD', } - }) - sendEventTelemetry.mockRestore() + }); + (sendEventTelemetry as jest.Mock).mockRestore() }) it('should not render badges legend', () => { @@ -441,8 +441,8 @@ describe('Recommendations', () => { }) it('should call proper history push after click go tutorial button', () => { - const sendEventTelemetryMock = jest.fn() - sendEventTelemetry.mockImplementation(() => sendEventTelemetryMock); + const sendEventTelemetryMock = jest.fn(); + (sendEventTelemetry as jest.Mock).mockImplementation(() => sendEventTelemetryMock); (dbAnalysisSelector as jest.Mock).mockImplementation(() => ({ ...mockdbAnalysisSelector, @@ -457,14 +457,14 @@ describe('Recommendations', () => { fireEvent.click(screen.getByTestId('bigHashes-to-tutorial-btn')) expect(sendEventTelemetry).toBeCalledWith({ - event: TelemetryEvent.DATABASE_RECOMMENDATIONS_TUTORIAL_CLICKED, + event: TelemetryEvent.DATABASE_TIPS_TUTORIAL_CLICKED, eventData: { databaseId: INSTANCE_ID_MOCK, recommendation: 'shardHashes', provider: 'RE_CLOUD', } - }) - sendEventTelemetry.mockRestore() + }); + (sendEventTelemetry as jest.Mock).mockRestore() }) it('should call proper telemetry after click go tutorial button', () => { diff --git a/redisinsight/ui/src/pages/database-analysis/components/recommendations-view/Recommendations.tsx b/redisinsight/ui/src/pages/database-analysis/components/recommendations-view/Recommendations.tsx index c8f23114b0..760f2389c3 100644 --- a/redisinsight/ui/src/pages/database-analysis/components/recommendations-view/Recommendations.tsx +++ b/redisinsight/ui/src/pages/database-analysis/components/recommendations-view/Recommendations.tsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react' -import { useDispatch, useSelector } from 'react-redux' +import { useSelector } from 'react-redux' import { useParams, useHistory } from 'react-router-dom' import { isNull } from 'lodash' import { @@ -46,13 +46,12 @@ const Recommendations = () => { const { theme } = useContext(ThemeContext) const history = useHistory() - const dispatch = useDispatch() const { instanceId } = useParams<{ instanceId: string }>() const handleToggle = (isOpen: boolean, id: string) => sendEventTelemetry({ event: isOpen - ? TelemetryEvent.DATABASE_ANALYSIS_RECOMMENDATIONS_EXPANDED - : TelemetryEvent.DATABASE_ANALYSIS_RECOMMENDATIONS_COLLAPSED, + ? TelemetryEvent.DATABASE_ANALYSIS_TIPS_EXPANDED + : TelemetryEvent.DATABASE_ANALYSIS_TIPS_COLLAPSED, eventData: { databaseId: instanceId, recommendation: recommendationsContent[id]?.telemetryEvent || id, @@ -62,7 +61,7 @@ const Recommendations = () => { const goToTutorial = (mdPath: string, id: string) => { sendEventTelemetry({ - event: TelemetryEvent.DATABASE_RECOMMENDATIONS_TUTORIAL_CLICKED, + event: TelemetryEvent.DATABASE_TIPS_TUTORIAL_CLICKED, eventData: { databaseId: instanceId, recommendation: recommendationsContent[id]?.telemetryEvent || id, @@ -127,7 +126,7 @@ const Recommendations = () => { data-testid="no=recommendations-icon" /> AMAZING JOB! - No Recommendations at the moment, + No Tips at the moment,
keep up the good work! diff --git a/redisinsight/ui/src/pages/workbench/components/wb-no-results-message/WbNoResultsMessage.tsx b/redisinsight/ui/src/pages/workbench/components/wb-no-results-message/WbNoResultsMessage.tsx index 3ac832245f..01cb79e925 100644 --- a/redisinsight/ui/src/pages/workbench/components/wb-no-results-message/WbNoResultsMessage.tsx +++ b/redisinsight/ui/src/pages/workbench/components/wb-no-results-message/WbNoResultsMessage.tsx @@ -74,7 +74,7 @@ const WbNoResultsMessage = () => { className={styles.exploreBtn} data-testid="no-results-explore-btn" > - Explore Redis + Explore diff --git a/redisinsight/ui/src/slices/interfaces/insights.ts b/redisinsight/ui/src/slices/interfaces/insights.ts index 12f37fa319..0b38a969bc 100644 --- a/redisinsight/ui/src/slices/interfaces/insights.ts +++ b/redisinsight/ui/src/slices/interfaces/insights.ts @@ -3,7 +3,7 @@ import { IEnablementAreaItem } from 'uiSrc/slices/interfaces/workbench' export enum InsightsPanelTabs { Explore = 'explore', - Recommendations = 'recommendations' + Recommendations = 'tips' } export interface InsightsPanelState { diff --git a/redisinsight/ui/src/slices/interfaces/recommendations.ts b/redisinsight/ui/src/slices/interfaces/recommendations.ts index 11903fe17a..f45b708f57 100644 --- a/redisinsight/ui/src/slices/interfaces/recommendations.ts +++ b/redisinsight/ui/src/slices/interfaces/recommendations.ts @@ -39,6 +39,7 @@ export interface IRecommendationsStatic { redisStack?: boolean tutorial?: string content?: IRecommendationContent[] + badges?: string[] } } diff --git a/redisinsight/ui/src/telemetry/events.ts b/redisinsight/ui/src/telemetry/events.ts index f0c4d0fdd1..ebeb848a32 100644 --- a/redisinsight/ui/src/telemetry/events.ts +++ b/redisinsight/ui/src/telemetry/events.ts @@ -212,13 +212,13 @@ export enum TelemetryEvent { DATABASE_ANALYSIS_STARTED = 'DATABASE_ANALYSIS_STARTED', DATABASE_ANALYSIS_HISTORY_VIEWED = 'DATABASE_ANALYSIS_HISTORY_VIEWED', DATABASE_ANALYSIS_EXTRAPOLATION_CHANGED = 'DATABASE_ANALYSIS_EXTRAPOLATION_CHANGED', - DATABASE_ANALYSIS_RECOMMENDATIONS_CLICKED = 'DATABASE_ANALYSIS_RECOMMENDATIONS_CLICKED', + DATABASE_ANALYSIS_TIPS_CLICKED = 'DATABASE_ANALYSIS_TIPS_CLICKED', DATABASE_ANALYSIS_DATA_SUMMARY_CLICKED = 'DATABASE_ANALYSIS_DATA_SUMMARY_CLICKED', - DATABASE_ANALYSIS_RECOMMENDATIONS_EXPANDED = 'DATABASE_ANALYSIS_RECOMMENDATIONS_EXPANDED', - DATABASE_ANALYSIS_RECOMMENDATIONS_COLLAPSED = 'DATABASE_ANALYSIS_RECOMMENDATIONS_COLLAPSED', - DATABASE_ANALYSIS_RECOMMENDATIONS_VOTED = 'DATABASE_ANALYSIS_RECOMMENDATIONS_VOTED', - DATABASE_RECOMMENDATIONS_TUTORIAL_CLICKED = 'DATABASE_RECOMMENDATIONS_TUTORIAL_CLICKED', - DATABASE_RECOMMENDATIONS_KEY_COPIED = 'DATABASE_RECOMMENDATIONS_KEY_COPIED', + DATABASE_ANALYSIS_TIPS_EXPANDED = 'DATABASE_ANALYSIS_TIPS_EXPANDED', + DATABASE_ANALYSIS_TIPS_COLLAPSED = 'DATABASE_ANALYSIS_TIPS_COLLAPSED', + DATABASE_ANALYSIS_TIPS_VOTED = 'DATABASE_ANALYSIS_TIPS_VOTED', + DATABASE_TIPS_TUTORIAL_CLICKED = 'DATABASE_TIPS_TUTORIAL_CLICKED', + DATABASE_TIPS_KEY_COPIED = 'DATABASE_TIPS_KEY_COPIED', USER_SURVEY_LINK_CLICKED = 'USER_SURVEY_LINK_CLICKED', @@ -240,14 +240,14 @@ export enum TelemetryEvent { INSIGHTS_PANEL_CLOSED = 'INSIGHTS_PANEL_CLOSED', INSIGHTS_PANEL_TAB_CHANGED = 'INSIGHTS_PANEL_TAB_CHANGED', INSIGHTS_PANEL_FULL_SCREEN_CLICKED = 'INSIGHTS_PANEL_FULL_SCREEN_CLICKED', - INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED = 'INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED', - INSIGHTS_RECOMMENDATION_VOTED = 'INSIGHTS_RECOMMENDATION_VOTED', - INSIGHTS_RECOMMENDATION_SNOOZED = 'INSIGHTS_RECOMMENDATION_SNOOZED', - INSIGHTS_RECOMMENDATION_HIDE = 'INSIGHTS_RECOMMENDATION_HIDE', - INSIGHTS_RECOMMENDATION_SHOW_HIDDEN = 'INSIGHTS_RECOMMENDATION_SHOW_HIDDEN', - INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED = 'INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED', - INSIGHTS_RECOMMENDATION_KEY_COPIED = 'INSIGHTS_RECOMMENDATION_KEY_COPIED', - INSIGHTS_RECOMMENDATION_LINK_CLICKED = 'INSIGHTS_RECOMMENDATION_LINK_CLICKED', + INSIGHTS_TIPS_TUTORIAL_CLICKED = 'INSIGHTS_TIPS_TUTORIAL_CLICKED', + INSIGHTS_TIPS_VOTED = 'INSIGHTS_TIPS_VOTED', + INSIGHTS_TIPS_SNOOZED = 'INSIGHTS_TIPS_SNOOZED', + INSIGHTS_TIPS_HIDE = 'INSIGHTS_TIPS_HIDE', + INSIGHTS_TIPS_SHOW_HIDDEN = 'INSIGHTS_TIPS_SHOW_HIDDEN', + INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED = 'INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED', + INSIGHTS_TIPS_KEY_COPIED = 'INSIGHTS_TIPS_KEY_COPIED', + INSIGHTS_TIPS_LINK_CLICKED = 'INSIGHTS_TIPS_LINK_CLICKED', EXPLORE_PANEL_COMMAND_COPIED = 'EXPLORE_PANEL_COMMAND_COPIED', EXPLORE_PANEL_COMMAND_RUN_CLICKED = 'EXPLORE_PANEL_COMMAND_RUN_CLICKED', diff --git a/tests/e2e/helpers/constants.ts b/tests/e2e/helpers/constants.ts index f8d83a9f2e..a82f8592c0 100644 --- a/tests/e2e/helpers/constants.ts +++ b/tests/e2e/helpers/constants.ts @@ -77,7 +77,7 @@ export enum ResourcePath { } export enum ExploreTabs { - Explore = 'Explore Redis', - Recommendations = 'Redis Tips', + Explore = 'Explore', + Tips = 'Tips', } diff --git a/tests/e2e/pageObjects/components/insights-panel.ts b/tests/e2e/pageObjects/components/insights-panel.ts index fe6e09dec2..59866bdb45 100644 --- a/tests/e2e/pageObjects/components/insights-panel.ts +++ b/tests/e2e/pageObjects/components/insights-panel.ts @@ -38,7 +38,7 @@ export class InsightsPanel { * @param type of the tab */ async setActiveTab(type: ExploreTabs.Explore): Promise - async setActiveTab(type: ExploreTabs.Recommendations): Promise + async setActiveTab(type: ExploreTabs.Tips): Promise async setActiveTab(type: ExploreTabs): Promise { const activeTabName = await this.getActiveTabName(); if(type === ExploreTabs.Explore) { @@ -59,7 +59,7 @@ export class InsightsPanel { * Get Insights panel selector */ getInsightsPanel(): Selector { - return Selector('[class=euiButton__text]').withExactText(ExploreTabs.Recommendations); + return Selector('[class=euiButton__text]').withExactText(ExploreTabs.Tips); } } diff --git a/tests/e2e/tests/web/critical-path/memory-efficiency/memory-efficiency.e2e.ts b/tests/e2e/tests/web/critical-path/memory-efficiency/memory-efficiency.e2e.ts index e6aa2daae9..26b988f70d 100644 --- a/tests/e2e/tests/web/critical-path/memory-efficiency/memory-efficiency.e2e.ts +++ b/tests/e2e/tests/web/critical-path/memory-efficiency/memory-efficiency.e2e.ts @@ -45,7 +45,7 @@ test })('No reports/keys message and report tooltip', async t => { const noReportsMessage = 'No Reports foundRun "New Analysis" to generate first report.'; const noKeysMessage = 'No keys to displayUse Workbench Guides and Tutorials to quickly load the data.'; - const tooltipText = 'Analyze up to 10 000 keys to get an overview of your data and recommendations'; + const tooltipText = 'Analyze up to 10 000 keys to get an overview of your data and tips'; // Verify that user can see the “No reports found” message when report wasn't generated await t.expect(memoryEfficiencyPage.noReportsText.textContent).eql(noReportsMessage, 'No reports message not displayed or text is invalid'); diff --git a/tests/e2e/tests/web/regression/insights/feature-flag.e2e.ts b/tests/e2e/tests/web/regression/insights/feature-flag.e2e.ts index 09b8c2a2c8..6888f4a4c0 100644 --- a/tests/e2e/tests/web/regression/insights/feature-flag.e2e.ts +++ b/tests/e2e/tests/web/regression/insights/feature-flag.e2e.ts @@ -89,7 +89,7 @@ test await browserPage.InsightsPanel.togglePanel(true); await t.expect(browserPage.InsightsPanel.getInsightsPanel().exists).ok('Insights panel not displayed for the other db connection'); await browserPage.InsightsPanel.togglePanel(true); - const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t.expect(tab.getRecommendationByName(redisVersionRecom).exists).ok('Redis Version recommendation not displayed'); await browserPage.InsightsPanel.togglePanel(false); diff --git a/tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts b/tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts index 95e9b2c7ae..2f69707d75 100644 --- a/tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts +++ b/tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts @@ -114,7 +114,14 @@ test .notOk(`${tutorialName} tutorial is not uploaded`); }); // https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4213, https://redislabs.atlassian.net/browse/RI-4302 -test('Verify that user can upload tutorial with URL with manifest.json', async t => { +test.after(async() => { + tutorialName = 'Tutorials with manifest'; + const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore); + if(await tutorials.tutorialAccordionButton.withText(tutorialName).exists) { + await tutorials.deleteTutorialByName(tutorialName); + } + await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig); +})('Verify that user can upload tutorial with URL with manifest.json', async t => { const labelFromManifest = 'Working with JSON label'; const link = 'https://drive.google.com/u/2/uc?id=1a45zHZGYYvtKgM83Rff6rfjy1yfWiwHt&export=download'; internalLinkName1 = 'manifest-id'; diff --git a/tests/e2e/tests/web/regression/insights/live-recommendations.e2e.ts b/tests/e2e/tests/web/regression/insights/live-recommendations.e2e.ts index c5e8ba0993..c73f65e503 100644 --- a/tests/e2e/tests/web/regression/insights/live-recommendations.e2e.ts +++ b/tests/e2e/tests/web/regression/insights/live-recommendations.e2e.ts @@ -27,7 +27,7 @@ const databasesForAdding = [ const tenSecondsTimeout = 10000; const keyName = `recomKey-${Common.generateWord(10)}`; const logger = telemetry.createLogger(); -const telemetryEvent = 'INSIGHTS_RECOMMENDATION_VOTED'; +const telemetryEvent = 'INSIGHTS_TIPS_VOTED'; const expectedProperties = [ 'buildType', 'databaseId', @@ -83,10 +83,10 @@ test })('Verify Insights panel Recommendations displaying', async t => { await browserPage.InsightsPanel.togglePanel(true); // Verify that "Welcome to recommendations" panel displayed when there are no recommendations - let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t - .expect(tab.noRecommendationsScreen.exists).ok('No recommendations panel not displayed') - .expect(tab.noRecommendationsScreen.textContent).contains('Welcome toRecommendations', 'Welcome to recommendations text not displayed'); + .expect(tab.noRecommendationsScreen.exists).ok('No tips panel not displayed') + .expect(tab.noRecommendationsScreen.textContent).contains('Welcome toTips!', 'Welcome to recommendations text not displayed'); await browserPage.InsightsPanel.togglePanel(false); // Go to 2nd database @@ -95,7 +95,7 @@ test await browserPage.InsightsPanel.togglePanel(true); // Verify that live recommendations displayed for each database separately // Verify that user can see the live recommendation "Update Redis database" when Redis database is less than 6.0 highlighted as RedisStack - tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t .expect(await tab.getRecommendationByName(redisVersionRecom).visible).ok('Redis Version recommendation not displayed') .expect(await tab.getRecommendationByName(redisTimeSeriesRecom).visible).notOk('Optimize Time Series recommendation displayed'); @@ -106,7 +106,7 @@ test // Verify that the list of recommendations updated every 10 seconds await t.wait(tenSecondsTimeout); await browserPage.InsightsPanel.togglePanel(true); - tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); // Verify that user can see the live recommendation "Optimize the use of time series" await t.expect(await tab.getRecommendationByName(redisTimeSeriesRecom).visible).ok('Optimize Time Series recommendation not displayed'); await tab.clickOnTutorialLink(redisTimeSeriesRecom); @@ -131,7 +131,7 @@ test const notUsefulVoteOption = 'not useful'; const usefulVoteOption = 'useful'; await browserPage.InsightsPanel.togglePanel(true); - await t.expect(await browserPage.InsightsPanel.getActiveTabName()).contains(ExploreTabs.Recommendations); + await t.expect(await browserPage.InsightsPanel.getActiveTabName()).contains(ExploreTabs.Tips); await recommendationsActions.voteForRecommendation(redisVersionRecom, notUsefulVoteOption); // Verify that user can rate recommendations with one of 2 existing types at the same time await recommendationsActions.verifyVoteIsSelected(redisVersionRecom, notUsefulVoteOption); @@ -147,7 +147,7 @@ test // Verify that user can see previous votes when reload the page await browserPage.reloadPage(); await browserPage.InsightsPanel.togglePanel(true); - const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await tab.toggleRecommendation(redisVersionRecom, true); await recommendationsActions.verifyVoteIsSelected(redisVersionRecom, notUsefulVoteOption); @@ -161,10 +161,10 @@ test('Verify that user can hide recommendations and checkbox value is saved', as await browserPage.Cli.sendCommandInCli(commandToGetRecommendation); await browserPage.InsightsPanel.togglePanel(true); - let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t.click(browserPage.InsightsPanel.closeButton); await browserPage.InsightsPanel.togglePanel(true); - await t.expect(await browserPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Recommendations); + await t.expect(await browserPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Tips); await tab.toggleShowHiddenRecommendations(false); await tab.hideRecommendation(searchVisualizationRecom); await t.expect(await tab.getRecommendationByName(searchVisualizationRecom).exists) @@ -173,7 +173,7 @@ test('Verify that user can hide recommendations and checkbox value is saved', as // check recommendation state is saved after reload await browserPage.reloadPage(); await browserPage.InsightsPanel.togglePanel(true); - tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t.expect(await tab.getRecommendationByName(searchVisualizationRecom).exists) .notOk('recommendation is displayed when show hide recommendation is unchecked'); @@ -183,7 +183,7 @@ test('Verify that user can hide recommendations and checkbox value is saved', as .ok('recommendation is not displayed when show hide recommendation is checked'); await browserPage.reloadPage(); await browserPage.InsightsPanel.togglePanel(true); - tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t.expect(await tab.getRecommendationByName(searchVisualizationRecom).visible) .ok('recommendation is not displayed when show hide recommendation is checked'); }); @@ -192,18 +192,18 @@ test('Verify that user can snooze recommendation', async t => { await browserPage.Cli.sendCommandInCli(commandToGetRecommendation); await browserPage.InsightsPanel.togglePanel(true); - let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await tab.snoozeRecommendation(searchVisualizationRecom); await browserPage.reloadPage(); await browserPage.InsightsPanel.togglePanel(true); - tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t.expect(await tab.getRecommendationByName(searchVisualizationRecom).visible) .notOk('recommendation is displayed when after snoozing'); await browserPage.InsightsPanel.togglePanel(false); await browserPage.Cli.sendCommandInCli(commandToGetRecommendation); await browserPage.InsightsPanel.togglePanel(true); - tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t.expect(await tab.getRecommendationByName(searchVisualizationRecom).visible).ok('recommendation is not displayed again'); }); test @@ -221,7 +221,7 @@ test })('Verify that recommendations from database analysis are displayed in Insight panel above live recommendations', async t => { await browserPage.InsightsPanel.togglePanel(true); - let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); const redisVersionRecommendationSelector = tab.getRecommendationByName(redisVersionRecom); // Verify that live recommendation displayed in Insights panel await t.expect(await tab.getRecommendationByName(redisVersionRecom).visible).ok(`${redisVersionRecom} recommendation not displayed`); @@ -232,7 +232,7 @@ test await t.click(myRedisDatabasePage.NavigationPanel.analysisPageButton); await t.click(memoryEfficiencyPage.newReportBtn); await browserPage.InsightsPanel.togglePanel(true); - tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); // Verify that recommendations are synchronized await t.expect(await tab.getRecommendationByName(setPasswordRecom).visible).ok('Recommendations are not synchronized'); // Verify that duplicates are not displayed @@ -241,7 +241,7 @@ test //https://redislabs.atlassian.net/browse/RI-4413 test('Verify that if user clicks on the Analyze button and link, the pop up with analyze button is displayed and new report is generated', async t => { await browserPage.InsightsPanel.togglePanel(true); - let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + let tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t.click(tab.analyzeDatabaseButton); await t.click(tab.analyzeTooltipButton); //Verify that user is navigated to DB Analysis page via Analyze button and new report is generated @@ -249,7 +249,7 @@ test('Verify that if user clicks on the Analyze button and link, the pop up with await t.expect(memoryEfficiencyPage.reportItem.visible).ok('Database analysis page not opened'); await t.click(memoryEfficiencyPage.NavigationPanel.workbenchButton); await workbenchPage.InsightsPanel.togglePanel(true); - tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await t.click(tab.analyzeDatabaseLink); await t.click(tab.analyzeTooltipButton); //Verify that user is navigated to DB Analysis page via Analyze link and new report is generated @@ -267,7 +267,7 @@ test await browserPage.Cli.sendCommandInCli(cliCommand); await t.click(browserPage.refreshKeysButton); await browserPage.InsightsPanel.togglePanel(true); - const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); let keyNameFromRecommendation = await tab.getRecommendationByName(RecommendationIds.searchJson) .find(tab.cssKeyName) .innerText; diff --git a/tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts b/tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts index 1d68a958c2..7b149ec5c3 100644 --- a/tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts +++ b/tests/e2e/tests/web/regression/insights/open-insights-panel.e2e.ts @@ -29,7 +29,7 @@ test('Verify Explore redis tab is opened from empty screens', async t => { await t.click(browserPage.openTutorialsBtn); await t.expect(browserPage.InsightsPanel.sidePanel.exists).ok('the panel is opened'); await t.expect(await browserPage.InsightsPanel.getActiveTabName()).eql(ExploreTabs.Explore); - await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Recommendations); + await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips); await browserPage.InsightsPanel.togglePanel(false); await t.click(browserPage.NavigationPanel.workbenchButton); await t.click(workbenchPage.exploreRedisBtn); diff --git a/tests/e2e/tests/web/regression/tree-view/tree-view.e2e.ts b/tests/e2e/tests/web/regression/tree-view/tree-view.e2e.ts index 54051b74c8..a4220f6928 100644 --- a/tests/e2e/tests/web/regression/tree-view/tree-view.e2e.ts +++ b/tests/e2e/tests/web/regression/tree-view/tree-view.e2e.ts @@ -39,11 +39,12 @@ test // Delete database await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneRedisearch); })('Verify that user can see message "No keys to display." when there are no keys in the database', async t => { - const message = 'No Keys Found\nCreate your first key to get started\nKeys are the foundation of Redis. Create your first key to start exploring Redis and Redis Stack capabilities'; - + const message = 'NoKeystoDisplayCreateyourfirstkeytogetstartedKeysarethefoundationofRedis.CreateyourfirstkeyortryourinteractiveTutorialstolearnhowRediscansolveyourusecases.+KeyorExplore'; + const actualMessage = await browserPage.keyListMessage.innerText; + const cleanMessage = actualMessage.replace(/[\s\n]+/g, ''); // Verify the message await t.click(browserPage.treeViewButton); - await t.expect(browserPage.keyListMessage.innerText).contains(message, 'The message is not displayed'); + await t.expect(cleanMessage).contains(message, 'The message is not displayed'); await t.expect(browserPage.guideLinksBtn.count).gte(5); await browserPage.clickGuideLinksByName('JSON'); await t.expect(workbenchPage.queryInput.visible).ok('Workbench page is not opened');