This package provides helper methods to start the UI app of Docker Desktop from puppeteer, navigate to and test a given extension.
This package is experimental.
npm install @docker/extension-test-helper
import { DesktopUI } from '@docker/extension-test-helper';
import { exec as originalExec } from 'child_process';
import * as util from 'util';
export const exec = util.promisify(originalExec);
await exec('docker extension install -f my/extension');
const dashboard = await DesktopUI.start();
const extensionPanel = await dashboard.navigateToExtension('my/extension');
// use extensionPanel to click on buttons, make assertions etc. using puppeteer APIs
await extensionPanel.waitForSelector('#someElementId');