@@ -27,6 +27,7 @@ export class CliPage {
27
27
commandHelperBadge = Selector ( '[data-testid=expand-command-helper] span' ) ;
28
28
cliResizeButton = Selector ( '[data-test-subj=resize-btn-browser-cli]' ) ;
29
29
workbenchLink = Selector ( '[data-test-subj=cli-workbench-page-btn]' ) ;
30
+ returnToList = Selector ( '[data-testid=cli-helper-back-to-list-btn]' ) ;
30
31
//TEXT INPUTS (also referred to as 'Text fields')
31
32
cliCommandInput = Selector ( '[data-testid=cli-command]' ) ;
32
33
cliArea = Selector ( '[data-testid=cli' ) ;
@@ -58,7 +59,7 @@ export class CliPage {
58
59
* Select filter group type
59
60
* @param groupName The group name
60
61
*/
61
- async selectFilterGroupType ( groupName : string ) : Promise < void > {
62
+ async selectFilterGroupType ( groupName : string ) : Promise < void > {
62
63
await t . click ( this . filterGroupTypeButton ) ;
63
64
await t . click ( this . filterOptionGroupType . withExactText ( groupName ) ) ;
64
65
}
@@ -69,7 +70,7 @@ export class CliPage {
69
70
* @param amount The amount of the keys
70
71
* @param keyName The name of the keys. The default value is keyName
71
72
*/
72
- async addKeysFromCli ( keyCommand : string , amount : number , keyName = 'keyName' ) : Promise < void > {
73
+ async addKeysFromCli ( keyCommand : string , amount : number , keyName = 'keyName' ) : Promise < void > {
73
74
//Open CLI
74
75
await t . click ( this . cliExpandButton ) ;
75
76
//Add keys
@@ -83,7 +84,7 @@ export class CliPage {
83
84
* Send command in Cli
84
85
* @param command The command to send
85
86
*/
86
- async sendCommandInCli ( command : string ) : Promise < void > {
87
+ async sendCommandInCli ( command : string ) : Promise < void > {
87
88
//Open CLI
88
89
await t . click ( this . cliExpandButton ) ;
89
90
await t . typeText ( this . cliCommandInput , command , { paste : true } ) ;
@@ -95,7 +96,7 @@ export class CliPage {
95
96
* Get command result execution
96
97
* @param command The command for send in CLI
97
98
*/
98
- async getSuccessCommandResultFromCli ( command : string ) : Promise < string > {
99
+ async getSuccessCommandResultFromCli ( command : string ) : Promise < string > {
99
100
//Open CLI
100
101
await t . click ( this . cliExpandButton ) ;
101
102
//Add keys
@@ -129,7 +130,7 @@ export class CliPage {
129
130
}
130
131
131
132
/**
132
- * Check URL of command opened from command helper
133
+ * Check list of commands searched
133
134
* @param searchedCommand Searched command in Command Helper
134
135
* @param listToCompare The list with commands to compare with opened in Command Helper
135
136
*/
@@ -141,4 +142,16 @@ export class CliPage {
141
142
await t . expect ( this . cliHelperOutputTitles . nth ( i ) . textContent ) . eql ( listToCompare [ i ] , 'Results in the output contains searched value' ) ;
142
143
}
143
144
}
145
+
146
+ /**
147
+ * Check commands list
148
+ * @param listToCompare The list with commands to compare with opened in Command Helper
149
+ */
150
+ async checkCommandsInCommandHelper ( listToCompare : string [ ] ) : Promise < void > {
151
+ //Verify results in the output
152
+ const commandsCount = await this . cliHelperOutputTitles . count ;
153
+ for ( let i = 0 ; i < commandsCount ; i ++ ) {
154
+ await t . expect ( this . cliHelperOutputTitles . nth ( i ) . textContent ) . eql ( listToCompare [ i ] , 'Results in the output not contain searched value' ) ;
155
+ }
156
+ }
144
157
}
0 commit comments