From 783faf6532a50e70cb1c6214bcdb6a18b2309592 Mon Sep 17 00:00:00 2001 From: Cameron Voell Date: Tue, 23 Mar 2021 19:48:43 -0700 Subject: [PATCH] Remove switch to classic from Editor Tests --- .../java/org/wordpress/android/e2e/BlockEditorTests.java | 7 +------ .../org/wordpress/android/e2e/pages/BlockEditorPage.java | 5 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/WordPress/src/androidTest/java/org/wordpress/android/e2e/BlockEditorTests.java b/WordPress/src/androidTest/java/org/wordpress/android/e2e/BlockEditorTests.java index a690b1be3f27..4647bdd8f274 100644 --- a/WordPress/src/androidTest/java/org/wordpress/android/e2e/BlockEditorTests.java +++ b/WordPress/src/androidTest/java/org/wordpress/android/e2e/BlockEditorTests.java @@ -58,12 +58,7 @@ public void testSwitchToClassicAndPreview() { blockEditorPage.enterTitle(title); - blockEditorPage.switchToClassic(); - - EditorPage editorPage = new EditorPage(); - editorPage.hasTitle(title); - - editorPage.previewPost(); + blockEditorPage.previewPost(); sleep(); new PostPreviewPage(); diff --git a/WordPress/src/androidTest/java/org/wordpress/android/e2e/pages/BlockEditorPage.java b/WordPress/src/androidTest/java/org/wordpress/android/e2e/pages/BlockEditorPage.java index 7311419c587b..41953fecb2fb 100644 --- a/WordPress/src/androidTest/java/org/wordpress/android/e2e/pages/BlockEditorPage.java +++ b/WordPress/src/androidTest/java/org/wordpress/android/e2e/pages/BlockEditorPage.java @@ -13,6 +13,7 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withHint; import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.wordpress.android.support.WPSupportUtils.clickOn; import static org.wordpress.android.support.WPSupportUtils.waitForElementToBeDisplayed; @@ -34,8 +35,8 @@ public void enterTitle(String postTitle) { titleField.perform(typeText(postTitle), ViewActions.closeSoftKeyboard()); } - public void switchToClassic() { + public void previewPost() { openActionBarOverflowOrOptionsMenu(ApplicationProvider.getApplicationContext()); - clickOn("Switch to classic editor"); + clickOn(onView(withText(R.string.menu_preview))); } }