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

Testing: Stub all oEmbed requests with mocked versions of their expected results #10710

Closed
danielbachhuber opened this issue Oct 17, 2018 · 2 comments
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Enhancement A suggestion for improvement.
Milestone

Comments

@danielbachhuber
Copy link
Member

Following up on #10709, test/e2e/test-mu-plugins/stub-embeds.php should be updated to return properly mocked results from the oEmbed providers we're testing.

@danielbachhuber danielbachhuber added [Type] Enhancement A suggestion for improvement. [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. labels Oct 17, 2018
@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone Oct 17, 2018
@notnownikki
Copy link
Member

Please see #10709 (review) - I think we need to keep an actual embed request to check that people's demo pages aren't going to be marked dirty.

@mtias mtias modified the milestones: WordPress 5.0 RC, WordPress 5.0 Nov 13, 2018
@notnownikki
Copy link
Member

I think this can be closed now.

test/e2e/specs/demo.test.js uses the new setUpResponseMocking to try to get the live embed from Vimeo, but fall back to a mock response if Vimeo is having problems. That's so we can test with a live response, but not hold up every pending PR if Vimeo is down.

test/e2e/specs/embedding.test.js mocks every embed response, so that the test behaves in a predictable way. It also uses setUpResponseMocking.

setUpResponseMocking isn't embed specific either, so we could use it to test unexpected network behaviour, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants