1
1
/** *******************************************************************
2
- * copyright (c) 2021-2024 Red Hat, Inc.
2
+ * copyright (c) 2021-2025 Red Hat, Inc.
3
3
*
4
4
* This program and the accompanying materials are made
5
5
* available under the terms of the Eclipse Public License 2.0
@@ -15,6 +15,7 @@ import {
15
15
ContextMenu ,
16
16
EditorView ,
17
17
InputBox ,
18
+ Key ,
18
19
Locators ,
19
20
NewScmView ,
20
21
SingleScmProvider ,
@@ -139,10 +140,8 @@ suite(
139
140
await projectSection . openItem ( testRepoProjectName , fileToChange ) ;
140
141
const editor : TextEditor = ( await new EditorView ( ) . openEditor ( fileToChange ) ) as TextEditor ;
141
142
await driverHelper . waitVisibility ( webCheCodeLocators . Editor . inputArea ) ;
142
- Logger . debug ( 'editor.clearText' ) ;
143
- await editor . clearText ( ) ;
144
- Logger . debug ( `editor.typeTextAt: "${ changesToCommit } "` ) ;
145
- await editor . typeTextAt ( 1 , 1 , changesToCommit ) ;
143
+ Logger . debug ( `editor.setText: "${ changesToCommit } "` ) ;
144
+ await editor . setText ( changesToCommit ) ;
146
145
} ) ;
147
146
148
147
test ( 'Open a source control manager' , async function ( ) : Promise < void > {
@@ -182,8 +181,16 @@ suite(
182
181
} ) ;
183
182
184
183
test ( 'Commit the changes' , async function ( ) : Promise < void > {
185
- Logger . debug ( `scmProvider.commitChanges: commit name "Commit ${ changesToCommit } "` ) ;
186
- await scmProvider . commitChanges ( 'Commit ' + changesToCommit ) ;
184
+ Logger . info ( `ScmView inputField locator: "${ ( webCheCodeLocators . ScmView as any ) . scmEditor } "` ) ;
185
+ Logger . debug ( 'Click on the Scm Editor' ) ;
186
+ await driverHelper
187
+ . getDriver ( )
188
+ . findElement ( ( webCheCodeLocators . ScmView as any ) . scmEditor )
189
+ . click ( ) ;
190
+ Logger . debug ( `Type commit text: "Commit ${ changesToCommit } "` ) ;
191
+ await driverHelper . getDriver ( ) . actions ( ) . sendKeys ( changesToCommit ) . perform ( ) ;
192
+ Logger . debug ( 'Press Enter to commit the changes' ) ;
193
+ await driverHelper . getDriver ( ) . actions ( ) . keyDown ( Key . CONTROL ) . sendKeys ( Key . ENTER ) . keyUp ( Key . CONTROL ) . perform ( ) ;
187
194
await driverHelper . waitVisibility ( webCheCodeLocators . ScmView . more ) ;
188
195
await driverHelper . wait ( timeToRefresh ) ;
189
196
Logger . debug ( `wait and click on: "${ refreshButtonLabel } "` ) ;
0 commit comments