All Projects â†’ cashapp â†’ Accessibilitysnapshot

cashapp / Accessibilitysnapshot

Licence: apache-2.0
Easy regression testing for iOS accessibility

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Accessibilitysnapshot

Playbook Ios
📘A library for isolated developing UI components and automatically taking snapshots of them.
Stars: ✭ 830 (+251.69%)
Mutual labels:  snapshot-testing, accessibility, a11y
Parvus
An accessible, open-source image lightbox with no dependencies.
Stars: ✭ 124 (-47.46%)
Mutual labels:  accessibility, a11y
Asqatasun
Mirror of Asqatasun ---> we've moved to GITLAB https://gitlab.com/asqatasun/Asqatasun - Opensource web site analyser, used for web accessibility "a11y"
Stars: ✭ 217 (-8.05%)
Mutual labels:  accessibility, a11y
Wai Tutorials
W3C WAI’s Web Accessibility Tutorials
Stars: ✭ 229 (-2.97%)
Mutual labels:  accessibility, a11y
Eslint Plugin Jsx A11y
Static AST checker for a11y rules on JSX elements.
Stars: ✭ 2,609 (+1005.51%)
Mutual labels:  accessibility, a11y
Svelte Navigator
Simple, accessible routing for Svelte
Stars: ✭ 125 (-47.03%)
Mutual labels:  accessibility, a11y
Houdini
A simple, accessible show-and-hide/accordion script.
Stars: ✭ 148 (-37.29%)
Mutual labels:  accessibility, a11y
Adg
Accessibility Developer Guide
Stars: ✭ 117 (-50.42%)
Mutual labels:  accessibility, a11y
Focusoverlay
Library for creating animated overlays on focused elements
Stars: ✭ 167 (-29.24%)
Mutual labels:  accessibility, a11y
Empathy Prompts
💡 Ideas to help consider Inclusive Design principles when making things for others to use.
Stars: ✭ 173 (-26.69%)
Mutual labels:  accessibility, a11y
Vue Announcer
A simple way with Vue to announce any useful information for screen readers.
Stars: ✭ 185 (-21.61%)
Mutual labels:  accessibility, a11y
Skin
Pure CSS framework designed & developed by eBay for a branded, e-commerce marketplace.
Stars: ✭ 126 (-46.61%)
Mutual labels:  accessibility, a11y
Ember A11y Testing
A suite of accessibility tests that can be run within the Ember testing framework
Stars: ✭ 125 (-47.03%)
Mutual labels:  accessibility, a11y
A11y Dialog
A very lightweight and flexible accessible modal dialog script.
Stars: ✭ 1,768 (+649.15%)
Mutual labels:  accessibility, a11y
Pa11y Webservice
Pa11y Webservice provides scheduled accessibility reports for multiple URLs
Stars: ✭ 122 (-48.31%)
Mutual labels:  accessibility, a11y
Ebayui Core
Collection of Marko widgets; considered to be the core building blocks for all eBay components, pages & apps
Stars: ✭ 134 (-43.22%)
Mutual labels:  accessibility, a11y
Capable
Keep track of accessibility settings, leverage high contrast colors, and use scalable fonts to enable users with disabilities to use your app.
Stars: ✭ 189 (-19.92%)
Mutual labels:  accessibility, a11y
Acot
💎 Accessibility Testing Framework. More accessible web, all over the world.
Stars: ✭ 112 (-52.54%)
Mutual labels:  accessibility, a11y
Top People To Follow In Web Accessibility
A list of the top people to follow in web accessibility and web standards.
Stars: ✭ 117 (-50.42%)
Mutual labels:  accessibility, a11y
Visible
🦉 Accessibility testing framework at the next level
Stars: ✭ 164 (-30.51%)
Mutual labels:  accessibility, a11y

AccessibilitySnapshot

CI Status Version License Platform

AccessibilitySnapshots makes it simple to add regression tests for accessibility in UIKit.

Getting Started

By default, AccessibilitySnapshot uses SnapshotTesting to record snapshots and perform comparisons. The framework also includes support for using iOSSnapshotTestCase as the snapshotting engine instead. Before setting up accessibility snapshot tests, make sure your project is set up for standard snapshot testing. Accessibility snapshot tests require that the test target has a host application. See the Extensions section below for a list of other available snapshotting options.

CocoaPods

Install with CocoaPods by adding the following to your Podfile:

pod 'AccessibilitySnapshot'

To use only the core accessibility parser, add a dependency on the Core subspec alone:

pod 'AccessibilitySnapshot/Core'

Alternatively, if you wish to use iOSSnapshotTestCase to perform image comparisons, you can add a dependency on the iOSSnapshotTestCase subspec instead (or in addition - you can use both in the same project):

pod 'AccessibilitySnapshot/iOSSnapshotTestCase'

Swift Package Manager

Install with Swift Package Manager by adding the following to your Package.swift:

dependencies: [
    .package(name: "AccessibilitySnapshot", url: "https://github.com/cashapp/AccessibilitySnapshot.git", from: "0.4.1"),
]

Next, add AccessibilitySnapshot as a dependency to your test target:

targets: [
    .target(name: "MyApp"),
    .testTarget(name: "MyAppTests", dependencies: ["MyApp", "AccessibilitySnapshot"])
]

To use only the core accessibility parser, add a dependency on the Core library alone:

targets: [
    .target(name: "MyApp"),
    .testTarget(name: "MyAppTests", dependencies: ["MyApp", "AccessibilitySnapshotCore"])
]

We do not currently support AccessibilitySnapshot and iOSSnapshotTestCase through Swift Package Manager.

Usage

AccessibilitySnapshot builds on top of existing snapshot frameworks to add support for snapshotting your app's accessibility. By default it uses the SnapshotTesting framework for snapshotting, but can be switched over to iOSSnapshotTestCase as well.

Getting Started with SnapshotTesting

AccessibilitySnapshot provides an .accessibilityImage snapshotting strategy that can be used with SnapshotTesting's snapshot assertions.

func testAccessibility() {
    let view = MyView()
    // Configure the view...

    assertSnapshot(matching: view, as: .accessibilityImage)
}

Snapshots can also be customized in a few ways, for example controlling when to include indicators for the accessibility activation point of each element. By default, these indicators are shown when the activation point is different than the default activation point for that view. You can override this behavior for each snapshot:

func testAccessibility() {
    let view = MyView()
    // Configure the view...

    // Show indicators for every element.
    assertSnapshot(matching: view, as: .accessibilityImage(showActivationPoints: .always))

    // Don't show any indicators.
    assertSnapshot(matching: view, as: .accessibilityImage(showActivationPoints: .never))
}

Getting Started with iOSSnapshotTestCase

To run a snapshot test, simply call the SnapshotVerifyAccessibility method:

func testAccessibility() {
    let view = MyView()
    // Configure the view...

    SnapshotVerifyAccessibility(view)
}

Since AccessibilitySnapshot is built on top of iOSSnapshotTestCase, it uses the same mechanism to record snapshots (setting the self.recordMode property) and supports many of the same features like device agnostic file names and specifying identifiers for each snapshot:

func testAccessibility() {
    let view = MyView()
    // Configure the view...

    SnapshotVerifyAccessibility(view, identifier: "identifier")
}

Snapshots can also optionally include indicators for the accessibility activation point of each element. By default, these indicators are shown when the activation point is different than the default activation point for that view. You can override this behavior for each snapshot:

func testAccessibility() {
    let view = MyView()
    // Configure the view...

    // Show indicators for every element.
    SnapshotVerifyAccessibility(view, showActivationPoints: .always)

    // Don't show any indicators.
    SnapshotVerifyAccessibility(view, showActivationPoints: .never)
}

You can also run accessibility snapshot tests from Objective-C:

- (void)testAccessibility;
{
    UIView *view = [UIView new];
    // Configure the view...

    SnapshotVerifyAccessibility(view, @"identifier");
}

Contributing

We love our contributors! Please read our contributing guidelines prior to submitting a pull request.

Extensions

Have you written your own extension? Add it here and submit a pull request!

License

Copyright 2020 Square Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].