Skip to content

Commit

Permalink
tmp 2
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <[email protected]>
  • Loading branch information
djelinek committed Jul 30, 2024
1 parent f15040f commit bcc8d4e
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions packages/page-objects/src/components/editor/TextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export class TextEditor extends Editor {
const coordinates = await this.getCoordinates();
const lineGap = coordinates[0] - line;
const lineKey = lineGap >= 0 ? Key.UP : Key.DOWN;
let nextLine = coordinates[0];
// let nextLine = coordinates[0];

for (let i = 0; i < Math.abs(lineGap); i++) {
if (await this.isLine(line)) {
Expand All @@ -397,18 +397,18 @@ export class TextEditor extends Editor {
await inputArea.getDriver().actions().clear();
await inputArea.sendKeys(lineKey);
await inputArea.getDriver().sleep(500);
if (await this.isLine(line)) {
break;
}
// if (await this.isLine(line)) {
// break;
// }

switch (lineKey) {
case Key.UP:
nextLine = nextLine - 1;
break;
case Key.DOWN:
nextLine = nextLine + 1;
break;
}
// switch (lineKey) {
// case Key.UP:
// nextLine = nextLine - 1;
// break;
// case Key.DOWN:
// nextLine = nextLine + 1;
// break;
// }

// try {
// await this.waitForCursorPositionAtLine(nextLine);
Expand Down Expand Up @@ -442,7 +442,7 @@ export class TextEditor extends Editor {
const coordinates = await this.getCoordinates();
const columnGap = coordinates[1] - column;
const columnKey = columnGap >= 0 ? Key.LEFT : Key.RIGHT;
let nextCol = coordinates[1];
// let nextCol = coordinates[1];

for (let i = 0; i < Math.abs(columnGap); i++) {
if (await this.isColumn(column)) {
Expand All @@ -451,21 +451,21 @@ export class TextEditor extends Editor {
await inputArea.getDriver().actions().clear();
await inputArea.sendKeys(columnKey);
await inputArea.getDriver().sleep(500);
if (await this.isColumn(column)) {
break;
}
// if (await this.isColumn(column)) {
// break;
// }
if ((await this.getCoordinates())[0] !== coordinates[0]) {
throw new Error(`Column number ${column} is not accessible on line ${coordinates[0]}`);
}

switch (columnKey) {
case Key.LEFT:
nextCol = nextCol - 1;
break;
case Key.RIGHT:
nextCol = nextCol + 1;
break;
}
// switch (columnKey) {
// case Key.LEFT:
// nextCol = nextCol - 1;
// break;
// case Key.RIGHT:
// nextCol = nextCol + 1;
// break;
// }

// try {
// await this.waitForCursorPositionAtColumn(nextCol);
Expand Down

0 comments on commit bcc8d4e

Please sign in to comment.