Skip to content

test: add more tests#2

Merged
sirily11 merged 1 commit intomainfrom
test
Mar 2, 2026
Merged

test: add more tests#2
sirily11 merged 1 commit intomainfrom
test

Conversation

@sirily11
Copy link
Copy Markdown
Contributor

@sirily11 sirily11 commented Mar 1, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 1, 2026 18:28
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxnote Ready Ready Preview, Comment Mar 2, 2026 3:55am

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds more UI tests for the RxNote iOS app and simultaneously fixes the login page title/description in the backend, plus adds pending deep link handling for pre-authentication URLs in the app.

Changes:

  • New UI test files for note CRUD, deep link handling, and QR code scanning in the RxNote app (RxNoteUITests)
  • New App Clips UI test utilities (RxNoteClipsUITests) including sign-in helpers, launch helpers, accessibility helpers, and a DotEnv utility
  • Production app changes: ContentView and AdaptiveRootView updated to capture and process deep links received before authentication completes; accessibility identifiers added to note list row, editor title/content fields, and toolbar buttons; backend login page rebranded from "Storage Management" to "RxNote"

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
backend/app/(auth)/login/page.tsx Rebrands login page title and description from "Storage Management" to "RxNote"
RxNote/RxNoteUITests/utils/signin.swift Adds comment explaining why the notes check is skipped for App Clips
RxNote/RxNoteUITests/utils/accessibility.swift New file providing XCUIApplication extension properties for all accessibility identifiers used in tests
RxNote/RxNoteUITests/RxNoteQRScanTests.swift New UI tests for QR code scanning scenarios
RxNote/RxNoteUITests/RxNoteNoteCrudTests.swift New UI tests for note create/read/update/delete
RxNote/RxNoteUITests/RxNoteDeepLinkTests.swift New UI tests for deep link handling
RxNote/RxNoteClipsUITests/utils/signin.swift New sign-in helper for App Clips UI tests
RxNote/RxNoteClipsUITests/utils/launch.swift New launch helpers for App Clips UI tests
RxNote/RxNoteClipsUITests/utils/accessibility.swift New XCUIApplication extension with App Clips-specific accessibility element accessors
RxNote/RxNoteClipsUITests/utils/DotEnv.swift New utility to load test credentials from .env file or process environment
RxNote/RxNote/Views/Notes/NoteListView.swift Adds accessibility identifier to each note row in the list
RxNote/RxNote/Views/Notes/NoteEditorView.swift Adds accessibility identifiers to the edit button, save button, title field, and content field
RxNote/RxNote/Views/AdaptiveRootView.swift Adds @Binding var pendingDeepLinkURL and a .task to process deep links received before auth
RxNote/RxNote/ContentView.swift Adds onOpenURL and onContinueUserActivity handlers to capture deep links pre-authentication

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +125 to +127
if deleteButton.waitForExistence(timeout: 5) {
deleteButton.tap()
}
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

In testDeleteNote, the delete button tap is wrapped in an if deleteButton.waitForExistence(timeout: 5) block without a failing assertion if the button is not found. If the swipe-to-delete gesture does not surface the delete button, the test silently skips the deletion and then incorrectly asserts that the note is absent from the list via waitForNonExistence. This could produce a false pass or a misleading failure. The if should be replaced with an XCTAssertTrue to ensure the test fails explicitly when the delete button doesn't appear.

Suggested change
if deleteButton.waitForExistence(timeout: 5) {
deleteButton.tap()
}
XCTAssertTrue(deleteButton.waitForExistence(timeout: 5), "Delete button should appear after swiping left")
deleteButton.tap()

Copilot uses AI. Check for mistakes.

// Verify the title was updated
let updatedTitle = app.noteDetailTitle.firstMatch
XCTAssertTrue(updatedTitle.waitForExistence(timeout: 10), "Updated title should appear")
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

In testEditNote, the "Select All" menu item tap is wrapped in an if selectAll.waitForExistence(timeout: 3) block, so if the context menu doesn't appear the existing title text won't be selected before calling typeText. The typeText call then appends to whatever text is already in the field rather than replacing it, resulting in a value like "Public Test NoteUpdated Test Note". The final assertion only checks that noteDetailTitle exists (not its value), so the test would pass even with the wrong title. Either assert the final title value (e.g. XCTAssertEqual(app.noteDetailTitle.label, "Updated Test Note")) or fail the test if selectAll is not found.

Suggested change
XCTAssertTrue(updatedTitle.waitForExistence(timeout: 10), "Updated title should appear")
XCTAssertTrue(updatedTitle.waitForExistence(timeout: 10), "Updated title should appear")
XCTAssertEqual(updatedTitle.label, "Updated Test Note")

Copilot uses AI. Check for mistakes.
staticTexts["Sign In Required"].firstMatch
}

var appClipsAccessDenined: XCUIElement {
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The property name appClipsAccessDenined is a misspelling of "Denied". This typo is present in both RxNoteUITests/utils/accessibility.swift (line 77) and RxNoteClipsUITests/utils/accessibility.swift (line 17), as well as any call sites that use this property. It should be appClipsAccessDenied.

Suggested change
var appClipsAccessDenined: XCUIElement {
var appClipsAccessDenied: XCUIElement {

Copilot uses AI. Check for mistakes.
staticTexts["Sign In Required"].firstMatch
}

var appClipsAccessDenined: XCUIElement {
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The property name appClipsAccessDenined is a misspelling of "Denied". It should be appClipsAccessDenied.

Suggested change
var appClipsAccessDenined: XCUIElement {
var appClipsAccessDenied: XCUIElement {

Copilot uses AI. Check for mistakes.
let passwordField = safariViewServiceApp.secureTextFields["Enter your password"].firstMatch

// Use a longer timeout and provide better error message
let emailFieldExists = emailField.waitForExistence(timeout: 30)
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

On the iOS branch (inside #if os(iOS)), emailFieldExists is assigned the result of emailField.waitForExistence(timeout: 30) at line 52, but the result is never asserted. If the email field does not appear, the test will silently proceed and interact with non-existing elements rather than failing with a meaningful error. An XCTAssertTrue(emailFieldExists, "Failed to find email field on OAuth page") call is needed, matching the pattern already used in the #elseif os(macOS) branch on line 72.

Suggested change
let emailFieldExists = emailField.waitForExistence(timeout: 30)
let emailFieldExists = emailField.waitForExistence(timeout: 30)
XCTAssertTrue(emailFieldExists, "Failed to find email field on OAuth page")

Copilot uses AI. Check for mistakes.
guard let testPassword = DotEnv.get("TEST_PASSWORD", from: envVars) else {
throw NSError(domain: "SigninError", code: 1, userInfo: [NSLocalizedDescriptionKey: "TEST_PASSWORD not found in .env file or environment"])
}
NSLog("🔐 Using test password: \(testPassword)")
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The call to NSLog with testPassword logs the full test account password in cleartext to the test logs. Anyone with access to CI or device logs could retrieve these credentials and reuse them against your OAuth provider or other environments. Remove logging of secrets entirely (or at minimum mask the value) while keeping only non-sensitive context like which flow is being exercised.

Suggested change
NSLog("🔐 Using test password: \(testPassword)")
NSLog("🔐 Using test password from environment (value hidden)")

Copilot uses AI. Check for mistakes.
@sirily11 sirily11 merged commit d7a6b78 into main Mar 2, 2026
9 checks passed
@sirily11 sirily11 deleted the test branch March 2, 2026 04:10
@sirily11
Copy link
Copy Markdown
Contributor Author

sirily11 commented Mar 2, 2026

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

2 participants