@@ -9,18 +9,15 @@ type ExplainResultType = 'Schema' | 'JSON' | 'AST';
9
9
export class QueryEditor extends BaseModel {
10
10
protected readonly editorTextArea : Locator ;
11
11
protected readonly runButton : Locator ;
12
- protected readonly scanButton : Locator ;
12
+ protected readonly explainButton : Locator ;
13
13
14
14
constructor ( page : Page ) {
15
15
super ( page , page . locator ( '.query-editor' ) ) ;
16
16
17
17
this . editorTextArea = this . selector . locator ( '.query-editor__monaco textarea' ) ;
18
18
19
- this . runButton = this . selector . locator ( '.query-editor__control-run > button' ) ;
20
-
21
- this . scanButton = this . selector
22
- . locator ( '.query-editor__controls > button' )
23
- . locator ( 'nth=0' ) ;
19
+ this . runButton = this . selector . getByRole ( 'button' , { name : / R u n / } ) ;
20
+ this . explainButton = this . selector . getByRole ( 'button' , { name : / E x p l a i n / } ) ;
24
21
}
25
22
26
23
async runScript ( query : string ) {
@@ -35,7 +32,7 @@ export class QueryEditor extends BaseModel {
35
32
}
36
33
async explain ( query : string ) {
37
34
await this . editorTextArea . fill ( query ) ;
38
- await this . scanButton . click ( ) ;
35
+ await this . explainButton . click ( ) ;
39
36
}
40
37
41
38
// eslint-disable-next-line consistent-return
@@ -72,10 +69,14 @@ export class QueryEditor extends BaseModel {
72
69
}
73
70
74
71
protected async selectRunButtonType ( type : ButtonType ) {
75
- const selectRunModeButton = this . selector . locator ( '.query-editor__select-query-action' ) ;
72
+ const selectRunModeButton = this . selector . locator (
73
+ '.ydb-query-editor-controls__select-query-action' ,
74
+ ) ;
76
75
await selectRunModeButton . click ( ) ;
77
76
78
- const runModeSelect = this . page . locator ( '.query-editor__select-query-action-popup' ) ;
77
+ const runModeSelect = this . page . locator (
78
+ '.ydb-query-editor-controls__select-query-action-popup' ,
79
+ ) ;
79
80
await runModeSelect . waitFor ( { state : 'visible' } ) ;
80
81
await runModeSelect . getByText ( type ) . click ( ) ;
81
82
}
0 commit comments