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

search.html clipboard monitor, Anki add note Playwright tests #299

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

jbukl
Copy link

@jbukl jbukl commented Nov 2, 2023

Tests for search.html's clipboard monitor and adding a note to Anki. Anki responses are mocked.

  • Playwright tests for search.html and Anki add note (can add more note fields to test if wanted)
  • Enable playwright experimental SW flag needed in order to intercept requests from service workers - for both the vscode playwright extension and for the GH action workflow
  • Playwright manifest variant (extended off of chrome-dev) for playwright tests
  • Playwright global setup/teardown to use playwright manifest variant - moves clipboardRead to required permissions
  • Refactored a bit - extracted code from visual.spec.js to a new util file

notes/questions:

  • The playwright manifest setup/teardown was added because I couldn't think of a way to use optional permissions - the permission popup would appear, and simply sit there until I either manually clicked it myself, or the test times out. Googling around, the best I could find were suspect hacks - e.g. simulating arrow key/enter clicks to hit OK on the popup. The solution I used might not be preferred, so explicitly pointing it out here.

  • There's a couple places where I felt the need to add a waitForTimeout; I couldn't find a behavior to wait on instead. Can try harder to find UI behavior to wait on if desired, but so far I wasn't able to find anything.

  • The current playwright config's actionTimeout is really long - would it be OK to just remove it (which would then default it to 10 seconds)? I haven't tested without it, but I can add in longer explicit timeouts wherever needed in place of it.

  • Should audio download requests be mocked?

  • Can use less CSS locators if preferred.

  • The calls for toHaveScreenshot() in visual.spec.js seem to be causing the yomitan instance used by playwright to crash pretty often locally - don't personally have a fix for it or know for certain why.

prep tests for cicd

reorganize exports in playwright utils
@jbukl jbukl requested a review from a team as a code owner November 2, 2023 03:35
Copy link

github-actions bot commented Nov 2, 2023

✔️ No visual differences introduced by this PR.

View Playwright Report (note: open the "playwright-report" artifact)

@djahandarie djahandarie added this pull request to the merge queue Nov 2, 2023
Merged via the queue into yomidevs:master with commit caccc2f Nov 2, 2023
5 checks passed
@jbukl jbukl deleted the pw-search-anki branch November 3, 2023 02:16
@djahandarie djahandarie added the kind/meta The issue or PR is meta label Nov 10, 2023
@Casheeew Casheeew added the area/ci The issue or PR is related to continuous integration and/or continuous delivery label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci The issue or PR is related to continuous integration and/or continuous delivery kind/meta The issue or PR is meta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants