Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E tests: remove dispatchKeyBinding #5762

Merged
merged 8 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/automation/src/positron/positronConsole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export class PositronConsole {
await this.quickinput.waitForQuickInputOpened();
await this.quickinput.type(languageName);
await this.quickinput.waitForQuickInputElements(e => e.length === 1 && e[0] === languageName);
await this.code.dispatchKeybinding('enter');
await this.code.driver.page.keyboard.press('Enter');

await this.quickinput.waitForQuickInputOpened();
const unescapedCode = code
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r');
await this.quickinput.type(unescapedCode);
await this.code.dispatchKeybinding('enter');
await this.code.driver.page.keyboard.press('Enter');
await this.quickinput.waitForQuickInputClosed();

// The console will show the prompt after the code is done executing.
Expand Down
14 changes: 7 additions & 7 deletions test/automation/src/positron/positronDataExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,31 +152,31 @@ export class PositronDataExplorer {
}

async home(): Promise<void> {
await this.code.dispatchKeybinding('home');
await this.code.driver.page.keyboard.press('Home');
}

async cmdCtrlHome(): Promise<void> {
if (process.platform === 'darwin') {
await this.code.dispatchKeybinding('cmd+home');
await this.code.driver.page.keyboard.press('Meta+Home');
} else {
await this.code.dispatchKeybinding('ctrl+home');
await this.code.driver.page.keyboard.press('Control+Home');
}
}

async arrowDown(): Promise<void> {
await this.code.dispatchKeybinding('ArrowDown');
await this.code.driver.page.keyboard.press('ArrowDown');
}

async arrowRight(): Promise<void> {
await this.code.dispatchKeybinding('ArrowRight');
await this.code.driver.page.keyboard.press('ArrowRight');
}

async arrowUp(): Promise<void> {
await this.code.dispatchKeybinding('ArrowUp');
await this.code.driver.page.keyboard.press('ArrowUp');
}

async arrowLeft(): Promise<void> {
await this.code.dispatchKeybinding('ArrowLeft');
await this.code.driver.page.keyboard.press('ArrowLeft');
}

async getColumnMissingPercent(rowNumber: number): Promise<string> {
Expand Down
1 change: 0 additions & 1 deletion test/e2e/areas/console/console-python.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ test.describe('Console Pane: Python', { tag: [tags.WEB, tags.WIN, tags.CONSOLE]

await app.workbench.positronConsole.interruptExecution();

await app.workbench.positronConsole.waitForConsoleContents('KeyboardInterrupt');
});
});
2 changes: 1 addition & 1 deletion test/e2e/areas/r-markdown/r-markdown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.describe('R Markdown', { tag: [tags.WEB, tags.R_MARKDOWN] }, () => {
// test depends on the previous test
test('Preview R Markdown [C709147]', async function ({ app, r }) {
// Preview
await app.code.dispatchKeybinding(process.platform === 'darwin' ? 'cmd+shift+k' : 'ctrl+shift+k');
await app.code.driver.page.keyboard.press(process.platform === 'darwin' ? 'Meta+Shift+K' : 'Control+Shift+K');

// inner most frame has no useful identifying features
// not factoring this locator because its not part of positron
Expand Down
Loading