mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-21 00:21:35 +03:00
27 lines
777 B
TypeScript
27 lines
777 B
TypeScript
import { spawnSync } from 'node:child_process';
|
|
|
|
export async function spawnAndLog(command: string, args: string[]) {
|
|
const result = spawnSync(command, args);
|
|
console.log(`Exec command: ${command} ${args.join(' ')}`);
|
|
console.log('==== STDOUT ====\n', result.stdout?.toString());
|
|
console.log('==== STDERR ====\n', result.stderr?.toString());
|
|
console.log('==== EXIT STATUS ====\n', result.status);
|
|
return result.status;
|
|
}
|
|
|
|
export async function findAndClick(selector: string) {
|
|
const button = await $(selector);
|
|
await button.isClickable();
|
|
await button.click();
|
|
}
|
|
|
|
export async function setElementValue(targetElement: WebdriverIO.Element, value: string) {
|
|
await browser.execute(
|
|
(input, path) => {
|
|
(input as any).value = path;
|
|
},
|
|
targetElement,
|
|
value
|
|
);
|
|
}
|