Skip to content
Merged
Changes from all commits
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
21 changes: 21 additions & 0 deletions App/SwiftMarkItDownAppUITests/SwiftMarkItDownAppUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import XCTest

final class SwiftMarkItDownAppUITests: XCTestCase {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wire the UI test into the Xcode project

This new XCUITest file is not referenced by SwiftMarkItDownApp.xcodeproj: the project only defines the app target and its sources, and the shared scheme's <Testables> list is empty, so xcodebuild test will not compile or run this test. In practice the smoke coverage added here is silently dead until a UI test target/group/build phase and scheme testable are added.

Useful? React with 👍 / 👎.

func testDefaultHTMLSampleConvertsToMarkdown() throws {
let app = XCUIApplication()
app.launch()

let convertButton = app.buttons["convertButton"]
XCTAssertTrue(convertButton.waitForExistence(timeout: 10), "Convert button should be visible")
convertButton.tap()

let output = app.textViews["conversionOutput"]
XCTAssertTrue(output.waitForExistence(timeout: 10), "Markdown output editor should be visible")

let markdown = String(describing: output.value ?? output.label)
XCTAssertTrue(markdown.contains("# Hello from iOS"), "Expected converted heading in output, got: \(markdown)")
XCTAssertTrue(markdown.contains("**native Swift**"), "Expected converted emphasis in output, got: \(markdown)")
XCTAssertTrue(markdown.contains("[Example](https://example.com)"), "Expected converted link in output, got: \(markdown)")
XCTAssertFalse(markdown.contains("Ignored title"), "HTML head content should not appear in output")
}
}
Loading