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

Test transform from media to embed blocks #13997

Merged
merged 3 commits into from
Apr 18, 2019

Conversation

draganescu
Copy link
Contributor

Closes #11901

Added e2e tests to test the transform of audio, video and image blocks in to embeds when embeddable URLs are provided

Description

Added e2e tests to test the transform of audio, video and image blocks in to embeds when embeddable URLs are provided

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@draganescu draganescu added [Type] Task Issues or PRs that have been broken down into an individual action to take [Block] Embed Affects the Embed Block labels Feb 21, 2019
@draganescu draganescu added this to the 5.2 (Gutenberg) milestone Feb 21, 2019
@draganescu draganescu self-assigned this Feb 21, 2019
@aduth aduth requested review from notnownikki and aduth February 21, 2019 20:49
@draganescu
Copy link
Contributor Author

I added the mocking of audio and image test URLs and also used the video URL which was already mocked.

@gziolo gziolo added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Feb 25, 2019
@draganescu draganescu force-pushed the add/tests-for-transform-embeddable-urls branch from 088083c to ad23c70 Compare February 25, 2019 09:35
@draganescu
Copy link
Contributor Author

draganescu commented Feb 25, 2019

The undo tests seem to fail for everyone on travis, for some they work on local.

Ran locally they fail because of a timeout. Interestingly, setting the timeout to be higher using both jest.setTimeout( 100000 ); and PUPPETEER_TIMEOUT=10000 has no effect.

Running in playback mode results in the same timeout, although visual inspection shows undo does work!

@aduth
Copy link
Member

aduth commented Feb 26, 2019

Yes, the Undo tests are very unstable at the moment. I'm hoping this is improved with #14108.

@youknowriad youknowriad removed this from the 5.3 (Gutenberg) milestone Mar 18, 2019
@draganescu draganescu force-pushed the add/tests-for-transform-embeddable-urls branch from ad23c70 to 2cce5c2 Compare March 29, 2019 13:48
@draganescu
Copy link
Contributor Author

rebased and changed @noisysocks requested changes

@draganescu draganescu requested a review from noisysocks March 29, 2019 14:23
@noisysocks
Copy link
Member

Looks like Travis might be reporting a legitimate test failure:

FAIL specs/embedding.test.js (62.532s)
  ● Embedding content › should transform from audio to embed block when Soundcloud URL is pasted
    waiting for selector ".wp-block-embed-soundcloud" failed: timeout 30000ms exceeded
      271 | 		await page.keyboard.type( 'https://soundcloud.com/a-boogie-wit-da-hoodie/swervin' );
      272 | 		await page.keyboard.press( 'Enter' );
    > 273 | 		await page.waitForSelector( '.wp-block-embed-soundcloud' );
          | 		           ^
      274 | 	} );
      275 | } );
      276 | 
      at new WaitTask (../../node_modules/puppeteer/lib/FrameManager.js:840:28)
      at Frame._waitForSelectorOrXPath (../../node_modules/puppeteer/lib/FrameManager.js:731:12)
      at Frame.waitForSelector (../../node_modules/puppeteer/lib/FrameManager.js:690:17)
      at Page.waitForSelector (../../node_modules/puppeteer/lib/Page.js:1008:29)
      at Object.waitForSelector (specs/embedding.test.js:273:14)
      at tryCatch (../../node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (../../node_modules/regenerator-runtime/runtime.js:288:22)
      at Generator.prototype.(anonymous function) [as next] (../../node_modules/regenerator-runtime/runtime.js:114:21)
      at asyncGeneratorStep (specs/embedding.test.js:9:103)
      at _next (specs/embedding.test.js:11:194)

@draganescu
Copy link
Contributor Author

@noisysocks @youknowriad this now passes all checks.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Looks good, I trust Travis it works :)

@gziolo gziolo merged commit ea6cdb4 into master Apr 18, 2019
@gziolo gziolo deleted the add/tests-for-transform-embeddable-urls branch April 18, 2019 06:33
@gziolo gziolo added this to the 5.6 (Gutenberg) milestone Apr 18, 2019
daniloercoli added a commit that referenced this pull request Apr 18, 2019
…rnmobile/887-History-stack-is-not-empty-on-a-fresh-start-of-the-editor

* 'master' of https://github.com/WordPress/gutenberg:
  Reset embed mocks on every request, stop request to instagram (#15046)
  Refactor core blocks to have save and transforms in their own files (part 2) (#14899)
  Fix pullquote import (#15036)
  Refactor core blocks to have save and transforms in their own files (part 4) (#14903)
  Refactor core blocks to have save and transforms in their own files (part 3) (#14902)
  Refactor core blocks to have deprecated extracted to their ownf files (p.1) (#14979)
  Test transform from media to embed blocks (#13997)
  If a more recent revision/autosave exists, store its state on editor setup (#7945)
  chore(release): publish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Embed Affects the Embed Block [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Tests: Transform embeddable URLs in Audio/Video/Image to Embed Block
5 participants