Skip to content

Commit

Permalink
basics working
Browse files Browse the repository at this point in the history
  • Loading branch information
testlabauto committed Nov 22, 2024
1 parent bae3b68 commit a3a9ec7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/automation/src/playwrightDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export class PlaywrightDriver {

constructor(
private readonly application: playwright.Browser | playwright.ElectronApplication,
private readonly context: playwright.BrowserContext,
// --- Start Positron ---
// --- Start Positron --
readonly context: playwright.BrowserContext,
readonly page: playwright.Page,
// --- End Positron ---
private readonly serverProcess: ChildProcess | undefined,
Expand Down
21 changes: 21 additions & 0 deletions test/smoke/src/areas/positron/plots/plots.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,27 @@ test.describe('Plots', () => {
fail(`Image comparison failed with mismatch percentage: ${data.rawMisMatchPercentage}`);
}

await app.code.driver.page.locator('.codicon-copy').click();

// wait for clipboard to be populated
await app.code.wait(1000);

await app.code.driver.context.grantPermissions(['clipboard-read']);

const clipboardImageBuffer = await app.code.driver.page.evaluate(async () => {
const clipboardItems = await navigator.clipboard.read();
for (const item of clipboardItems) {
if (item.types.includes("image/png")) {
const blob = await item.getType("image/png");
return await blob.arrayBuffer();
}
}
return null;
});


console.log(clipboardImageBuffer);

await app.workbench.positronLayouts.enterLayout('fullSizedAuxBar');
await app.workbench.positronPlots.clearPlots();
await app.workbench.positronLayouts.enterLayout('stacked');
Expand Down

0 comments on commit a3a9ec7

Please sign in to comment.