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

Pattern directory images cause tests to fail #101

Closed
1 task done
peterwilsoncc opened this issue Jul 5, 2023 · 0 comments · Fixed by #105
Closed
1 task done

Pattern directory images cause tests to fail #101

peterwilsoncc opened this issue Jul 5, 2023 · 0 comments · Fixed by #105
Assignees
Labels
type:bug Something isn't working.
Milestone

Comments

@peterwilsoncc
Copy link
Contributor

Describe the bug

In recent versions of WordPress, pattern directory images are included in the editor from the domain pd.w.org.

Accessing these images triggers an error causing Cypress to fail, see this example run of the E2E tests.

According to a post on Stack Overflow, it's required to create an image proxy.

As this affects multiple repositories using this library, it would be good to figure out the cause here.

Steps to Reproduce

  1. Clone this repo, run npm i; npm run build; npm run env:start
  2. Run the cypress tests in your browser: npm run cypress:open
  3. Run the insert-block.test.js fixture
  4. Observe an error is thrown relating to the loading of the image https://pd.w.org/2023/04/654642d52f20d6367.57324872.jpg

Screenshots, screen recording, code snippet

Console:

Error: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.

  > FastAverageColor: Error loading image "https://pd.w.org/2023/04/654642d52f20d6367.57324872.jpg".

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.

This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.
    at Ql (http://localhost:8889/wp-includes/js/dist/block-library.min.js?ver=3115f0b5551a55bb6d3b:14:2767)
    at Image.l (http://localhost:8889/wp-includes/js/dist/block-library.min.js?ver=3115f0b5551a55bb6d3b:14:5938)
From previous event:
    at CommandQueue.run (http://localhost:8889/__cypress/runner/cypress_runner.js:171796:21)
    at CommandQueue.run (http://localhost:8889/__cypress/runner/cypress_runner.js:156437:15)
    at $Cy.runQueue (http://localhost:8889/__cypress/runner/cypress_runner.js:157474:14)
    at cy.<computed> [as createPost] (http://localhost:8889/__cypress/runner/cypress_runner.js:157583:12)
    at __stackReplacementMarker (http://localhost:8889/__cypress/runner/cypress_runner.js:156944:13)
    at runnable.fn (http://localhost:8889/__cypress/runner/cypress_runner.js:157766:19)
    at callFn (http://localhost:8889/__cypress/runner/cypress_runner.js:107949:21)
    at ../driver/node_modules/mocha/lib/runnable.js.Runnable.run (http://localhost:8889/__cypress/runner/cypress_runner.js:107936:7)
    at http://localhost:8889/__cypress/runner/cypress_runner.js:165085:30
From previous event:
    at Object.onRunnableRun (http://localhost:8889/__cypress/runner/cypress_runner.js:165070:53)
    at $Cypress.action (http://localhost:8889/__cypress/runner/cypress_runner.js:153861:28)
    at Runnable.run (http://localhost:8889/__cypress/runner/cypress_runner.js:162726:13)
    at ../driver/node_modules/mocha/lib/runner.js.Runner.runTest (http://localhost:8889/__cypress/runner/cypress_runner.js:108608:10)
    at http://localhost:8889/__cypress/runner/cypress_runner.js:108734:12
    at next (http://localhost:8889/__cypress/runner/cypress_runner.js:108517:14)
    at http://localhost:8889/__cypress/runner/cypress_runner.js:108527:7
    at next (http://localhost:8889/__cypress/runner/cypress_runner.js:108429:14)
    at http://localhost:8889/__cypress/runner/cypress_runner.js:108495:5
    at timeslice (http://localhost:8889/__cypress/runner/cypress_runner.js:102421:27)
logError @ index.7f41798a.js:99840

Environment information

  • Device: Macbook Pro
  • OS: macOS 12.6.7

WordPress information

Default configuration provided by wp-env for this project.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@peterwilsoncc peterwilsoncc added the type:bug Something isn't working. label Jul 5, 2023
@jeffpaul jeffpaul moved this from Incoming to To Do in Open Source Practice Jul 14, 2023
@jeffpaul jeffpaul added this to the Future Release milestone Jul 14, 2023
@dkotter dkotter modified the milestones: Future Release, 0.2.0 Aug 23, 2023
@dkotter dkotter linked a pull request Aug 23, 2023 that will close this issue
4 tasks
@dkotter dkotter self-assigned this Aug 23, 2023
@github-project-automation github-project-automation bot moved this from To Do to Merged in Open Source Practice Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants