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

Add gr.Image interaction test + gr.ImageEditor interaction test improvement #7309

Merged
merged 13 commits into from Feb 6, 2024

Conversation

hannahblair
Copy link
Collaborator

@hannahblair hannahblair commented Feb 5, 2024

Description

This PR adds an interaction test to assert the source selection in gr.Image behaves as expected. Note, we can't do a storybook story for this because storybook doesn't provide access to the browser context to allow us to access the permissions API and grant camera access - but we can do this with playwright.

Closes: #7308
Closes: #7310

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Feb 5, 2024

🪼 branch checks and previews

Name Status URL
Spaces building...
Website building...
Storybook ready! Storybook preview
🦄 Changes detecting...

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Feb 5, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/image patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Add gr.Image interaction test + gr.ImageEditor interaction test improvement

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@hannahblair hannahblair marked this pull request as draft February 5, 2024 17:12
@hannahblair hannahblair changed the title Add source selection interaction story for gr.Image Add source selection interaction test for gr.Image Feb 5, 2024
@hannahblair hannahblair marked this pull request as ready for review February 5, 2024 22:44
@hannahblair hannahblair changed the title Add source selection interaction test for gr.Image Add gr.Image interaction test + gr.ImageEditor interaction test improvement Feb 6, 2024
@@ -51,6 +51,9 @@

<Story
name="Image Editor Interactions"
parameters={{
diffThreshold: 0.1
Copy link
Member

Choose a reason for hiding this comment

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

Nice

on:click={select_source}
aria-label={mode === "image" ? "capture photo" : "start recording"}
aria-label="select input source"
Copy link
Member

Choose a reason for hiding this comment

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

👍

@abidlabs abidlabs added the v: patch A change that requires a patch release label Feb 6, 2024
Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

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

LGTM thanks @hannahblair!

@abidlabs
Copy link
Member

abidlabs commented Feb 6, 2024

Let me merge this in so that tests on other PRs are not flaky

@abidlabs abidlabs merged commit 200e251 into main Feb 6, 2024
8 checks passed
@abidlabs abidlabs deleted the story-source-select branch February 6, 2024 19:20
@pngwn pngwn mentioned this pull request Feb 6, 2024
freddyaboulton pushed a commit that referenced this pull request Feb 9, 2024
…mprovement (#7309)

* add source selection interaction story

* add changeset

* add source selection e2e test

* add changeset

* add diff threshold to imageeditor story

* remove redundant <button>

* add changeset

* typo

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v: patch A change that requires a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the ImageEditor interaction test more robust Add back source selection interaction test for image
3 participants