Skip to content

Commit 7c96120

Browse files
test: update playwright tests
1 parent 54cf151 commit 7c96120

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/suites/tenant/queryEditor/QueryEditor.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ type ExplainResultType = 'Schema' | 'JSON' | 'AST';
99
export class QueryEditor extends BaseModel {
1010
protected readonly editorTextArea: Locator;
1111
protected readonly runButton: Locator;
12-
protected readonly scanButton: Locator;
12+
protected readonly explainButton: Locator;
1313

1414
constructor(page: Page) {
1515
super(page, page.locator('.query-editor'));
1616

1717
this.editorTextArea = this.selector.locator('.query-editor__monaco textarea');
1818

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: /Run/});
20+
this.explainButton = this.selector.getByRole('button', {name: /Explain/});
2421
}
2522

2623
async runScript(query: string) {
@@ -35,7 +32,7 @@ export class QueryEditor extends BaseModel {
3532
}
3633
async explain(query: string) {
3734
await this.editorTextArea.fill(query);
38-
await this.scanButton.click();
35+
await this.explainButton.click();
3936
}
4037

4138
// eslint-disable-next-line consistent-return
@@ -72,10 +69,14 @@ export class QueryEditor extends BaseModel {
7269
}
7370

7471
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+
);
7675
await selectRunModeButton.click();
7776

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+
);
7980
await runModeSelect.waitFor({state: 'visible'});
8081
await runModeSelect.getByText(type).click();
8182
}

0 commit comments

Comments
 (0)