Skip to content

Commit

Permalink
Merge pull request #464 from nimblehq/release/4.3.0
Browse files Browse the repository at this point in the history
Release - 4.3.0
  • Loading branch information
vnntsu authored Mar 31, 2023
2 parents f506480 + 2833cca commit 70096c0
Show file tree
Hide file tree
Showing 24 changed files with 122 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/wiki/Project-Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ There are 3 default targets in a project:

- {ProjectName}
- {ProjectName}Tests
- {ProjectName}UITests
- {ProjectName}KIFUITests

### Schemes

Expand Down
11 changes: 4 additions & 7 deletions .github/wiki/Standard-File-Organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ To keep all current and upcoming iOS projects aligned, we standardize an iOS pro
│   ├── Data+Decode.swift
│   ├── String+Data.swift
│   └── TestError.swift
└── {ProjectName}UITests
└── {ProjectName}KIFUITests
   ├── Configurations
   │   └── Plists
   ├── Resources
   └── Sources
   ├── AccessibilityIdentifiers
   │   ├── Login
Expand All @@ -121,9 +120,7 @@ To keep all current and upcoming iOS projects aligned, we standardize an iOS pro
   │   ├── Login
   │   └── Home
   └── Utilities
   ├── Data+Decode.swift
   ├── String+Data.swift
   └── TestError.swift
   └── KIF+Swift.swift
```

## README.md
Expand All @@ -146,6 +143,6 @@ This folder contains the main sources of the project. There are three sub-folder

This folder contains the unit testing and integration testing of the main project.

## {ProjectName}UITests
## {ProjectName}KIFUITests

This folder contains the UI testing of the main project.
This folder contains the KIF UI testing of the main project. Use KIF instead of XCUITest for speed and reliability.
9 changes: 4 additions & 5 deletions .github/workflows/automatic_pull_request_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ on:
pull_request:
types: [opened, reopened, edited, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
review_pull_request:
name: Pull request review by Danger
runs-on: macOS-12
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/deploy_app_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
branches: [ master, main ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
Expand All @@ -29,11 +33,6 @@ jobs:
name: Build
runs-on: macOS-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout Repo
uses: actions/checkout@v2
# Set fetch-depth (default: 1) to get whole tree
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/deploy_production_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
branches: [ release/** ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Lint:
name: lint
Expand All @@ -29,11 +33,6 @@ jobs:
name: Build
runs-on: macOS-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
# Set fetch-depth (default: 1) to get whole tree
with:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/deploy_staging_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
branches: [ develop ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
Expand All @@ -29,11 +33,6 @@ jobs:
name: Build
runs-on: macOS-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
# Set fetch-depth (default: 1) to get whole tree
with:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test_install_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ on:
push:
branches: [ feature/**, bug/**, chore/** ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Test:
name: Test
runs-on: macOS-12
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test_upload_build_to_test_flight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ name: Test Upload Build to TestFlight
on:
pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: macOS-12
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout Repo
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
included:
- {PROJECT_NAME}
- {PROJECT_NAME}Tests
- {PROJECT_NAME}UITests
- {PROJECT_NAME}KIFUITests

excluded:
- {PROJECT_NAME}Tests/Sources/Mocks/Sourcery/AutoMockable.generated.swift
Expand Down
11 changes: 6 additions & 5 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ def testing_pods
pod 'Nimble'
pod 'RxNimble', subspecs: ['RxBlocking', 'RxTest']
pod 'RxSwift'
# TODO: Remove or update the version of `1.8.0` to the newest version (not 1.8.1) when init a new project.
# Currently, there is a bug on `1.8.1` - the newest version.
pod 'Sourcery', '1.8.0'
pod 'Sourcery'
pod 'SwiftFormat/CLI'
end

Expand All @@ -32,19 +30,22 @@ target '{PROJECT_NAME}' do
pod 'IQKeyboardManagerSwift'
pod 'NimbleExtension', :git => 'https://github.com/nimblehq/NimbleExtension', :branch => 'master'
pod 'R.swift'
pod 'Resolver' # Needs Cocoapods on iOS 11 to support Resolver
pod 'Factory'

# Development
pod 'SwiftLint'
pod 'Wormholy', :configurations => ['Debug Staging', 'Debug Production']
pod 'xcbeautify'

target '{PROJECT_NAME}Tests' do
inherit! :search_paths
testing_pods
end

target '{PROJECT_NAME}UITests' do
target '{PROJECT_NAME}KIFUITests' do
testing_pods
pod 'KIF', :configurations => ['Debug Staging', 'Debug Production']
pod 'KIF/IdentifierTests', :configurations => ['Debug Staging', 'Debug Production']
end
end

Expand Down
5 changes: 3 additions & 2 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ extension Project {
targets: [
.mainTarget(name: name, bundleId: bundleId),
.testsTarget(name: name, bundleId: bundleId),
.uiTestsTarget(name: name, bundleId: bundleId)
.kifUITestsTarget(name: name, bundleId: bundleId),
],
schemes: [
.productionScheme(name: name),
.stagingScheme(name: name)
.stagingScheme(name: name),
.kifUITestsScheme(name: name)
]
)
}
Expand Down
20 changes: 18 additions & 2 deletions Tuist/ProjectDescriptionHelpers/Scheme+Initializing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ extension Scheme {
name: name,
shared: true,
buildAction: .buildAction(targets: ["\(name)"]),
testAction: .targets(["\(name)Tests", "\(name)UITests"], configuration: debugConfigName),
testAction: .targets(
["\(name)Tests", "\(name)KIFUITests"],
configuration: debugConfigName
),
runAction: .runAction(configuration: debugConfigName),
archiveAction: .archiveAction(configuration: releaseConfigName),
profileAction: .profileAction(configuration: debugConfigName),
Expand All @@ -24,11 +27,24 @@ extension Scheme {
name: "\(name) Staging",
shared: true,
buildAction: .buildAction(targets: ["\(name)"]),
testAction: .targets(["\(name)Tests", "\(name)UITests"], configuration: debugConfigName),
testAction: .targets(
["\(name)Tests", "\(name)KIFUITests"],
configuration: debugConfigName
),
runAction: .runAction(configuration: debugConfigName),
archiveAction: .archiveAction(configuration: releaseConfigName),
profileAction: .profileAction(configuration: debugConfigName),
analyzeAction: .analyzeAction(configuration: debugConfigName)
)
}

public static func kifUITestsScheme(name: String) -> Scheme {
let debugConfigName = BuildConfiguration.debugStaging.name
let releaseConfigName = BuildConfiguration.releaseStaging.name
return Scheme(
name: "\(name)KIFUITests",
shared: false,
hidden: true
)
}
}
7 changes: 3 additions & 4 deletions Tuist/ProjectDescriptionHelpers/Target+Initializing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,17 @@ extension Target {
)
}

public static func uiTestsTarget(name: String, bundleId: String) -> Target {
let targetName = "\(name)UITests"
public static func kifUITestsTarget(name: String, bundleId: String) -> Target {
let targetName = "\(name)KIFUITests"
return Target(
name: targetName,
platform: .iOS,
product: .uiTests,
product: .unitTests,
bundleId: bundleId,
infoPlist: "\(targetName)/\(plistsPath)/Info.plist",
sources: ["\(targetName)/**"],
resources: [
"\(targetName)/**/.gitkeep", // To include empty folders
"\(targetName)/Resources/**/*"
],
dependencies: [.target(name: name)]
)
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Constants/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ enum Constant {
// MARK: - Test

static let testTarget: String = "\(projectName)Tests"
static let uiTestTarget: String = "\(projectName)UITests"
static let kifUITestTarget: String = "\(projectName)KIFUITests"
}

extension Constant {
Expand Down
5 changes: 4 additions & 1 deletion fastlane/Fastfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ class Fastfile: LaneFile {
desc("Build and Test project")
Test.buildAndTest(
environment: .staging,
targets: [Constant.testTarget, Constant.uiTestTarget],
targets: [
Constant.testTarget,
Constant.kifUITestTarget
],
devices: Constant.devices
)
}
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Helpers/Build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ enum Build {
]),
buildPath: .userDefined(Constant.buildPath),
derivedDataPath: .userDefined(Constant.derivedDataPath),
xcodebuildFormatter: "xcpretty" // Default `xcbeautify` will never work
xcodebuildFormatter: "Pods/xcbeautify/xcbeautify"
)
}
}
2 changes: 1 addition & 1 deletion fastlane/Helpers/Test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enum Test {
onlyTesting: targets,
codeCoverage: .userDefined(true),
outputDirectory: Constant.testOutputDirectoryPath,
xcodebuildFormatter: "xcpretty",
xcodebuildFormatter: "Pods/xcbeautify/xcbeautify",
resultBundle: .userDefined(true),
failBuild: .userDefined(false)
)
Expand Down
4 changes: 2 additions & 2 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ rename_folder(){
# Rename test folder structure
rename_folder "${CONSTANT_PROJECT_NAME}Tests" "${PROJECT_NAME_NO_SPACES}Tests"

# Rename UI Test folder structure
rename_folder "${CONSTANT_PROJECT_NAME}UITests" "${PROJECT_NAME_NO_SPACES}UITests"
# Rename KIF UI Test folder structure
rename_folder "${CONSTANT_PROJECT_NAME}KIFUITests" "${PROJECT_NAME_NO_SPACES}KIFUITests"

# Rename app folder structure
rename_folder "${CONSTANT_PROJECT_NAME}" "${PROJECT_NAME_NO_SPACES}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// ApplicationSpec.swift
//

import Foundation
import Nimble
import Quick

final class ApplicationSpec: QuickSpec {

override func spec() {

describe("a {PROJECT_NAME} screen") {

beforeEach {
// Navigate to the testing screen
}

afterEach {
// Navigate to neutral state
}

context("when opens") {

it("shows its UI components") {
self.tester().waitForView(withAccessibilityLabel: "Hello")
}
}
}
}
}
17 changes: 17 additions & 0 deletions {PROJECT_NAME}KIFUITests/Sources/Utilities/KIF+Swift.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// swiftlint:disable:this file_name
//
// KIF+Swift.swift
//

import KIF

extension XCTestCase {

func tester(file: String = #file, _ line: Int = #line) -> KIFUITestActor {
return KIFUITestActor(inFile: file, atLine: line, delegate: self)
}

func system(file: String = #file, _ line: Int = #line) -> KIFSystemTestActor {
return KIFSystemTestActor(inFile: file, atLine: line, delegate: self)
}
}
Loading

0 comments on commit 70096c0

Please sign in to comment.