Skip to content

Commit 9bb6547

Browse files
committed
moved togglePanel to NavigationHeader
1 parent 095a7ce commit 9bb6547

21 files changed

+76
-78
lines changed

tests/e2e/pageObjects/components/insights-panel.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import { Selector, t } from 'testcafe';
22
import { ExploreTabs } from '../../helpers/constants';
33
import { RecommendationsTab } from './recommendations-tab';
44
import { ExploreTab } from './explore-tab';
5-
import { NavigationHeader } from './navigation/navigation-header';
65

76
export class InsightsPanel {
8-
NavigationHeader = new NavigationHeader();
9-
107
// CONTAINERS
118
sidePanel = Selector('[data-testid=side-panels-insights]');
129
closeButton = Selector('[data-testid=close-insights-btn]');
@@ -20,24 +17,13 @@ export class InsightsPanel {
2017

2118
activeTabMask = '[class*=euiTab-isSelected]';
2219

23-
/**
24-
* Open/Close Panel
25-
* @param state State of panel
26-
*/
27-
async togglePanel(state: boolean): Promise<void> {
28-
const isPanelExists = await this.sidePanel.exists;
29-
30-
if (state !== isPanelExists) {
31-
await t.click(this.NavigationHeader.insightsTriggerButton);
32-
}
33-
}
34-
3520
/**
3621
* get active tab
3722
*/
3823
async getActiveTabName(): Promise<string> {
3924
return (this.sidePanel.find(this.activeTabMask)).textContent;
4025
}
26+
4127
/**
4228
* Click on Panel tab
4329
* @param type of the tab
@@ -66,5 +52,4 @@ export class InsightsPanel {
6652
getInsightsPanel(): Selector {
6753
return Selector('[class=euiButton__text]').withExactText(ExploreTabs.Tips);
6854
}
69-
7055
}
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
import { Selector } from 'testcafe';
1+
import { t, Selector } from 'testcafe';
2+
import { InsightsPanel } from '../insights-panel';
23

34
export class NavigationHeader {
45
insightsTriggerButton = Selector('[data-testid=insights-trigger]');
56
cloudSignInButton = Selector('[data-testid=cloud-sign-in-btn]');
7+
8+
/**
9+
* Open/Close Panel
10+
* @param state State of panel
11+
*/
12+
async togglePanel(state: boolean): Promise<void> {
13+
const isPanelExists = await (new InsightsPanel()).sidePanel.exists;
14+
15+
if (state !== isPanelExists) {
16+
await t.click(this.insightsTriggerButton);
17+
}
18+
}
619
}

tests/e2e/tests/electron/critical-path/files-auto-update/enablement-area-autoupdate.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if (fs.existsSync(workingDirectory)) {
4949
await t.click(myRedisDatabasePage.NavigationPanel.workbenchButton);
5050

5151
// Check Enablement area and validate that removed file is existed in Guides
52-
await workbenchPage.InsightsPanel.togglePanel(true);
52+
await workbenchPage.NavigationHeader.togglePanel(true);
5353
const tab = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
5454
await t.click(tab.guidesGraphAccordion);
5555
await t.click(tab.guidesIntroductionGraphLink.nth(1));

tests/e2e/tests/electron/regression/workbench/redis-stack-commands.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fixture `Redis Stack command in Workbench`
2828
//skipped due the inaccessibility of the iframe
2929
test.skip('Verify that user can switches between Graph and Text for GRAPH command and see results corresponding to their views', async t => {
3030
// Send Graph command
31-
await workbenchPage.InsightsPanel.togglePanel(true);
31+
await workbenchPage.NavigationHeader.togglePanel(true);
3232
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
3333
await t.click(tutorials.redisStackTutorialsButton);
3434
await t.click(tutorials.tutorialsWorkingWithGraphLink);
@@ -45,7 +45,7 @@ test.skip('Verify that user can switches between Graph and Text for GRAPH comman
4545
//skipped due to Graph no longer displayed in tutorials
4646
test.skip('Verify that user can see "No data to visualize" message for Graph command', async t => {
4747
// Send Graph command
48-
await workbenchPage.InsightsPanel.togglePanel(true);
48+
await workbenchPage.NavigationHeader.togglePanel(true);
4949
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
5050
await t.click(tutorials.redisStackTutorialsButton);
5151
await tutorials.runBlockCode('Show all sales per region');

tests/e2e/tests/web/critical-path/cluster-details/cluster-details.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ test
7575
await t.expect(clusterDetailsPage.tableRow.nth(nodes.indexOf(node)).textContent).contains(node, `Node ${node} is not displayed in table`);
7676
}
7777
//Run Create hash index command to load network and memory
78-
await clusterDetailsPage.InsightsPanel.togglePanel(true);
78+
await clusterDetailsPage.NavigationHeader.togglePanel(true);
7979
const tutorials = await clusterDetailsPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
8080

8181
await t.click(tutorials.dataStructureAccordionTutorialButton);

tests/e2e/tests/web/critical-path/database-overview/database-overview.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ test
156156
await t.expect(browserPage.OverviewPanel.overviewCommandsSec.exists).ok('Commands/Sec is dispalyed in the Overview');
157157
await t.expect(browserPage.OverviewPanel.overviewCpu.exists).ok('CPU (%) is dispalyed in the Overview');
158158
//Run Create hash index command
159-
await browserPage.InsightsPanel.togglePanel(true);
159+
await browserPage.NavigationHeader.togglePanel(true);
160160
const tutorials = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
161161
await t.click(tutorials.dataStructureAccordionTutorialButton);
162162
await t.click(tutorials.internalLinkWorkingWithHashes);

tests/e2e/tests/web/critical-path/database/modules.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test('Verify that user can see full module list in the Edit mode', async t => {
6565
await t.expect(myRedisDatabasePage.connectionTypeTitle.visible).ok('connection type column not found');
6666
// Open Edit mode
6767
await t.click(myRedisDatabasePage.editDatabaseButton);
68-
await myRedisDatabasePage.InsightsPanel.togglePanel(true);
68+
await myRedisDatabasePage.NavigationHeader.togglePanel(true);
6969
// Verify that module column is not displayed
7070
await t.expect(myRedisDatabasePage.connectionTypeTitle.visible).notOk('connection type column not found');
7171
// Verify modules in Edit mode

tests/e2e/tests/web/critical-path/memory-efficiency/recommendations.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ test
192192
await t.expect(recommendation.exists).ok('Query and search JSON documents recommendation not displayed');
193193
// Verify that tutorial opened
194194
await t.click(memoryEfficiencyPage.getToTutorialBtnByRecomName(searchJsonRecommendation));
195-
await workbenchPage.InsightsPanel.togglePanel(true);
195+
await workbenchPage.NavigationHeader.togglePanel(true);
196196
const tutorial = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Tutorials);
197197
await t.expect(tutorial.preselectArea.visible).ok('Workbench Enablement area not opened');
198198
// Verify that REDIS FOR TIME SERIES tutorial expanded

tests/e2e/tests/web/critical-path/rdi/navigation.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ test('Verify that context is saved after navigation panel', async() => {
8080

8181
test('Verify that Insight and Sign in buttons are displayed ', async() => {
8282
await t.expect(rdiInstancePage.NavigationHeader.insightsTriggerButton.exists).ok('Insight panel is not exist');
83-
await rdiInstancePage.RdiHeader.InsightsPanel.togglePanel(true);
83+
await rdiInstancePage.NavigationHeader.togglePanel(true);
8484
const tab = await rdiInstancePage.RdiHeader.InsightsPanel.getActiveTabName();
8585
await t.expect(tab).eql('Tutorials');
8686
await t.expect(rdiInstancePage.NavigationHeader.cloudSignInButton.exists).ok('sight in button is not exist');

tests/e2e/tests/web/critical-path/rdi/rdi-recommendation.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fixture.skip `Rdi recommendation`
2828
});
2929
// it doesn't work until recommendation.json is not updated
3030
test('Verify that rdi recommendation is displayed for oss cluster', async() => {
31-
await browserPage.InsightsPanel.togglePanel(true);
31+
await browserPage.NavigationHeader.togglePanel(true);
3232
const tab = await browserPage.InsightsPanel.setActiveTab(ExploreTabs.Tips);
3333
await t.expect(tab.getRecommendationByName(rdiRecommendation).exists).ok('Redis Version recommendation not displayed');
3434
await tab.clickOnNavigationButton(rdiRecommendation);

0 commit comments

Comments
 (0)