Skip to content

Commit 08af11d

Browse files
Merge pull request #130 from RedisInsight/feature/e2e-fix
fix e2e tests with cli helper
2 parents 65f7c9b + c0aeba4 commit 08af11d

File tree

4 files changed

+43
-45
lines changed

4 files changed

+43
-45
lines changed

tests/e2e/pageObjects/cli-page.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export class CliPage {
1818
cliOutputResponseFail: Selector
1919
cliArea: Selector
2020
cliCollapseButton: Selector
21-
collapseCliHelperButton: Selector
2221
cliHelperSearch: Selector
2322
cliHelperOutputTitles: Selector
2423
filterGroupTypeButton: Selector
@@ -34,6 +33,8 @@ export class CliPage {
3433
cliCommandExecuted: Selector
3534
cliReadMoreJSONCommandDocumentation: Selector
3635
cliReadMoreRediSearchCommandDocumentation: Selector
36+
expandCommandHelperButton: Selector
37+
closeCommandHelperButton: Selector
3738

3839
constructor() {
3940
//-------------------------------------------------------------------------------------------
@@ -45,7 +46,8 @@ export class CliPage {
4546
//BUTTONS
4647
this.cliExpandButton = Selector('[data-testid=expand-cli]');
4748
this.cliCollapseButton = Selector('[data-testid=collapse-cli]');
48-
this.collapseCliHelperButton = Selector('[data-testid=collapse-cli-helper]');
49+
this.expandCommandHelperButton = Selector('[data-testid=expand-command-helper]');
50+
this.closeCommandHelperButton = Selector('[data-testid=close-command-helper]');
4951
this.filterGroupTypeButton = Selector('[data-testid=select-filter-group-type]');
5052
this.filterOptionGroupType = Selector('[data-test-subj^=filter-option-group-type-]');
5153
this.readMoreButton = Selector('[data-testid=read-more]');

tests/e2e/tests/critical-path/cli/cli-command-helper.e2e.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ fixture `CLI Command helper`
3232
})
3333
test('Verify that user can see relevant search results in Command Helper per every entered symbol', async t => {
3434
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
35-
//Open CLI
36-
await t.click(cliPage.cliExpandButton);
35+
//Open Command Helper
36+
await t.click(cliPage.expandCommandHelperButton);
3737
//Start search from 1 symbol
3838
await t.typeText(cliPage.cliHelperSearch, 's');
3939
//Verify that we found commands
@@ -47,23 +47,24 @@ test('Verify that user can see relevant search results in Command Helper per eve
4747
});
4848
test('Verify that when user clears the input in the Search of CLI Helper (via x icon), he can see the default screen with proper the text', async t => {
4949
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
50-
//Open CLI
51-
await t.click(cliPage.cliExpandButton);
50+
//Open Command Helper
51+
await t.click(cliPage.expandCommandHelperButton);
5252
//Verify default text
5353
await t.expect(cliPage.cliHelperText.textContent).eql(defaultHelperText, 'Default text for CLI Helper is shown');
5454
//Search any command
5555
await t.typeText(cliPage.cliHelperSearch, 'SET');
5656
await t.expect(cliPage.cliHelperOutputTitles.count).gt(0, 'List of commands were found');
5757
//Clear search input
58-
const clearButton = await cliPage.cliHelper.find('[aria-label="Clear input"]')
58+
const clearButton = cliPage.cliHelper.find('[aria-label="Clear input"]');
5959
await t.click(clearButton);
6060
//Verify default text after clear
6161
await t.expect(cliPage.cliHelperText.textContent).eql(defaultHelperText, 'Default text for CLI Helper is shown');
6262
});
6363
test('Verify that when user enters command in CLI, Helper displays additional info about the command', async t => {
6464
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
65-
//Open CLI
65+
//Open CLI and Helper
6666
await t.click(cliPage.cliExpandButton);
67+
await t.click(cliPage.expandCommandHelperButton);
6768
//Enter command into CLI
6869
await t.typeText(cliPage.cliCommandInput, COMMAND_APPEND);
6970
//Verify details of the command
@@ -74,8 +75,9 @@ test('Verify that when user enters command in CLI, Helper displays additional in
7475
test('Verify that Command helper cleared when user runs the command in CLI', async t => {
7576
const searchText = 'sa';
7677
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
77-
//Open CLI
78+
//Open CLI and Helper
7879
await t.click(cliPage.cliExpandButton);
80+
await t.click(cliPage.expandCommandHelperButton);
7981
//Select group from list
8082
await cliPage.selectFilterGroupType(COMMAND_GROUP_SET);
8183
//Type text in search
@@ -88,8 +90,8 @@ test('Verify that Command helper cleared when user runs the command in CLI', asy
8890
});
8991
test('Verify that user can unselect the command filtered to remove filters', async t => {
9092
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
91-
//Open CLI
92-
await t.click(cliPage.cliExpandButton);
93+
//Open Command Helper
94+
await t.click(cliPage.expandCommandHelperButton);
9395
//Select one command from list
9496
await cliPage.selectFilterGroupType(COMMAND_GROUP_SET);
9597
await t.expect(cliPage.cliHelperOutputTitles.count).gt(0, 'List of commands were found');
@@ -103,8 +105,8 @@ test('Verify that user can unselect the command filtered to remove filters', asy
103105
test('Verify that when user has used search and apply filters, search results include only commands from the filter group applied', async t => {
104106
const searchText = 'sa';
105107
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
106-
//Open CLI
107-
await t.click(cliPage.cliExpandButton);
108+
//Open Command Helper
109+
await t.click(cliPage.expandCommandHelperButton);
108110
//Select group from list
109111
await cliPage.selectFilterGroupType(COMMAND_GROUP_SET);
110112
//Type text in search
@@ -117,8 +119,8 @@ test('Verify that when user has used search and apply filters, search results in
117119
test('Verify that user can type TS. in Command helper and see commands from RedisTimeSeries commands.json', async t => {
118120
const commandForSearch = 'TS.';
119121
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
120-
//Open CLI
121-
await t.click(cliPage.cliExpandButton);
122+
//Open Command Helper
123+
await t.click(cliPage.expandCommandHelperButton);
122124
//Select group from list and remeber commands
123125
await cliPage.selectFilterGroupType(COMMAND_GROUP_TIMESERIES);
124126
const commandsFilterCount = await cliPage.cliHelperOutputTitles.count;
@@ -139,8 +141,8 @@ test('Verify that user can type TS. in Command helper and see commands from Redi
139141
test('Verify that user can type GRAPH. in Command helper and see auto-suggestions from RedisGraph commands.json', async t => {
140142
const commandForSearch = 'GRAPH.';
141143
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
142-
//Open CLI
143-
await t.click(cliPage.cliExpandButton);
144+
//Open Command Helper
145+
await t.click(cliPage.expandCommandHelperButton);
144146
//Select group from list and remeber commands
145147
await cliPage.selectFilterGroupType(COMMAND_GROUP_GRAPH);
146148
const commandsFilterCount = await cliPage.cliHelperOutputTitles.count;

tests/e2e/tests/regression/cli/cli-command-helper.e2e.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ const getPageUrl = ClientFunction(() => window.location.href);
3434
test('Verify that user can see in Command helper and click on new group "JSON", can choose it and see list of commands in the group', async t => {
3535
const commandForCheck = 'JSON.SET';
3636
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
37-
//Open CLI
38-
await t.click(cliPage.cliExpandButton);
37+
//Open Command Helper
38+
await t.click(cliPage.expandCommandHelperButton);
3939
//Select one command from the list
4040
await cliPage.selectFilterGroupType(COMMAND_GROUP_JSON);
4141
await t.click(cliPage.cliHelperOutputTitles.withExactText(commandForCheck));
@@ -51,8 +51,8 @@ test('Verify that user can see in Command helper and click on new group "JSON",
5151
test('Verify that user can see in Command helper and click on new group "Search", can choose it and see list of commands in the group', async t => {
5252
const commandForCheck = 'FT.EXPLAIN';
5353
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
54-
//Open CLI
55-
await t.click(cliPage.cliExpandButton);
54+
//Open Command Helper
55+
await t.click(cliPage.expandCommandHelperButton);
5656
//Select one command from the list
5757
await cliPage.selectFilterGroupType(COMMAND_GROUP_SEARCH);
5858
await t.click(cliPage.cliHelperOutputTitles.withExactText(commandForCheck));
@@ -68,8 +68,8 @@ test('Verify that user can see in Command helper and click on new group "Search"
6868
test('Verify that user can see HyperLogLog title in Command Helper for this command group', async t => {
6969
const commandForCheck = 'PFCOUNT';
7070
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
71-
//Open CLI
72-
await t.click(cliPage.cliExpandButton);
71+
//Open Command Helper
72+
await t.click(cliPage.expandCommandHelperButton);
7373
//Select one command from the list
7474
await cliPage.selectFilterGroupType(COMMAND_GROUP_HyperLogLog);
7575
await t.click(cliPage.cliHelperOutputTitles.withExactText(commandForCheck));
@@ -106,8 +106,8 @@ test('Verify that user can see all separated groups for AI json file (model, ten
106106
'/#aitensorset'
107107
];
108108
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
109-
//Open CLI
110-
await t.click(cliPage.cliExpandButton);
109+
//Open Command Helper
110+
await t.click(cliPage.expandCommandHelperButton);
111111
let i = 0;
112112
while (i <= 3) {
113113
//Select one group from the list

tests/e2e/tests/smoke/cli/cli-command-helper.e2e.ts

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,20 @@ fixture `CLI Command helper`
2727
await t.expect(addRedisDatabasePage.addDatabaseButton.exists).ok('The add redis database view', { timeout: 20000 });
2828
await addNewStandaloneDatabase(ossStandaloneConfig);
2929
})
30-
test('Verify that user can see Command helper opened by default when he opens CLI', async t => {
31-
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
32-
//Open CLI
33-
await t.click(cliPage.cliExpandButton);
34-
//Verify that the Command helper opened by default
35-
await t.expect(cliPage.cliHelperText.textContent).eql('Enter any command in CLI or use search to see detailed information.', 'Command helper');
36-
});
3730
test('Verify that user can close Command helper', async t => {
3831
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
39-
//Open CLI
40-
await t.click(cliPage.cliExpandButton);
32+
//Open Command Helper
33+
await t.click(cliPage.expandCommandHelperButton);
4134
//Close Command helper
42-
await t.click(cliPage.collapseCliHelperButton);
35+
await t.click(cliPage.closeCommandHelperButton);
4336
//Verify that the Command helper is closed
4437
await t.expect(cliPage.cliHelperText.visible).eql(false, 'Command helper');
4538
});
4639
test('Verify that user can search per command in Command Helper and see relevant results', async t => {
4740
const commandForSearch = 'ADD';
4841
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
49-
//Open CLI
50-
await t.click(cliPage.cliExpandButton);
42+
//Open Command Helper
43+
await t.click(cliPage.expandCommandHelperButton);
5144
//Search per command
5245
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
5346
//Verify results in the output
@@ -59,8 +52,8 @@ test('Verify that user can search per command in Command Helper and see relevant
5952
test('Verify that user can select one of the commands from the list of commands described in the Groups table', async t => {
6053
const commandForCheck = 'SADD';
6154
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
62-
//Open CLI
63-
await t.click(cliPage.cliExpandButton);
55+
//Open Command Helper
56+
await t.click(cliPage.expandCommandHelperButton);
6457
//Select one command from list
6558
await cliPage.selectFilterGroupType(COMMAND_GROUP_SET);
6659
await t.click(cliPage.cliHelperOutputTitles.withExactText(commandForCheck));
@@ -70,8 +63,8 @@ test('Verify that user can select one of the commands from the list of commands
7063
test('Verify that user can click on any of searched commands in Command Helper and see details of the command', async t => {
7164
const commandForSearch = 'Ap';
7265
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
73-
//Open CLI
74-
await t.click(cliPage.cliExpandButton);
66+
//Open Command Helper
67+
await t.click(cliPage.expandCommandHelperButton);
7568
//Select one command from list of searched commands
7669
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
7770
await t.click(cliPage.cliHelperOutputTitles.withExactText(COMMAND_APPEND));
@@ -84,24 +77,25 @@ test('Verify that when user enters command, he can see Command Name, Complexity,
8477
const commandForSearch = 'pop';
8578
const commandForCheck = 'LPOP';
8679
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
87-
//Open CLI
88-
await t.click(cliPage.cliExpandButton);
80+
//Open Command Helper
81+
await t.click(cliPage.expandCommandHelperButton);
8982
//Select one command from list of searched commands
9083
await t.typeText(cliPage.cliHelperSearch, commandForSearch);
9184
await t.click(cliPage.cliHelperOutputTitles.withExactText(commandForCheck));
9285
//Verify details of the command
9386
await t.expect(cliPage.cliHelperTitleArgs.innerText).eql('LPOP key [count]', 'Command Name');
9487
await t.expect(cliPage.cliHelperComplexity.innerText).eql('Complexity:\nO(N) where N is the number of elements returned', 'Complexity');
95-
await t.expect(cliPage.cliHelperArguments.innerText).eql('Arguments:\nkey\nRequired\n[count]\nOptional', 'Arguments');
88+
await t.expect(cliPage.cliHelperArguments.innerText).eql('Arguments:\nRequired\nkey\nOptional\n[count]', 'Arguments');
9689
await t.expect(cliPage.cliHelperSummary.innerText).contains('Remove and get the first elements in a list', 'Command Summary');
9790
await t.expect(cliPage.cliHelperTitle.innerText).contains('LIST', 'Command Group');
9891
await t.expect(cliPage.readMoreButton.exists).ok('Read more button');
9992
});
10093
test('Verify that user can see that command is autocompleted in CLI with required arguments', async t => {
10194
const command = 'HDEL';
10295
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
103-
//Open CLI
96+
//Open CLI and Helper
10497
await t.click(cliPage.cliExpandButton);
98+
await t.click(cliPage.expandCommandHelperButton);
10599
//Search for the command and remember arguments
106100
await t.typeText(cliPage.cliHelperSearch, command);
107101
await t.click(cliPage.cliHelperOutputTitles.withExactText(command));

0 commit comments

Comments
 (0)