Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/build_and_test.yml'
- 'Sources/**'
- '!Sources/Runestone/Documentation.docc/**'
- 'Tests/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
jobs:
build:
name: Build and test on iPhone 14
Expand All @@ -23,10 +24,13 @@ jobs:
submodules: recursive
- name: Build
run: |
xcodebuild build-for-testing -scheme Runestone -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14'
xcodebuild build-for-testing\
-scheme Runestone\
-sdk iphonesimulator\
-destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0"
- name: Test
env:
scheme: ${{ 'default' }}
platform: ${{ 'iOS Simulator' }}
run: |
xcodebuild test-without-building -scheme Runestone -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14'
xcodebuild test-without-building\
-scheme Runestone\
-sdk iphonesimulator\
-destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0"
9 changes: 7 additions & 2 deletions .github/workflows/build_example_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/build_example_project.yml'
- 'Example/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
jobs:
build:
name: Build example project for iPhone 14
Expand All @@ -21,4 +22,8 @@ jobs:
submodules: recursive
- name: Build
run: |
xcodebuild build -project Example/Example.xcodeproj -scheme Example -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14'
xcodebuild build\
-project Example/Example.xcodeproj\
-scheme Example\
-sdk iphonesimulator\
-destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0"
8 changes: 6 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
jobs:
analyze:
name: Analyze
Expand All @@ -29,7 +29,11 @@ jobs:
with:
languages: ${{ matrix.language }}
- name: Build
run: xcodebuild -scheme Runestone -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14'
run: |
xcodebuild\
-scheme Runestone\
-sdk iphonesimulator\
-destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=17.0"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
group: "pages"
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
jobs:
build:
runs-on: macos-13
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/ui_tests.yml'
- 'Sources/**'
- '!Sources/Runestone/Documentation.docc/**'
- 'UITests/HostUITests/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
jobs:
run_korean_tests:
name: Run Korean tests
Expand All @@ -28,7 +29,7 @@ jobs:
- name: Disable "Use the Same Keyboard Language as macOS"
run: defaults write com.apple.iphonesimulator EnableKeyboardSync -bool NO
- name: Create Simulator
run: xcrun simctl create "${SIMULATOR_NAME}" "iPhone 8"
run: xcrun simctl create "${SIMULATOR_NAME}" "iPhone 13" "iOS15.5"
- name: Find Simulator UDID
run: |
TMP_SIMULATOR_UDID=`xcrun simctl list --json devices | jq -r ".devices | flatten | .[] | select(.name == \"${SIMULATOR_NAME}\").udid"`
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
- name: Disable "Use the Same Keyboard Language as macOS"
run: defaults write com.apple.iphonesimulator EnableKeyboardSync -bool NO
- name: Create Simulator
run: xcrun simctl create "${SIMULATOR_NAME}" "iPhone 8"
run: xcrun simctl create "${SIMULATOR_NAME}" "iPhone 13" "iOS15.5"
- name: Find Simulator UDID
run: |
TMP_SIMULATOR_UDID=`xcrun simctl list --json devices | jq -r ".devices | flatten | .[] | select(.name == \"${SIMULATOR_NAME}\").udid"`
Expand Down
2 changes: 1 addition & 1 deletion Scripts/run-ui-test-chinese.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PROJECT_PATH="${SCRIPT_PATH}/../UITests/UITests.xcodeproj"
# Disable "Use the Same Keyboard Language as macOS" in Simulator.app.
defaults write com.apple.iphonesimulator EnableKeyboardSync -bool NO
# Create the simulator we will use for the tests.
xcrun simctl create "${SIMULATOR_NAME}" "iPhone 8" 2> /dev/null
xcrun simctl create "${SIMULATOR_NAME}" "iPhone 13" "iOS15.5" 2> /dev/null
# Find the UDID of the newly created simulator.
SIMULATOR_UDID=`xcrun simctl list --json devices | jq -r ".devices | flatten | .[] | select(.name == \"${SIMULATOR_NAME}\").udid"`
# Edit the simulator's .GlobalPreferences.plist to use the Chinese language.
Expand Down
2 changes: 1 addition & 1 deletion Scripts/run-ui-test-korean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PROJECT_PATH="${SCRIPT_PATH}/../UITests/UITests.xcodeproj"
# Disable "Use the Same Keyboard Language as macOS" in Simulator.app.
defaults write com.apple.iphonesimulator EnableKeyboardSync -bool NO
# Create the simulator we will use for the tests.
xcrun simctl create "${SIMULATOR_NAME}" "iPhone 8" 2> /dev/null
xcrun simctl create "${SIMULATOR_NAME}" "iPhone 13" "iOS15.5" 2> /dev/null
# Find the UDID of the newly created simulator.
SIMULATOR_UDID=`xcrun simctl list --json devices | jq -r ".devices | flatten | .[] | select(.name == \"${SIMULATOR_NAME}\").udid"`
# Edit the simulator's .GlobalPreferences.plist to use the Korean language.
Expand Down
31 changes: 0 additions & 31 deletions UITests/HostUITests/KoreanInputTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,37 +95,6 @@ final class KoreanInputTests: XCTestCase {
XCTAssertEqual(app.textView?.value as? String, "\"어\"")
}

func testInsertingKoreanCharactersBelowStringContainingKoreanLetters() throws {
let app = XCUIApplication().disablingTextPersistance()
app.launch()
app.textView?.tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
app.buttons["Return"].tap()
app.keys["more"].tap()
app.keys["\""].tap()
app.keys["more"].tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
app.tap(at: CGPoint(x: 100, y: 100))
app.buttons["Return"].tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
app.keys["ㅇ"].tap()
app.keys["ㅓ"].tap()
XCTAssertEqual(app.textView?.value as? String, "어어어\n\"어어어\"\n어어어")
}

func testInsertingKoreanCharactersInTextWithCRLFLineEndings() throws {
let app = XCUIApplication().disablingTextPersistance().usingCRLFLineEndings()
app.launch()
Expand Down
7 changes: 0 additions & 7 deletions UITests/HostUITests/XCUIApplication+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ extension XCUIApplication {
scrollViews.children(matching: .textView).element
}

func tap(at point: CGPoint) {
let normalized = coordinate(withNormalizedOffset: .zero)
let offset = CGVector(dx: point.x, dy: point.y)
let coordinate = normalized.withOffset(offset)
coordinate.tap()
}

func disablingTextPersistance() -> Self {
var newLaunchEnvironment = launchEnvironment
newLaunchEnvironment[EnvironmentKey.disableTextPersistance] = "1"
Expand Down