Skip to content

ALFMOB-204: Added UI Test example#60

Open
paulcristian-mindera wants to merge 2 commits intomainfrom
tests/alfmob-204-create-ui-testing-example
Open

ALFMOB-204: Added UI Test example#60
paulcristian-mindera wants to merge 2 commits intomainfrom
tests/alfmob-204-create-ui-testing-example

Conversation

@paulcristian-mindera
Copy link
Copy Markdown
Contributor

Screen.Recording.2025-12-23.at.09.57.37.mov

@amccall-mindera amccall-mindera force-pushed the tests/alfmob-204-create-ui-testing-example branch from a78da32 to 6555bfb Compare December 23, 2025 12:43
@amccall-mindera amccall-mindera force-pushed the tests/alfmob-204-create-ui-testing-example branch from 6555bfb to c2f0329 Compare December 23, 2025 13:10
Comment thread Alfie/AlfieUITests/AlfieUITests.swift Outdated
@@ -16,11 +16,40 @@ final class AlfieUITests: XCTestCase {
}

func testExample() throws {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add more descriptive function name

@amccall-mindera
Copy link
Copy Markdown
Contributor

Code Review — ALFMOB-204: UITesting Example

This is meant to serve as a starting point template for the team, so code quality here sets the standard. Three issues found:

🔴 Critical — app.activate() should be app.launch()

In AlfieUITests.swift:20, app.activate() only brings an already-running app to the foreground — it does not launch the app if it isn't running. This means the test will fail on a clean test run.

Fix: Change app.activate() to app.launch() to ensure the app starts in a fresh, known state for each test.

🟡 High — Hard-coded brand name makes test brittle

Line 23 taps on "04AugPhilos" which is specific test/sample data. If this brand is removed or renamed, the test breaks silently. For a template, this should demonstrate a more robust approach.

Suggestion: Either use a more generic selector (e.g., find the first available brand), or add a comment/doc explaining the data dependency.

🟠 Medium — Xcode UI Recorder tokens left in

Lines 21-23 contain /*@START_MENU_TOKEN@*/.../*@END_MENU_TOKEN@*/ auto-generated placeholders. These should be cleaned up for readability, especially in a template that others will copy.

Fix: Replace with explicit, readable selectors, e.g.:

app.otherElements["shop-tab"].images["storefront"].tap()
app.scrollViews.buttons["Brands"].tap()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants