diff --git a/WordPress/WordPressUITests/Flows/EditorFlow.swift b/WordPress/WordPressUITests/Flows/EditorFlow.swift index ecfffe73ee9e..763c1a557774 100644 --- a/WordPress/WordPressUITests/Flows/EditorFlow.swift +++ b/WordPress/WordPressUITests/Flows/EditorFlow.swift @@ -7,6 +7,10 @@ class EditorFlow { } } + static func goToMySiteScreen() -> MySiteScreen { + return TabNavComponent().gotoMySiteScreen() + } + static func toggleBlockEditor(to state: SiteSettingsScreen.Toggle) -> SiteSettingsScreen { if !SiteSettingsScreen.isLoaded() { _ = TabNavComponent() diff --git a/WordPress/WordPressUITests/Tests/EditorAztecTests.swift b/WordPress/WordPressUITests/Tests/EditorAztecTests.swift index 8002f40eeafd..fe6384b14d37 100644 --- a/WordPress/WordPressUITests/Tests/EditorAztecTests.swift +++ b/WordPress/WordPressUITests/Tests/EditorAztecTests.swift @@ -24,57 +24,59 @@ class EditorAztecTests: XCTestCase { super.tearDown() } - func testTextPostPublish() { - let title = getRandomPhrase() - let content = getRandomContent() - editorScreen - .enterTextInTitle(text: title) - .enterText(text: content) - .publish() - .viewPublishedPost(withTitle: title) - .verifyEpilogueDisplays(postTitle: title, siteAddress: WPUITestCredentials.testWPcomSitePrimaryAddress) - .done() - } - - func testBasicPostPublish() { - let title = getRandomPhrase() - let content = getRandomContent() - let category = getCategory() - let tag = getTag() - editorScreen - .enterTextInTitle(text: title) - .enterText(text: content) - .addImageByOrder(id: 0) - .openPostSettings() - .selectCategory(name: category) - .addTag(name: tag) - .setFeaturedImage() - .verifyPostSettings(withCategory: category, withTag: tag, hasImage: true) - .removeFeatureImage() - .verifyPostSettings(withCategory: category, withTag: tag, hasImage: false) - .setFeaturedImage() - .verifyPostSettings(withCategory: category, withTag: tag, hasImage: true) - .closePostSettings() - AztecEditorScreen(mode: .rich).publish() - .viewPublishedPost(withTitle: title) - .verifyEpilogueDisplays(postTitle: title, siteAddress: WPUITestCredentials.testWPcomSitePrimaryAddress) - .done() - } - - // Github issue https://github.com/wordpress-mobile/AztecEditor-iOS/issues/385 - func testLongTitle() { - let longTitle = "long title in a galaxy not so far away" - // Title heigh contains of actual textfield height + bottom line. - // 16.5px - is the height of that bottom line. Its not changing with different font sizes - let titleTextView = editorScreen.titleView - let titleLineHeight = titleTextView.frame.height - 16.5 - let oneLineTitleHeight = titleTextView.frame.height - - let repeatTimes = isIPhone ? 6 : 20 - _ = editorScreen.enterTextInTitle(text: String(repeating: "very ", count: repeatTimes) + longTitle) - - let twoLineTitleHeight = titleTextView.frame.height - - XCTAssert(twoLineTitleHeight - oneLineTitleHeight >= titleLineHeight ) - } + // TODO: Re-enable Aztec tests but for editing an existing Aztec post. + // For more information, see Issue: https://github.com/wordpress-mobile/WordPress-iOS/issues/16218 +// func testTextPostPublish() { +// let title = getRandomPhrase() +// let content = getRandomContent() +// editorScreen +// .enterTextInTitle(text: title) +// .enterText(text: content) +// .publish() +// .viewPublishedPost(withTitle: title) +// .verifyEpilogueDisplays(postTitle: title, siteAddress: WPUITestCredentials.testWPcomSitePrimaryAddress) +// .done() +// } +// +// func testBasicPostPublish() { +// let title = getRandomPhrase() +// let content = getRandomContent() +// let category = getCategory() +// let tag = getTag() +// editorScreen +// .enterTextInTitle(text: title) +// .enterText(text: content) +// .addImageByOrder(id: 0) +// .openPostSettings() +// .selectCategory(name: category) +// .addTag(name: tag) +// .setFeaturedImage() +// .verifyPostSettings(withCategory: category, withTag: tag, hasImage: true) +// .removeFeatureImage() +// .verifyPostSettings(withCategory: category, withTag: tag, hasImage: false) +// .setFeaturedImage() +// .verifyPostSettings(withCategory: category, withTag: tag, hasImage: true) +// .closePostSettings() +// AztecEditorScreen(mode: .rich).publish() +// .viewPublishedPost(withTitle: title) +// .verifyEpilogueDisplays(postTitle: title, siteAddress: WPUITestCredentials.testWPcomSitePrimaryAddress) +// .done() +// } +// +// // Github issue https://github.com/wordpress-mobile/AztecEditor-iOS/issues/385 +// func testLongTitle() { +// let longTitle = "long title in a galaxy not so far away" +// // Title heigh contains of actual textfield height + bottom line. +// // 16.5px - is the height of that bottom line. Its not changing with different font sizes +// let titleTextView = editorScreen.titleView +// let titleLineHeight = titleTextView.frame.height - 16.5 +// let oneLineTitleHeight = titleTextView.frame.height +// +// let repeatTimes = isIPhone ? 6 : 20 +// _ = editorScreen.enterTextInTitle(text: String(repeating: "very ", count: repeatTimes) + longTitle) +// +// let twoLineTitleHeight = titleTextView.frame.height +// +// XCTAssert(twoLineTitleHeight - oneLineTitleHeight >= titleLineHeight ) +// } } diff --git a/WordPress/WordPressUITests/Tests/EditorGutenbergTests.swift b/WordPress/WordPressUITests/Tests/EditorGutenbergTests.swift index 2053dd9bd6c7..75a6355af9be 100644 --- a/WordPress/WordPressUITests/Tests/EditorGutenbergTests.swift +++ b/WordPress/WordPressUITests/Tests/EditorGutenbergTests.swift @@ -8,8 +8,7 @@ class EditorGutenbergTests: XCTestCase { _ = LoginFlow.loginIfNeeded(siteUrl: WPUITestCredentials.testWPcomSiteAddress, email: WPUITestCredentials.testWPcomUserEmail, password: WPUITestCredentials.testWPcomPassword) editorScreen = EditorFlow - .toggleBlockEditor(to: .on) - .goBackToMySite() + .goToMySiteScreen() .tabBar.gotoBlockEditorScreen() }