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

Re-merge "[E2E] Embed block fixes" #45395

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/e2e/lib/gutenberg/gutenberg-editor-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ export default class GutenbergEditorComponent extends AsyncBaseContainer {
case 'Instagram':
case 'Twitter':
case 'YouTube':
ariaLabel = 'Block: Embed';
prefix = 'embed-';
break;
case 'Form':
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/specs/wp-calypso-gutenberg-coblocks-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ describe( `[${ host }] Calypso Gutenberg Editor: CoBlocks (${ screenSize })`, fu

step( 'Can publish and view content', async function () {
const gEditorComponent = await GutenbergEditorComponent.Expect( driver );
// We need to save the post to get a stable post slug for the block's `url` attribute.
// See https://github.com/godaddy-wordpress/coblocks/issues/1663.
await gEditorComponent.ensureSaved();
return await gEditorComponent.publish( { visit: true, closePanel: false } );
} );

Expand Down
8 changes: 5 additions & 3 deletions test/e2e/specs/wp-calypso-gutenberg-post-editor-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,8 @@ describe( `[${ host }] Calypso Gutenberg Editor: Posts (${ screenSize })`, funct
const gEditorComponent = await GutenbergEditorComponent.Expect( driver );
await gEditorComponent.enterTitle( 'Embeds: ' + blogPostTitle );

this.instagramEditorSelector = '.wp-block-embed-instagram';
this.instagramEditorSelector =
'.wp-block-embed iframe[title="Embedded content from instagram.com"]';
const blockIdInstagram = await gEditorComponent.addBlock( 'Instagram' );
const gEmbedsComponentInstagram = await EmbedsBlockComponent.Expect(
driver,
Expand All @@ -1175,15 +1176,16 @@ describe( `[${ host }] Calypso Gutenberg Editor: Posts (${ screenSize })`, funct
await gEmbedsComponentInstagram.embedUrl( 'https://www.instagram.com/p/BlDOZMil933/' );
await gEmbedsComponentInstagram.isEmbeddedInEditor( this.instagramEditorSelector );

this.twitterEditorSelector = '.wp-block-embed-twitter';
this.twitterEditorSelector = '.wp-block-embed iframe[title="Embedded content from twitter"]';
const blockIdTwitter = await gEditorComponent.addBlock( 'Twitter' );
const gEmbedsComponentTwitter = await EmbedsBlockComponent.Expect( driver, blockIdTwitter );
await gEmbedsComponentTwitter.embedUrl(
'https://twitter.com/automattic/status/1067120832676327424'
);
await gEmbedsComponentTwitter.isEmbeddedInEditor( this.twitterEditorSelector );

this.youtubeEditorSelector = '.wp-block-embed-youtube';
this.youtubeEditorSelector =
'.wp-block-embed iframe[title="Embedded content from youtube.com"]';
const blockIdYouTube = await gEditorComponent.addBlock( 'YouTube' );
const gEmbedsComponentYouTube = await EmbedsBlockComponent.Expect( driver, blockIdYouTube );
await gEmbedsComponentYouTube.embedUrl( 'https://www.youtube.com/watch?v=xifhQyopjZM' );
Expand Down