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 UI tests to unsupported block editor #2345

Closed
wants to merge 3 commits into from

Conversation

guarani
Copy link
Contributor

@guarani guarani commented Jun 3, 2020

Addresses: #2358

Adds UI tests to the unsupported block editor.

Test that tapping on the help button of an unsupported block shows the bottom sheet. Tapping on the edit button in the bottom sheet shows the unsupported block web view editor.

Android iOS

To test:

  1. Ensure tests are green (if running locally, run yarn test:e2e:ios:local __device-tests__/gutenberg-editor-unsupported-blocks.test.js)
  2. Optional: Ensure the test catches a failure to open the web view; comment out these lines and ensure the tests fail: https://github.com/WordPress/gutenberg/pull/21150/files#diff-48d07c563702293f97bb8137c7ad9057R115-R119

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jun 3, 2020

Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job!

@guarani guarani requested review from etoledom and marecar3 June 3, 2020 01:54
Base automatically changed from unsupported-fallback-spike to develop June 6, 2020 01:33
Test that tapping on the help button of an unsupported block shows the bottom sheet. Tapping on the edit button in the bottom sheet shows the unsupported block web view editor.
@guarani guarani force-pushed the unsupported-fallback-spike-ui-tests branch from ef43301 to 027f10f Compare June 9, 2020 11:26
@guarani
Copy link
Contributor Author

guarani commented Jun 19, 2020

I figured out why this PR fails when running locally, when it wasn't before.

First of all, I remembered CircleCI now only runs canary tests by default—so CircleCI actually isn't running the tests I added in this PR (unless I manually run them from the peril comment above).

As mentioned at the bottom of __device-tests__/README.md, the __DEV__ flag is false for UI tests because the packager is not used; the app is bundled an that is used.

When I started this PR, its branch was based off #2063 (and WordPress/gutenberg#21150) at a time when the unsupported blocks UI was not behind a __DEV__ flag. So these UI tests worked up until we put things behind the __DEV__ flag.

Now the question is, how to run UI tests on a feature that's behind a __DEV__ flag?

@guarani
Copy link
Contributor Author

guarani commented Jun 19, 2020

I found a fix using for iOS:

yarn ios --configuration Release && TEST_RN_PLATFORM=ios yarn device-tests:local __device-tests__/gutenberg-editor-unsupported-blocks.test.js

and Android

yarn android && TEST_RN_PLATFORM=android yarn device-tests:local __device-tests__/gutenberg-editor-unsupported-blocks.test.js

I don't know if there's a better solution. Otherwise, this is ready for testing again @etoledom and @marecar3.

@guarani
Copy link
Contributor Author

guarani commented Jul 6, 2020

Closing in favor of WordPress/gutenberg#23729. Since the monorepo has been merged, UI test code now belongs in the Gutenberg repo.

@guarani guarani closed this Jul 6, 2020
@etoledom etoledom deleted the unsupported-fallback-spike-ui-tests branch October 16, 2020 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant