Skip to content

Commit 8d8a09e

Browse files
committed
another try to fix dataset history test
1 parent 16221be commit 8d8a09e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

tests/page-objects/wizard/FieldEditor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export default class FieldEditor {
3232

3333
async changeName(name: string) {
3434
await this.page.click(this.fieldNameEditBtnSelector);
35-
await this.page.click(this.fieldNameSelector);
36-
await this.page.keyboard.press('Meta+A');
37-
await this.page.keyboard.press('Backspace');
38-
await this.page.keyboard.insertText(name);
35+
const input = this.page.locator(this.fieldNameSelector);
36+
await input.press('Meta+A');
37+
await input.press('Backspace');
38+
await input.fill(name);
3939
}
4040

4141
async setFormula(formula: string) {

tests/suites/dataset/history.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ datalensTest.describe('Dataset history', () => {
561561
datalensTest('Keyboard shortcut Cmd/Ctrl+Z triggers undo', async ({page}) => {
562562
const fieldInput = getFieldNameInput(page);
563563
const {originalValue} = (await datasetPage.renameFirstField()) ?? {};
564+
const undoBtn = page.locator(slct(EditHistoryQA.UndoBtn));
565+
await expect(undoBtn).toBeEnabled();
564566
// Click outside the input to unfocus before using hotkey
565567
await page.locator(slct(DatasetFieldsTabQa.DatasetEditor)).click();
566568
await page.keyboard.press(`Meta+z`);
@@ -576,6 +578,9 @@ datalensTest.describe('Dataset history', () => {
576578
// Undo via button
577579
const undoBtn = page.locator(slct(EditHistoryQA.UndoBtn));
578580
await undoBtn.click();
581+
582+
const redoBtn = page.locator(slct(EditHistoryQA.RedoBtn));
583+
await expect(redoBtn).toBeEnabled();
579584
// Click outside the input to unfocus before using hotkey
580585
await page.locator(slct(DatasetFieldsTabQa.DatasetEditor)).click();
581586
await page.keyboard.press(`Meta+Shift+z`);

0 commit comments

Comments
 (0)