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

[UI Tests] Re-enable media picker tests with support to PHPicker #21447

Merged
merged 4 commits into from
Aug 28, 2023
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
Prev Previous commit
Next Next commit
Update setFeatureImage() including chooseFromMediaButton
tiagomar committed Aug 28, 2023
commit c2609d9582b4dde71c218f6900da0b5f8fbb31ba
Original file line number Diff line number Diff line change
@@ -11,6 +11,10 @@ public class EditorPostSettings: ScreenObject {
$0.cells["Categories"]
}

private let chooseFromMediaButtonGetter: (XCUIApplication) -> XCUIElement = {
$0.buttons["Choose from Media"]
}

private let tagsSectionGetter: (XCUIApplication) -> XCUIElement = {
$0.cells["Tags"]
}
@@ -44,6 +48,7 @@ public class EditorPostSettings: ScreenObject {
}

var categoriesSection: XCUIElement { categoriesSectionGetter(app) }
var chooseFromMediaButton: XCUIElement { chooseFromMediaButtonGetter(app) }
var currentFeaturedImage: XCUIElement { currentFeaturedImageGetter(app) }
var dateSelector: XCUIElement { dateSelectorGetter(app) }
var doneButton: XCUIElement { doneButtonGetter(app) }
@@ -96,8 +101,8 @@ public class EditorPostSettings: ScreenObject {

public func setFeaturedImage() throws -> EditorPostSettings {
featuredImageButton.tap()
try MediaPickerAlbumListScreen()
.selectAlbum(atIndex: 0) // Select media library
chooseFromMediaButton.tap()
try MediaPickerAlbumScreen()
.selectImage(atIndex: 0) // Select latest uploaded image

return try EditorPostSettings()