Skip to content

Profile screen accessibility snapshot #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 19, 2023
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
82 changes: 82 additions & 0 deletions .github/workflows/snapshot-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Snapshot Testing

on:
pull_request:

jobs:
test:
name: Test snapshots
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup Node.js and Yarn
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: CocoaPods cache
uses: actions/cache@v3
with:
path: |
ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Configure CocoaPods
run: cd ios && pod install && cd ..

- name: DerivedData cache
uses: actions/cache@v3
with:
path: |
ios/DerivedData
key: ${{ runner.os }}-deriveddata-${{ hashFiles('ios/Podfile.lock', 'yarn.lock', 'ios/AccessibilitySnapshotExample.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
restore-keys: |
${{ runner.os }}-deriveddata-

- name: xcodebuild test
id: xcodeTest
run: |
echo "export FORCE_BUNDLING=1" > ios/.xcode.env.local
xcodebuild -workspace ios/AccessibilitySnapshotExample.xcworkspace -scheme AccessibilitySnapshotExample -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ios/DerivedData/ USE_LOCAL_BUNDLE=1 test
continue-on-error: true

- uses: actions/upload-artifact@v3
if: steps.xcodeTest.outcome != 'success'
with:
name: snapshots
path: /tmp/iOS-Snapshots

- uses: actions/github-script@v6
if: steps.xcodeTest.outcome != 'success'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Xcode failed when running tests.

Check the [workflow logs and artifacts](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}).`,
})

- name: Fail after upload artifacts
if: steps.xcodeTest.outcome != 'success'
run: |
echo "Xcode failed when running tests. Check the workflow logs and artifacts."
exit 1
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.6
100 changes: 94 additions & 6 deletions ios/AccessibilitySnapshotExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
objects = {

/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* AccessibilitySnapshotExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* AccessibilitySnapshotExampleTests.m */; };
0C80B921A6F3F58F76C31292 /* libPods-AccessibilitySnapshotExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-AccessibilitySnapshotExample.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
4371710C29EFFF54006B6B15 /* AccessibilitySnapshot in Frameworks */ = {isa = PBXBuildFile; productRef = 4371710B29EFFF54006B6B15 /* AccessibilitySnapshot */; };
4371710E29EFFF88006B6B15 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 4371710D29EFFF88006B6B15 /* SnapshotTesting */; };
43772BE229ED3CF60000A557 /* AccessibilitySnapshot in Frameworks */ = {isa = PBXBuildFile; productRef = 43772BE129ED3CF60000A557 /* AccessibilitySnapshot */; };
43EE060829EFF89500D2757D /* AccessibilitySnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43EE060729EFF89500D2757D /* AccessibilitySnapshotTests.swift */; };
43EE060D29EFFE8900D2757D /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 43EE060C29EFFE8900D2757D /* SnapshotTesting */; };
7699B88040F8A987B510C191 /* libPods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
Expand All @@ -29,7 +33,6 @@
/* Begin PBXFileReference section */
00E356EE1AD99517003FC87E /* AccessibilitySnapshotExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AccessibilitySnapshotExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* AccessibilitySnapshotExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AccessibilitySnapshotExampleTests.m; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* AccessibilitySnapshotExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AccessibilitySnapshotExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = AccessibilitySnapshotExample/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = AccessibilitySnapshotExample/AppDelegate.mm; sourceTree = "<group>"; };
Expand All @@ -38,6 +41,7 @@
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = AccessibilitySnapshotExample/main.m; sourceTree = "<group>"; };
19F6CBCC0A4E27FBF8BF4A61 /* libPods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B4392A12AC88292D35C810B /* Pods-AccessibilitySnapshotExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AccessibilitySnapshotExample.debug.xcconfig"; path = "Target Support Files/Pods-AccessibilitySnapshotExample/Pods-AccessibilitySnapshotExample.debug.xcconfig"; sourceTree = "<group>"; };
43EE060729EFF89500D2757D /* AccessibilitySnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilitySnapshotTests.swift; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-AccessibilitySnapshotExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AccessibilitySnapshotExample.release.xcconfig"; path = "Target Support Files/Pods-AccessibilitySnapshotExample/Pods-AccessibilitySnapshotExample.release.xcconfig"; sourceTree = "<group>"; };
5B7EB9410499542E8C5724F5 /* Pods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests/Pods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-AccessibilitySnapshotExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AccessibilitySnapshotExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -51,15 +55,19 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4371710E29EFFF88006B6B15 /* SnapshotTesting in Frameworks */,
7699B88040F8A987B510C191 /* libPods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.a in Frameworks */,
4371710C29EFFF54006B6B15 /* AccessibilitySnapshot in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
43EE060D29EFFE8900D2757D /* SnapshotTesting in Frameworks */,
0C80B921A6F3F58F76C31292 /* libPods-AccessibilitySnapshotExample.a in Frameworks */,
43772BE229ED3CF60000A557 /* AccessibilitySnapshot in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -69,7 +77,7 @@
00E356EF1AD99517003FC87E /* AccessibilitySnapshotExampleTests */ = {
isa = PBXGroup;
children = (
00E356F21AD99517003FC87E /* AccessibilitySnapshotExampleTests.m */,
43EE060729EFF89500D2757D /* AccessibilitySnapshotTests.swift */,
00E356F01AD99517003FC87E /* Supporting Files */,
);
path = AccessibilitySnapshotExampleTests;
Expand Down Expand Up @@ -165,9 +173,15 @@
buildRules = (
);
dependencies = (
43EE060F29EFFE9200D2757D /* PBXTargetDependency */,
43EE060A29EFFDEB00D2757D /* PBXTargetDependency */,
00E356F51AD99517003FC87E /* PBXTargetDependency */,
);
name = AccessibilitySnapshotExampleTests;
packageProductDependencies = (
4371710B29EFFF54006B6B15 /* AccessibilitySnapshot */,
4371710D29EFFF88006B6B15 /* SnapshotTesting */,
);
productName = AccessibilitySnapshotExampleTests;
productReference = 00E356EE1AD99517003FC87E /* AccessibilitySnapshotExampleTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
Expand All @@ -190,6 +204,10 @@
dependencies = (
);
name = AccessibilitySnapshotExample;
packageProductDependencies = (
43772BE129ED3CF60000A557 /* AccessibilitySnapshot */,
43EE060C29EFFE8900D2757D /* SnapshotTesting */,
);
productName = AccessibilitySnapshotExample;
productReference = 13B07F961A680F5B00A75B9A /* AccessibilitySnapshotExample.app */;
productType = "com.apple.product-type.application";
Expand All @@ -204,6 +222,7 @@
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
LastSwiftMigration = 1420;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
Expand All @@ -220,6 +239,10 @@
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192;
packageReferences = (
43772BE029ED3CF60000A557 /* XCRemoteSwiftPackageReference "AccessibilitySnapshot" */,
43EE060B29EFFE8900D2757D /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */,
);
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -404,7 +427,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
00E356F31AD99517003FC87E /* AccessibilitySnapshotExampleTests.m in Sources */,
43EE060829EFF89500D2757D /* AccessibilitySnapshotTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -425,6 +448,14 @@
target = 13B07F861A680F5B00A75B9A /* AccessibilitySnapshotExample */;
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
};
43EE060A29EFFDEB00D2757D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = 43EE060929EFFDEB00D2757D /* AccessibilitySnapshot */;
};
43EE060F29EFFE9200D2757D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = 43EE060E29EFFE9200D2757D /* SnapshotTesting */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
Expand All @@ -433,12 +464,13 @@
baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = AccessibilitySnapshotExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -451,6 +483,8 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AccessibilitySnapshotExample.app/AccessibilitySnapshotExample";
};
name = Debug;
Expand All @@ -460,9 +494,10 @@
baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-AccessibilitySnapshotExample-AccessibilitySnapshotExampleTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = AccessibilitySnapshotExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -475,6 +510,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AccessibilitySnapshotExample.app/AccessibilitySnapshotExample";
};
name = Release;
Expand Down Expand Up @@ -699,6 +735,58 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
43772BE029ED3CF60000A557 /* XCRemoteSwiftPackageReference "AccessibilitySnapshot" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/cashapp/AccessibilitySnapshot.git";
requirement = {
branch = "entin/perceptual-precision";
kind = branch;
};
};
43EE060B29EFFE8900D2757D /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.11.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
4371710B29EFFF54006B6B15 /* AccessibilitySnapshot */ = {
isa = XCSwiftPackageProductDependency;
package = 43772BE029ED3CF60000A557 /* XCRemoteSwiftPackageReference "AccessibilitySnapshot" */;
productName = AccessibilitySnapshot;
};
4371710D29EFFF88006B6B15 /* SnapshotTesting */ = {
isa = XCSwiftPackageProductDependency;
package = 43EE060B29EFFE8900D2757D /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
productName = SnapshotTesting;
};
43772BE129ED3CF60000A557 /* AccessibilitySnapshot */ = {
isa = XCSwiftPackageProductDependency;
package = 43772BE029ED3CF60000A557 /* XCRemoteSwiftPackageReference "AccessibilitySnapshot" */;
productName = AccessibilitySnapshot;
};
43EE060929EFFDEB00D2757D /* AccessibilitySnapshot */ = {
isa = XCSwiftPackageProductDependency;
package = 43772BE029ED3CF60000A557 /* XCRemoteSwiftPackageReference "AccessibilitySnapshot" */;
productName = AccessibilitySnapshot;
};
43EE060C29EFFE8900D2757D /* SnapshotTesting */ = {
isa = XCSwiftPackageProductDependency;
package = 43EE060B29EFFE8900D2757D /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
productName = SnapshotTesting;
};
43EE060E29EFFE9200D2757D /* SnapshotTesting */ = {
isa = XCSwiftPackageProductDependency;
package = 43EE060B29EFFE8900D2757D /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
productName = SnapshotTesting;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,28 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "NO">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "AccessibilitySnapshotExampleTests.xctest"
BlueprintName = "AccessibilitySnapshotExampleTests"
ReferencedContainer = "container:AccessibilitySnapshotExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "USE_LOCAL_BUNDLE"
value = "$(USE_LOCAL_BUNDLE)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "SNAPSHOT_ARTIFACTS"
value = "/tmp/iOS-Snapshots"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<Testables>
<TestableReference
skipped = "NO">
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading