Skip to content

e2e test - zoom plot #8370

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

Merged
merged 58 commits into from
Jul 23, 2025
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a63402a
e2e test - zoom plot
rodrigosf672 Jul 1, 2025
91b6a64
apply feedback and remove R test due to lack of triggerandclick menu …
rodrigosf672 Jul 15, 2025
971219a
revert push button to prevent flakiness
rodrigosf672 Jul 16, 2025
611b6df
playbutton
rodrigosf672 Jul 21, 2025
335b381
Update README.md (#8360)
jthomasmock Jul 1, 2025
5a05193
data explorer: change `APPLY FILTER` to title case (#8351)
isabelizimm Jul 1, 2025
2215759
Improve keyboard navigation for Plots (#8369)
jmcphers Jul 2, 2025
6d460d8
Offer an affordance for interrupting the session in order to reconnec…
jmcphers Jul 2, 2025
61b97df
Automation PR: Update rstudio.rstudio-workbench to 1.5.51 (#8403)
posit-jenkins-enterprise[bot] Jul 3, 2025
5983b5a
python upstream merge v2025.8.0 (#8387)
austin3dickey Jul 3, 2025
e386dc5
Easier to read Anthropic trace logging (#8407)
jcheng5 Jul 3, 2025
1648f98
Add support for native IPC to kernel supervisor (#8366)
jmcphers Jul 7, 2025
4f5177f
Switch notebooks 2.0 to separate editor (#8380)
nstrayer Jul 7, 2025
cb23857
e2e test: notebook pom & skip web (#8428)
midleman Jul 7, 2025
1a4f902
Prevent `@examples` from bleeding out (#8379)
DavisVaughan Jul 8, 2025
1d3d802
E2E test: conditionally add --disable-dev-shm-usage for docker execut…
testlabauto Jul 8, 2025
da94551
python ci: unpin scipy (#8441)
austin3dickey Jul 8, 2025
adc5d96
Add LLM tools for R package help & vignettes (#8421)
jmcphers Jul 8, 2025
395ab06
Feature/console font (#8445)
softwarenerd Jul 9, 2025
737a7ad
Automation PR: Update rstudio.rstudio-workbench to 1.5.52 (#8448)
posit-jenkins-enterprise[bot] Jul 9, 2025
4b9679f
e2e test: switch data explorer test from beforeAll to beforeEach for …
midleman Jul 9, 2025
2eb8a0e
Fix failing test with IPython < 9.0.0 (#8438)
seeM Jul 9, 2025
331bcaf
Assistant: Shows all providers on launch (#8458)
samclark2015 Jul 9, 2025
6ceef60
python upstream merge v2025.8.1 (#8459)
austin3dickey Jul 9, 2025
57d394b
add Posit Connect Cloud domains for Publisher extension (#8455)
mslynch Jul 9, 2025
263c969
assistant: enable `documentCreate` tool in Edit mode (#8466)
sharon-wang Jul 10, 2025
cd0b469
Assistant token counts (#8461)
timtmok Jul 10, 2025
f90c000
tell users to install numpy for polars histograms (#8444)
isabelizimm Jul 10, 2025
c042048
E2E test: allow kernel names with special characters (#8479)
testlabauto Jul 10, 2025
a700f94
assistant: export chat log to file (request, response, tool call inpu…
sharon-wang Jul 10, 2025
61bc3db
Fix/action bar theme issues (#8468)
softwarenerd Jul 11, 2025
dc46124
E2E test: fix for connections test for docker (#8487)
testlabauto Jul 11, 2025
68b099f
Anthropic token usage displayed in chat history (#8493)
timtmok Jul 14, 2025
3615e10
assistant: disable run/debug play button when chat is in an editor (#…
sharon-wang Jul 14, 2025
66ef3c4
assistant: rename the `/quarto` command to `/exportQuarto` (#8497)
sharon-wang Jul 15, 2025
11fac55
Add token usage preference (#8508)
timtmok Jul 16, 2025
3f89b05
PositroNB config with editor associations (#8524)
nstrayer Jul 16, 2025
06c1865
e2e: skip conda new folder flow test (#8551)
midleman Jul 16, 2025
5bacc6c
ci: fix Conda ToS error (#8547)
midleman Jul 16, 2025
056ed16
assistant: use editor participant handling for notebook participant (…
sharon-wang Jul 16, 2025
27d941c
e2e: skip new folder flow conda (#8557)
midleman Jul 16, 2025
6d532cb
e2e Test Stability: Ensure signout of assistant (#8560)
jonvanausdeln Jul 16, 2025
83cf3b6
Don't leak RUST_LOG into supervisor (#8541)
jmcphers Jul 16, 2025
a36cf0d
Add user control of assistant session context (#8495)
jmcphers Jul 16, 2025
7d1fc88
e2e: skip assistant chat tokens test (#8567)
midleman Jul 17, 2025
4471693
ci: conda fix (#8566)
midleman Jul 17, 2025
c390d8c
Use ai-sdk for token usage (#8561)
timtmok Jul 17, 2025
8216acb
e2e Test: Disable assistant chat token test on web (#8569)
jonvanausdeln Jul 17, 2025
d265821
python: remove link handler for native repl (#8571)
isabelizimm Jul 17, 2025
63d2231
Assistant: Chat status hides when not applicable (#8514)
samclark2015 Jul 17, 2025
c834665
Refactor how services are provided to React components (#8516)
softwarenerd Jul 17, 2025
51f247b
Restore default log level to INFO (#8576)
jmcphers Jul 18, 2025
e6500cd
Python: Safely and efficiently compute variable display values (#8545)
seeM Jul 18, 2025
087209d
Link to commercial license (#8575)
timtmok Jul 18, 2025
14d06ce
Assistant: Initial pass at implementing a data summary tool for Pytho…
melissa-barca Jul 18, 2025
cf2cf44
pin uv to 0.7.22 in the GitHub Action (#8585)
jonvanausdeln Jul 18, 2025
40bcbbf
e2e: add outline for `copy as code` test & refactor popups/modals/dia…
midleman Jul 19, 2025
0f21180
Merge branch 'main' into rsf/zoom-plot
rodrigosf672 Jul 21, 2025
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
38 changes: 38 additions & 0 deletions test/e2e/tests/plots/plots.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,44 @@ test.describe('Plots', { tag: [tags.PLOTS, tags.EDITOR] }, () => {
const data = await resembleCompareImages(bufferAfterZoom, bufferBeforeZoom, options);
expect(data.rawMisMatchPercentage).toBeGreaterThan(0.0);
});

test('Python - Verify Plot Zoom works (Fit vs. 200%)', async function ({ app, contextMenu, openFile, python, page }, testInfo) {
await openFile(path.join('workspaces', 'python-plots', 'matplotlib-zoom-example.py'));
await test.step('Run Python File in Console', async () => {
await app.workbench.editor.playButton.click();
await app.workbench.plots.waitForCurrentPlot();
});
const imgLocator = page.getByRole('img', { name: /%run/ });
await contextMenu.triggerAndClick({
menuTrigger: page.getByLabel('Fit'),
menuItemLabel: 'Fit'
});
await page.waitForTimeout(300);
const bufferFit1 = await imgLocator.screenshot();
await contextMenu.triggerAndClick({
menuTrigger: page.getByLabel('Fit'),
menuItemLabel: '200%'
});
await page.waitForTimeout(2000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to check for the plot instead of a wait? These can just be very brittle, but sometimes I know they are unavoidable.

Copy link
Contributor Author

@rodrigosf672 rodrigosf672 Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a way, which I had adopted before pushing this. The problem is that the "plot" appears and then there is a lagging-shimmering effect that occurs (hence messing up with screenshot). Do you think it'd be better to add the wait and then the timeout afterwards, just to be safe (and to have more specific error if it occurs)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha. Great minds think alike. 🤓

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it acceptable for the test to check image size instead? The zoom level affects the image scaling and that should be a resilient check over comparing to reference images.

I could also add some class attributes to the img element if that helps signal the zoom level has been applied.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a note: this doesn't actually use reference images, but rather the buffers returned from page.screenshot(). Thats not to say that using the sizes wouldn't also work... just not sure what the size of a truncated image is in playwright.

const bufferZoom = await imgLocator.screenshot();
// Compare: Fit vs 200%
const resultZoom = await resembleCompareImages(bufferFit1, bufferZoom, options);
await testInfo.attach('fit-vs-zoom', {
body: resultZoom.getBuffer(true),
contentType: 'image/png'
});
expect(resultZoom.rawMisMatchPercentage).toBeGreaterThan(2); // should be large diff
await contextMenu.triggerAndClick({
menuTrigger: page.getByLabel('200%'),
menuItemLabel: 'Fit'
});
await page.waitForTimeout(2000);
const bufferFit2 = await imgLocator.screenshot();
// Compare: Fit vs Fit again
const resultBack = await resembleCompareImages(bufferFit1, bufferFit2, options);
expect(resultBack.rawMisMatchPercentage).toBeLessThan(0.5); // should be small diff
});

});

test.describe('R Plots', {
Expand Down
Loading