Skip to content

Commit

Permalink
Replace deprecated use of type
Browse files Browse the repository at this point in the history
Change-Id: I660f7830a97df462174251ce2417a69b3b568d93
  • Loading branch information
planger committed Mar 14, 2024
1 parent 06767e7 commit 75a29ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/playwright/src/theia-quick-command-palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { ElementHandle } from '@playwright/test';
import { TheiaPageObject } from './theia-page-object';
import { OSUtil, USER_KEY_TYPING_DELAY } from './util';
import { OSUtil } from './util';

export class TheiaQuickCommandPalette extends TheiaPageObject {

Expand Down Expand Up @@ -66,7 +66,7 @@ export class TheiaQuickCommandPalette extends TheiaPageObject {
const input = await this.page.waitForSelector(`${this.selector} .monaco-inputbox .input`);
if (input != null) {
await input.focus();
await input.type(value, { delay: USER_KEY_TYPING_DELAY });
await input.fill(value);
if (confirm) {
await this.page.keyboard.press('Enter');
}
Expand Down
5 changes: 2 additions & 3 deletions examples/playwright/src/theia-rename-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
// *****************************************************************************

import { TheiaDialog } from './theia-dialog';
import { OSUtil, USER_KEY_TYPING_DELAY } from './util';
import { OSUtil } from './util';

export class TheiaRenameDialog extends TheiaDialog {

async enterNewName(newName: string): Promise<void> {
const inputField = await this.page.waitForSelector(`${this.blockSelector} .theia-input`);
await inputField.press(OSUtil.isMacOS ? 'Meta+a' : 'Control+a');
await inputField.type(newName, { delay: USER_KEY_TYPING_DELAY });
await this.page.waitForTimeout(USER_KEY_TYPING_DELAY);
await inputField.fill(newName);
}

async confirm(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion examples/playwright/src/theia-terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class TheiaTerminal extends TheiaView {
async write(text: string): Promise<void> {
await this.activate();
const input = await this.waitForInputArea();
await input.type(text);
await input.fill(text);
}

async contents(): Promise<string> {
Expand Down
2 changes: 0 additions & 2 deletions examples/playwright/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { ElementHandle } from '@playwright/test';
import { tmpdir, platform } from 'os';
import { sep } from 'path';

export const USER_KEY_TYPING_DELAY = 80;

export function normalizeId(nodeId: string): string {
// Special characters (i.e. in our case '.',':','/','%', and '\\') in CSS IDs have to be escaped
return nodeId.replace(/[.:,%/\\]/g, matchedChar => '\\' + matchedChar);
Expand Down

0 comments on commit 75a29ae

Please sign in to comment.