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 Playwright Compatibility-classic-editor Test #43979

Merged
merged 8 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<a>
alvitazwar marked this conversation as resolved.
Show resolved Hide resolved
Random Link
</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<a>
alvitazwar marked this conversation as resolved.
Show resolved Hide resolved
Random Link
</a>
36 changes: 36 additions & 0 deletions test/e2e/specs/editor/various/compatibility-classic-editor.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* WordPress dependencies
*/
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

test.describe( 'Compatibility with classic editor', () => {
test.beforeEach( async ( { admin } ) => {
await admin.createNewPost();
} );

test.afterEach( async ( { requestUtils } ) => {
await requestUtils.deleteAllPosts();
} );

test( 'Should not apply auto when rendering blocks', async ( {
page,
editor,
} ) => {
await editor.insertBlock( { name: 'core/html' } );
await page.focus( 'role=textbox[name="HTML"i]' );
await page.keyboard.type( '<a>' );
await page.keyboard.type( 'Random Link' );
await page.keyboard.type( '</a> ' );
// Publish Post
await editor.publishPost();
// View Post
await page.locator( 'role=link[name="View post"i]' ).first().click();
alvitazwar marked this conversation as resolved.
Show resolved Hide resolved

// Check the content doesn't contain <p> tags.
// No accessible selector for now.
const content = page.locator( '.entry-content' );
await expect
.poll( () => content.innerHTML() )
.toContain( `<a>Random Link</a>` );
} );
} );