Skip to content

feat: Add XCUITest suite and CI workflow for issue #326#654

Draft
Mounil2005 wants to merge 1 commit into
scribe-org:mainfrom
Mounil2005:feat/ui-tests-and-ci
Draft

feat: Add XCUITest suite and CI workflow for issue #326#654
Mounil2005 wants to merge 1 commit into
scribe-org:mainfrom
Mounil2005:feat/ui-tests-and-ci

Conversation

@Mounil2005
Copy link
Copy Markdown

[ ] This pull request is on a separate branch and not the main branch
[ ] I have tested my code with the xcodebuild and swiftlint --strict commands as directed in the testing section of the contributing guide
Description:

  1. Adds a XCUITest suite and a dedicated CI workflow as requested in Add UI tests and CI process #326.

  2. Scribe.xcodeproj/project.pbxproj and Scribe.xcscheme

  3. The ScribeUITests UI testing bundle target was registered by directly editing project.pbxproj, since Xcode is required on macOS to do this through the GUI. All required sections were updated to mirror the structure of the existing Tests unit test target: PBXBuildFile, PBXFileReference, PBXGroup, PBXSourcesBuildPhase, PBXFrameworksBuildPhase, PBXResourcesBuildPhase, PBXContainerItemProxy, PBXTargetDependency, PBXNativeTarget, and XCBuildConfiguration. The target uses product type com.apple.product-type.bundle.ui-testing and TEST_TARGET_NAME = Scribe (the correct build setting for UI tests, as opposed to BUNDLE_LOADER/TEST_HOST used for unit tests). The Scribe.xcscheme was updated to include ScribeUITests in its TestAction so that xcodebuild build-for-testing picks it up.

  4. Tests/UITests/

Four XCTestCase files covering the three main tabs:

  • AppLaunchUITests.swift: verifies the app launches, the tab bar has exactly 3 items, the Installation tab is selected by default, and all three tabs can be navigated to
  • InstallationTabUITests.swift: verifies the "Keyboard installation" header label, the "Quick tutorial" button, the "Download keyboard data" card (a SwiftUI onTapGesture element, not a UIButton), navigation to and back from the Download Data screen, and the custom pop-to-root behavior when re-tapping the Installation tab
  • SettingsTabUITests.swift: verifies the Settings navigation bar and that the table view has cells
  • AboutTabUITests.swift: verifies the About navigation bar, table view cells, and that tapping the "Privacy policy" cell navigates to the InformationScreenVC with the correct nav bar title
  1. All UI element labels and accessibility identifiers were verified against the source code before writing the assertions (e.g. installationHeaderLabel.text, hostingController.title, navigationItem.title, navigationItem.backButtonTitle).

6 .github/workflows/ci_uitest.yaml
:
A separate workflow from the existing ci_test.yaml. Uses xcodebuild build-for-testing followed by test-without-building -only-testing:ScribeUITests on an iPhone 16 / iOS 18.5 simulator. Triggered on PRs and pushes to main.

Testing note: The project file changes could not be validated locally with Xcode (no Mac). A maintainer with Mac access should open the project once to confirm Xcode accepts it before merging. Individual test assertions may need minor adjustment if any UI element accessibility labels differ from what the source code shows at runtime.

Related issue:
Closes #326

- Register ScribeUITests UI testing target in Scribe.xcodeproj by
  directly editing project.pbxproj (no Mac available for Xcode GUI)
- Add ScribeUITests to the Scribe scheme TestAction
- Add Tests/UITests/ with four XCTestCase files covering app launch,
  Installation tab (header, download card navigation, back nav,
  pop-to-root on tab retap), Settings tab, and About tab
- Add .github/workflows/ci_uitest.yaml running UI tests on
  iPhone 16 / iOS 18.5 simulator, separate from the unit test workflow

Resolves scribe-org#326

Signed-off-by: Mounil Kanakhara <mounilkankhara@gmail.com>
@github-actions
Copy link
Copy Markdown

Thank you for the pull request! 💙🩵

The Scribe-iOS team will do our best to address your contribution as soon as we can. The following are some important points:

  • Those interested in developing their skills and expanding their role in the community should read the mentorship and growth section of the contribution guide
  • If you're not already a member of our public Matrix community, please consider joining!
    • We'd suggest that you use the Element client as well as Element X for a mobile app
    • Join the General and iOS rooms once you're in
  • Also consider attending our bi-weekly Saturday developer syncs!
    • Details are shared in the General room on Matrix each Wednesday before the sync
    • It would be great to meet you 😊

Note

Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible.

@github-actions
Copy link
Copy Markdown

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • Tests for changes have been written and the CI unit test, linting and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

First PR Commit Check

  • The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution
    • The contributor's name and icon in remote commits should be the same as what appears in the PR
    • If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for git config user.email in their local Scribe-iOS repo (can be set with git config --global user.email "GITHUB_EMAIL")

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.

Add UI tests and CI process

1 participant