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

Mobile - Skip some of the Drag & Drop E2E on iOS #41529

Merged
merged 2 commits into from
Jun 3, 2022
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,61 +53,73 @@ describe( 'Gutenberg Editor Drag & Drop blocks tests', () => {
await editorPage.removeBlockAtPosition( blockNames.paragraph, 1 );
} );

it( 'should be able to long-press on a text-based block to paste a text in a focused textinput', async () => {
// Add a Paragraph block
await editorPage.addNewBlock( blockNames.paragraph );
const paragraphBlockElement = await editorPage.getTextBlockAtPosition(
blockNames.paragraph
);

// Set clipboard text
await setClipboard( editorPage.driver, testData.shortText );

// Dismiss auto-suggestion popup
if ( isAndroid() ) {
// On Andrdoid 10 a new auto-suggestion popup is appearing to let the user paste text recently put in the clipboard. Let's dismiss it.
await editorPage.dismissAndroidClipboardSmartSuggestion();
}

// Paste into the Paragraph block
await tapPasteAboveElement( editorPage.driver, paragraphBlockElement );
const paragraphText = await editorPage.getTextForParagraphBlockAtPosition(
1
);

// Expect to have the pasted text in the Paragraph block
expect( paragraphText ).toMatch( testData.shortText );

// Remove the block
await editorPage.removeBlockAtPosition( blockNames.paragraph );
} );

it( 'should be able to long-press on a text-based block using the PlainText component to paste a text in a focused textinput', async () => {
// Add a Shortcode block
await editorPage.addNewBlock( blockNames.shortcode );
const shortcodeBlockElement = await editorPage.getShortBlockTextInputAtPosition(
blockNames.shortcode
);

// Set clipboard text
await setClipboard( editorPage.driver, testData.shortText );

// Dismiss auto-suggestion popup
if ( isAndroid() ) {
// On Andrdoid 10 a new auto-suggestion popup is appearing to let the user paste text recently put in the clipboard. Let's dismiss it.
await editorPage.dismissAndroidClipboardSmartSuggestion();
}

// Paste into the Shortcode block
await tapPasteAboveElement( editorPage.driver, shortcodeBlockElement );
const shortcodeText = await shortcodeBlockElement.text();

// Expect to have the pasted text in the Shortcode block
expect( shortcodeText ).toMatch( testData.shortText );

// Remove the block
await editorPage.removeBlockAtPosition( blockNames.shortcode );
} );
// skip iOS for now
if ( isAndroid() ) {
fluiddot marked this conversation as resolved.
Show resolved Hide resolved
it( 'should be able to long-press on a text-based block to paste a text in a focused textinput', async () => {
// Add a Paragraph block
await editorPage.addNewBlock( blockNames.paragraph );
const paragraphBlockElement = await editorPage.getTextBlockAtPosition(
blockNames.paragraph
);

// Set clipboard text
await setClipboard( editorPage.driver, testData.shortText );

// Dismiss auto-suggestion popup
if ( isAndroid() ) {
// On Andrdoid 10 a new auto-suggestion popup is appearing to let the user paste text recently put in the clipboard. Let's dismiss it.
await editorPage.dismissAndroidClipboardSmartSuggestion();
}

// Paste into the Paragraph block
await tapPasteAboveElement(
editorPage.driver,
paragraphBlockElement
);
const paragraphText = await editorPage.getTextForParagraphBlockAtPosition(
1
);

// Expect to have the pasted text in the Paragraph block
expect( paragraphText ).toMatch( testData.shortText );

// Remove the block
await editorPage.removeBlockAtPosition( blockNames.paragraph );
} );
}

// skip iOS for now
if ( isAndroid() ) {
it( 'should be able to long-press on a text-based block using the PlainText component to paste a text in a focused textinput', async () => {
// Add a Shortcode block
await editorPage.addNewBlock( blockNames.shortcode );
const shortcodeBlockElement = await editorPage.getShortBlockTextInputAtPosition(
blockNames.shortcode
);

// Set clipboard text
await setClipboard( editorPage.driver, testData.shortText );

// Dismiss auto-suggestion popup
if ( isAndroid() ) {
// On Andrdoid 10 a new auto-suggestion popup is appearing to let the user paste text recently put in the clipboard. Let's dismiss it.
await editorPage.dismissAndroidClipboardSmartSuggestion();
}

// Paste into the Shortcode block
await tapPasteAboveElement(
editorPage.driver,
shortcodeBlockElement
);
const shortcodeText = await shortcodeBlockElement.text();

// Expect to have the pasted text in the Shortcode block
expect( shortcodeText ).toMatch( testData.shortText );

// Remove the block
await editorPage.removeBlockAtPosition( blockNames.shortcode );
} );
}

it( 'should be able to drag & drop a text-based block when the textinput is not focused', async () => {
// Initialize the editor with two Paragraph blocks
Expand Down