Skip to content

Conversation

@findms
Copy link
Contributor

@findms findms commented Oct 16, 2025

TaskWPB-20998 [iOS/QA] XCTest with iPad compatibility


Summary

Briefly describe what this PR does.

This PR is about the critical flow tests making it compatible to iPad so that we can run on nightly if all green for ipad as well.
To Achieve this we needed to put some conditions, elements where flow is different from iPhone on iPad.

   @discardableResult
    func iPadOnly(_ block: (() -> Void)? = nil) -> Bool {
        guard UIDevice.current.userInterfaceIdiom == .pad else { return false }
        block?()
        return true
    }

Testing

Describe how to verify the changes locally. Attach screenshots or reports if relevant.

Ran test locally via Xcode and here are the results: image

Note: 1 Test is still pending to be fixed due to issue https://wearezeta.atlassian.net/browse/WPB-21169

Additional Information

any more info, add here.

@findms findms changed the title tests making compatible to iPad chore: tests making compatible to iPad - WPB-20998 Oct 17, 2025
@findms findms changed the title chore: tests making compatible to iPad - WPB-20998 chore: Tests compatible to iPad - WPB-20998 Oct 17, 2025
@findms findms added the QA label Oct 20, 2025
@findms findms marked this pull request as ready for review October 30, 2025 10:26
@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Test Results

2 362 tests   2 334 ✅  3m 14s ⏱️
  374 suites     28 💤
    3 files        0 ❌

Results for commit 4cd87fd.

♻️ This comment has been updated with latest results.

@findms findms requested review from johnxnguyen and netbe October 31, 2025 10:14
Copy link
Collaborator

@johnxnguyen johnxnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one question. Also please try to fill in the PR description with something to help the reviewer understand what he changes are about.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: were these changes part of automatic linting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some warnings were flagging, tried resolving them.

@findms findms requested a review from johnxnguyen November 6, 2025 07:13
Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The iPad looks good, though I wonder how this is run on CI: modifying TestPlan configuration, happy to help on that part

Comment on lines 273 to 275
let (_, _) = try await networkService.executeRequest(request)

try ResponseParser()
_ = ResponseParser()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: so here we don't do anything if at least the response is not passed to the parser

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it wasn't returning anything but fixed with parsing.

text = Text(Strings.Settings.title)
icon = "gearshape"
accessibilityLabel = Text(Labels.Settings.description)
accessibilityIdentifier = "bottomBarSettingsButton"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: use locator instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be updated accordingly once upcoming Locators.swift will be merged

}

@discardableResult
func onPad(_ block: (() -> Void)? = nil) -> Bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit-pic: trying to find a better name...

Suggested change
func onPad(_ block: (() -> Void)? = nil) -> Bool {
func iPadOnly(_ block: (() -> Void)? = nil) -> Bool {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment on lines 63 to 64
if sideBarPanel.exists { sideBarPanel.tap() }
if allConversations.exists { allConversations.tap() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: is this formatted ? I would expect to have this on separate lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes inline formatted but I changed it to separate lines.

@findms
Copy link
Contributor Author

findms commented Nov 18, 2025

The iPad looks good, though I wonder how this is run on CI: modifying TestPlan configuration, happy to help on that part

Yes ..either we change the test plan or if we plan to run only on CI, we can create a separate job with runtime iPad to run only on nightly. We can discuss it in one of the knowledge sharing session once this PR is ready to merge.


@discardableResult
func iPadOnly(_ block: (() -> Void)? = nil) -> Bool {
guard UIDevice.current.userInterfaceIdiom == .pad else { return false }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, checking userInterfaceIdiom is not future proof, since we might allow the iPad app to be resized.
Then the iPad layout can collapse to the iPhone layout and if I'm not mistaken it will still be userInterfaceIdiom == .pad. Actually I will doublecheck this.

Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM;)

@johnxnguyen johnxnguyen removed their request for review November 25, 2025 13:02
@findms findms force-pushed the chore/test-compatibility-to-ipad-WPB-20998 branch from ff464b7 to 1cd717d Compare November 26, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants