Skip to content

Commit

Permalink
[Mobile] - Update E2E Tests related to the Writing flow (#57460)
Browse files Browse the repository at this point in the history
* Add support to pass the initialTitle to the E2E tests

* Editor Page - Add new E2E utils

* E2E - Paragraph block - Remove deprecated multiline prop test

* Add initial E2E Writing flow tests

* E2E Tests - Merge Paragraph block tests with the Writing flow tests

* E2E Tests - Merge Heading block tests with the Writing flow tests

* Add missing part of the test

* Fixes comment typo

* Fix typo

* Increase pause value

* Add pause before dismissing the keyboard to avoid flakiness

* Remove pause in favor of waitUntil

* Removes pause in favor of waitUntil when checking for the Keyboard state in some cases, which also expects the condition to be true.

* Simplify waitUntil to just pass the promise

* Rename getEmptyTitleElement to getEmptyTitleTextInputElement and move the logic to click on the title wrapper within the function

* Editor Page - Adds new param skipWrapperClick to getTextBlockAtPosition to avoid clicking on the wrapper on iOS if its set to true for cases where its already focused and the caret is at the desired position

* Unify the split and merge tests into one

* Update `showSoftKeyboard` to wait for the text input to get focus

* Check input method manager is defined before hiding keyboard

* Set wrapper view of the editor to be not focusable in the demo app

This matches the behavior of the host app WP-Android.

---------

Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
  • Loading branch information
Gerardo Pacheco and fluiddot authored Jan 4, 2024
1 parent fc05738 commit e8b0a4c
Show file tree
Hide file tree
Showing 8 changed files with 436 additions and 229 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ data class GutenbergProps @JvmOverloads constructor(
content?.let { putString(PROP_INITIAL_DATA, it) }
}

private const val PROP_INITIAL_TITLE = "initialTitle"
private const val PROP_INITIAL_HTML_MODE_ENABLED = "initialHtmlModeEnabled"
private const val PROP_POST_TYPE = "postType"
private const val PROP_HOST_APP_NAMESPACE = "hostAppNamespace"
Expand All @@ -105,6 +104,7 @@ data class GutenbergProps @JvmOverloads constructor(
private const val PROP_QUOTE_BLOCK_V2 = "quoteBlockV2"
private const val PROP_LIST_BLOCK_V2 = "listBlockV2"

const val PROP_INITIAL_TITLE = "initialTitle"
const val PROP_INITIAL_DATA = "initialData"
const val PROP_STYLES = "rawStyles"
const val PROP_FEATURES = "rawFeatures"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ describe( 'Gutenberg Editor Rotation tests', () => {
await editorPage.addNewBlock( blockNames.paragraph );

if ( isAndroid() ) {
// Waits until the keyboard is visible
await editorPage.driver.waitUntil(
editorPage.driver.isKeyboardShown
);
await editorPage.dismissKeyboard();
}

Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit e8b0a4c

Please sign in to comment.