Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ target 'WordPress' do

pod 'Gridicons', '~> 1.0.1'

pod 'WordPressAuthenticator', '~> 1.26.0-beta'
pod 'WordPressAuthenticator', '~> 1.27.0-beta.2'
# While in PR
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => ''
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
Expand Down Expand Up @@ -363,9 +363,9 @@ end
## ===================
##
def wordpress_mocks
pod 'WordPressMocks', '~> 0.0.8'
pod 'WordPressMocks', '~> 0.0.9-beta.1'
# pod 'WordPressMocks', :git => 'https://github.com/wordpress-mobile/WordPressMocks.git', :commit => ''
# pod 'WordPressMocks', :git => 'https://github.com/wordpress-mobile/WordPressMocks.git', :branch => 'add/screenshot-mocks'
# pod 'WordPressMocks', :git => 'https://github.com/wordpress-mobile/WordPressMocks.git', :branch => ''
# pod 'WordPressMocks', :path => '../WordPressMocks'
end

Expand Down
14 changes: 7 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ PODS:
- WordPress-Aztec-iOS (1.19.3)
- WordPress-Editor-iOS (1.19.3):
- WordPress-Aztec-iOS (= 1.19.3)
- WordPressAuthenticator (1.26.0):
- WordPressAuthenticator (1.27.0-beta.2):
- 1PasswordExtension (= 1.8.6)
- Alamofire (= 4.8)
- CocoaLumberjack (~> 3.5)
Expand All @@ -414,7 +414,7 @@ PODS:
- UIDeviceIdentifier (~> 1)
- WordPressShared (~> 1.12)
- wpxmlrpc (~> 0.9.0)
- WordPressMocks (0.0.8)
- WordPressMocks (0.0.9-beta.1)
- WordPressShared (1.12.0):
- CocoaLumberjack (~> 3.4)
- FormatterKit/TimeIntervalFormatter (= 1.8.2)
Expand Down Expand Up @@ -505,9 +505,9 @@ DEPENDENCIES:
- Starscream (= 3.0.6)
- SVProgressHUD (= 2.2.5)
- WordPress-Editor-iOS (~> 1.19.3)
- WordPressAuthenticator (~> 1.26.0-beta)
- WordPressAuthenticator (~> 1.27.0-beta.2)
- WordPressKit (~> 4.18.0-beta)
- WordPressMocks (~> 0.0.8)
- WordPressMocks (~> 0.0.9-beta.1)
- WordPressShared (~> 1.12.0)
- WordPressUI (~> 1.7.1)
- WPMediaPicker (~> 1.7.2)
Expand Down Expand Up @@ -755,9 +755,9 @@ SPEC CHECKSUMS:
UIDeviceIdentifier: a79ccdfc940373835a7d8e9fc7541e6bf61b6319
WordPress-Aztec-iOS: b7ac8b30f746992e85d9668453ac87c2cdcecf4f
WordPress-Editor-iOS: 1886f7fe464d79ee64ccfe7985281f8cf45f75eb
WordPressAuthenticator: 31bceb4ab25de663a327b791e76a405b9c903b73
WordPressAuthenticator: f81da13fbec5ad230538d93d082776777c9c09e3
WordPressKit: 1d10fa14ea185600472d31cf25e677c7d938b17d
WordPressMocks: b4064b99a073117bbc304abe82df78f2fbe60992
WordPressMocks: 1e04de6afa3a17f6f1ab4782f8460d7faefcf2f7
WordPressShared: 38cb62e9cb998d4dc3c1611f17934c6875a6b3e8
WordPressUI: 9da5d966b8beb091950cd96880db398d7f30e246
WPMediaPicker: d5ae9a83cd5cc0e4de46bfc1c59120aa86658bc3
Expand All @@ -772,6 +772,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: a87ab1e4badace92c75eb11dc77ede1e995b2adc
ZIPFoundation: 249fa8890597086cd536bb2df5c9804d84e122b0

PODFILE CHECKSUM: 6141b62876d49dbc9b2e5735cff154f0244a888f
PODFILE CHECKSUM: e52e67df2c5945cbfa4a5bcc7648ad382f4685bc

COCOAPODS: 1.9.3
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
class ReplyToComment: DefaultNotificationActionCommand {
static let title = NSLocalizedString("Reply", comment: "Reply to a comment.")
static let hint = NSLocalizedString("Replies to a comment.", comment: "VoiceOver accessibility hint, informing the user the button can be used to reply to a comment.")
static let identifier = "reply-button"

override var actionTitle: String {
return ReplyToComment.title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class NoteBlockActionsTableViewCell: NoteBlockTableViewCell {
btnReply.setTitleColor(textNormalColor, for: UIControl.State())
btnReply.accessibilityLabel = ReplyToComment.title
btnReply.accessibilityHint = ReplyToComment.hint
btnReply.accessibilityIdentifier = ReplyToComment.identifier

btnLike.setTitle(LikeComment.TitleStrings.like, for: UIControl.State())
btnLike.setTitle(LikeComment.TitleStrings.unlike, for: .highlighted)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,46 @@ class WordPressScreenshotGeneration: XCTestCase {

func testGenerateScreenshots() {

// Get My Site screenshot
let mySite = MySiteScreen()
// Get post editor screenshot
let postList = MySiteScreen()
.showSiteSwitcher()
.switchToSite(withTitle: "infocusphotographers.com")
snapshot("4-MySite")

// Get BlockPicker screenshot
let postList = mySite
.switchToSite(withTitle: "fourpawsdoggrooming.wordpress.com")
.gotoPostsScreen()
.showOnly(.drafts)

let postEditorScreenshot = postList.selectPost(withSlug: "summer-band-jam")
BlockEditorScreen().openBlockPicker()
snapshot("1-BlockPicker")
BlockEditorScreen().closeBlockPicker()
let postEditorScreenshot = postList.selectPost(withSlug: "our-services")
sleep(imagesWaitTime) // wait for post images to load
if isIpad {
snapshot("1-Editor")
} else {
BlockEditorScreen().openBlockPicker()
snapshot("1-Editor-With-BlockPicker")
BlockEditorScreen().closeBlockPicker()
}
postEditorScreenshot.close()

// Get a screenshot of the full-screen editor
// Get a screenshot of the editor with keyboard (iPad only)
if isIpad {
let ipadScreenshot = postList.selectPost(withSlug: "now-booking-summer-sessions")
snapshot("6-No-Keyboard-Editor")
let ipadScreenshot = MySiteScreen()
.showSiteSwitcher()
.switchToSite(withTitle: "weekendbakesblog.wordpress.com")
.gotoPostsScreen()
.showOnly(.drafts)
.selectPost(withSlug: "easy-blueberry-muffins")
BlockEditorScreen().selectBlock(containingText: "Ingredients")
sleep(imagesWaitTime) // wait for post images to load
snapshot("7-Editor-With-Keyboard")
ipadScreenshot.close()
}

if !isIpad {
} else {
postList.pop()
}

// Get My Site screenshot
let mySite = MySiteScreen()
.showSiteSwitcher()
.switchToSite(withTitle: "tricountyrealestate.wordpress.com")
snapshot("4-MySite")

// Get Media screenshot
_ = mySite.gotoMediaScreen()
sleep(imagesWaitTime) // wait for post images to load
Expand All @@ -77,7 +89,7 @@ class WordPressScreenshotGeneration: XCTestCase {
let statsScreen = mySite.gotoStatsScreen()
statsScreen
.dismissCustomizeInsightsNotice()
.switchTo(mode: .years)
.switchTo(mode: .months)
snapshot("3-Stats")

// Get Discover screenshot
Expand All @@ -88,9 +100,13 @@ class WordPressScreenshotGeneration: XCTestCase {
snapshot("2-Discover")

// Get Notifications screenshot
TabNavComponent()
let notificationList = TabNavComponent()
.gotoNotificationsScreen()
.dismissNotificationAlertIfNeeded()
if isIpad {
notificationList.openNotification(withText: "Reyansh Pawar commented on My Top 10 Pastry Recipes")
.replyToNotification()
}
snapshot("5-Notifications")
}
}
10 changes: 10 additions & 0 deletions WordPress/WordPressUITests/Screens/Editor/BlockEditorScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ class BlockEditorScreen: BaseScreen {
return self
}

/**
Selects a block based on part of the block label (e.g. partial text in a paragraph block)
*/
@discardableResult
func selectBlock(containingText text: String) -> BlockEditorScreen {
let predicate = NSPredicate(format: "label CONTAINS[c] '\(text)'")
XCUIApplication().buttons.containing(predicate).firstMatch.tap()
return self
}

// returns void since return screen depends on from which screen it loaded
func closeEditor() {
XCTContext.runActivity(named: "Close the block editor") { (activity) in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LoginEpilogueScreen: BaseScreen {
connectSiteButton = app.cells[ElementStringIDs.connectSiteButton]
continueButton = app.buttons[ElementStringIDs.continueButton]

super.init(element: siteUrlField)
super.init(element: continueButton)
}

func continueWithSelectedSite() -> MySiteScreen {
Expand All @@ -41,7 +41,7 @@ class LoginEpilogueScreen: BaseScreen {
}

let expectedSiteUrl = getDisplayUrl(for: siteUrl)
let actualSiteUrl = siteUrlField.label
let actualSiteUrl = siteUrlField.firstMatch.label
XCTAssertEqual(expectedSiteUrl, actualSiteUrl, "Site URL displayed is \(actualSiteUrl) but should be \(expectedSiteUrl)")

return self
Expand Down
13 changes: 13 additions & 0 deletions WordPress/WordPressUITests/Screens/NotificationsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,27 @@ import XCTest
class NotificationsScreen: BaseScreen {

let tabBar: TabNavComponent
let replyButton: XCUIElement

init() {
let navBar = XCUIApplication().tables["Notifications Table"]
replyButton = XCUIApplication().buttons["reply-button"]
tabBar = TabNavComponent()

super.init(element: navBar)
}

func openNotification(withText notificationText: String) -> NotificationsScreen {
XCUIApplication().staticTexts[notificationText].tap()
return self
}

@discardableResult
func replyToNotification() -> NotificationsScreen {
replyButton.tap()
return self
}

static func isLoaded() -> Bool {
return XCUIApplication().tables["Notifications Table"].exists
}
Expand Down
1 change: 1 addition & 0 deletions WordPress/WordPressUITests/Screens/StatsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ private struct ElementStringIDs {
class StatsScreen: BaseScreen {

enum Mode: String {
case months = "months"
case years = "years"
}

Expand Down
2 changes: 1 addition & 1 deletion WordPress/WordPressUITests/Screens/TabNavComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TabNavComponent: BaseScreen {
func gotoMySiteScreen() -> MySiteScreen {
// Avoid transitioning to the sites list if MySites is already on screen
if !MySiteScreen.isVisible {
gotoMySitesScreen().switchToSite(withTitle: "infocusphotographers.com")
gotoMySitesScreen().switchToSite(withTitle: WPUITestCredentials.testWPcomSiteAddress)
}
return MySiteScreen()
}
Expand Down
1 change: 1 addition & 0 deletions WordPress/WordPressUITests/Tests/MainNavigationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MainNavigationTests: XCTestCase {

_ = mySiteScreen
.tabBar.gotoNotificationsScreen()
.dismissNotificationAlertIfNeeded()

XCTContext.runActivity(named: "Confirm Notifications screen and main navigation bar are loaded.") { (activity) in
XCTAssert(NotificationsScreen.isLoaded(), "Notifications screen isn't loaded.")
Expand Down
4 changes: 2 additions & 2 deletions WordPress/WordPressUITests/WPUITestCredentials.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ struct WPUITestCredentials {
static let testWPcomUserEmail: String = "e2eflowtestingmobile@example.com"
static let testWPcomUsername: String = "e2eflowtestingmobile"
static let testWPcomPassword: String = "mocked_password"
static let testWPcomSiteAddress: String = "infocusphotographers.wordpress.com"
static let testWPcomSitePrimaryAddress: String = "infocusphotographers.com"
static let testWPcomSiteAddress: String = "tricountyrealestate.wordpress.com"
static let testWPcomSitePrimaryAddress: String = "tricountyrealestate.wordpress.com"
static let selfHostedUsername: String = "e2eflowtestingmobile"
static let selfHostedPassword: String = "mocked_password"
static let selfHostedSiteAddress: String = "\(WireMock.URL().absoluteString)"
Expand Down