Accessibility testing has come a long way in recent years. We'll dive into how EmberJS prioritized A11y with meaningful RFC's, Addons, tooling and docs. Most importantly, we'll discuss how these successes can be applied to your very own apps be they Vue, React, Angular or anything else!
Achieving A11y Automation Testing
AI Generated Video Summary
This Talk discusses automation testing tools and strategies for accessibility. It highlights EmberJS's approach to accessibility and the efforts of the developer community. The importance of prioritizing accessibility and using tools like Ember A11y testing and Axe-Core is emphasized. Integration with React, Vue, and other frameworks is made easy with NPM packages. The Talk also emphasizes the value of manual testing and user evaluation alongside automation testing.
1. Introduction to Accessibility Automation Testing
Hello, everybody from around the world attending TestJS Summit 2021. I would love to speak to you today about some automation testing tools and strategies that everybody here hopefully can use starting today, if they wish to, around the topic of accessibility, specifically accessibility automation testing, this is a very exciting topic for me.
I want to get one thing out of the way. If you see in my slides, or I say out loud, A11y, which you can see on the screen right now, that simply means accessibility A11y accessibility, they are synonymous. Brief explanation of why that is. There are 11 characters between the A and the Y in accessibility. And if you've been working with internationalization in the past, you might be used to seeing I18N it's the same thing I18N for internationalization and A11Y for accessibility. But I digress.
So, as I just stated, we will in this presentation, talk a little bit about EmberJS and specifically how it tackled accessibility, I believe it did a really good job and I'll get into how and why. And then we will cover some tools and strategies for everyone, regardless of what you're using, you might be on react, maybe you're on Svelte or Vue, for example, doesn't matter. We'll talk about those things. We'll also talk about how to automation test some of that, as well as generally taking ownership and being able to contribute perhaps back to some open source projects or the framework that you were working in.
So last year, 2020 EmberConf, I spoke virtually at that conference about a slightly different success story around accessibility. That one was about how we were able to make a feature that we were shipping in our application even better by making accessibility a priority, we were able to have engineering, QA, design and product all much happier with the thing that we delivered, we were able to deliver some automated tests around something that was clicking draggy. And that's very difficult to write automation tests around. And because we added in accessibility, we were able to test that instead. That's a different topic for an update, but I have had multiple success stories, not just in Ember, but in accessibility as well. And I'll talk to you about some of that today.
Ember has been embracing web standards for some time now. We like to say that we are very HTML first. We focus on W3C recommendations, MDN patterns, and HTML first allows us to inherently be very cognizant of accessibility. So let's get this out of the way. This is an important, I guess, let's talk about why accessibility is important. Not just some stories that I've had. People with disabilities are the world's largest minority.
2. Accessibility Made Easy
Accessibility doesn't need to be hard. Getting started, diving in, making some of it happen doesn't need to be hard. It can be automated and make your work easier.
There are some common things that go along with that. You might be able to argue that if you make apps that target people who have disabilities as well, you get more customers and more innovation in your product. And those kinds of things are very true. Those are legitimate and those are valuable. But what I want to talk about is a little bit different. And I wanted to also say that people with disabilities is a broad term that speaks to many different things. It includes, but it's not limited to visual, auditory and motor disabilities as examples. But what I want to tell you all today is that accessibility doesn't need to be hard. Sure, doing it perfectly, or even doing it extremely well. That's hard. Getting started, diving in, making some of it happen doesn't need to be hard. It can be automated and furthermore, it can make your work that you do on a day to day even easier.
3. EmberJS's Approach to Accessibility
EmberJS embraced accessibility through core support and the efforts of developer Melanie Sumner. An accessibility working group was formed to address existing pitfalls, with discussions and issue logging on GitHub and Discord. The community worked on solving issues, creating guides, and documentation. EmberJS also has an Ember accessibility specific GitHub organization and add-ons to extend accessibility work. Some work made its way into the core Ember framework. Two major tools for accessibility testing are Ember A11y testing for automated tests and accessibility audits.
So how did EmberJS embrace accessibility? I like to introduce two friends of mine. These are the mascots for Ember. On the left we have Tomster and on the right we have Zoe. And they are wearing their accessibility shirts very proudly. We have some core support in EmberJS around accessibility and this makes the biggest difference. I like to call out a wonderful developer by the name of Melanie Sumner. She is a senior engineer at LinkedIn. She has her hands in the pots of a lot of standards that are written for the web, as well as being a core team member, giving us first-class support for things that are important to her, such as accessibility. This means that in EmberJS there is a deep respect for accessibility. One of the things that Melanie Sumner was able to put together was an accessibility working group where we discussed some of the accessibility pitfalls that were currently existing, and we were able to get together in an open source way, where we were logging our notes up on GitHub, and we were able to hop into Discord, schedule meetings, talk about things, go offline, be asynchronous, and all the great things that working open source will give you. It was really great. We were able to address some project issues, whether they were logged by the open source community or by us, as we identified things that were just fundamentally lacking.
Part of the thing was that we acknowledged that at the underlying framework level, every app that is built with Ember, if there are pitfalls, then all these apps could potentially have pitfalls. And so we've worked to address those things. So we worked with issue logging and addressing those issues. We worked with writing up some RFPs, which is a fairly invested way of basically promising and explaining how you're going to solve something that's neither here nor there. Ultimately we got to the point of being able to solve some of these issues, assigning out these tasks to various different people in the community. And we worked very heavily on guides and documentation. Every framework has a section of documents that will explain various different things and each one I've noticed has at least something on accessibility. I'm very proud of what EmberJS has put together around it. There's also an additional site that I helped with writing some articles around and it's about Ember component patterns, which is a way of saying patterns and anti-patterns just like MDN does, the Mozilla developer network. And we're able to focus in on not just teaching how to write components that are HTML first W3C compliant, but are accessible as well. A lot of great things there. Along with having first-class support, there is also an Ember accessibility specific GitHub organization, which was a great place to house a lot of this work that we were doing and a lot of the add-ons, which is what we call plug-ins or tools that can extend an Ember application to make a lot of the work that these different apps probably need to do around accessibility much easier. I also want to point out that a couple of these managed to make its way into the core Ember framework after much discussion within the community. That was great as well.
So getting into the good bit, code. We have two major tools that help specifically with accessibility. The first is in tests. So writing some automated tests, we have an NPM package called em, sorry, it's Ember A11y testing, which will allow you to render out an entire page or a component, and then run an A11y or accessibility audit over that.
4. Accessibility Testing Tools and Strategies
Automation testing tools like Ember template Lint and Axe-Core can help ensure accessibility in your code. Prioritizing accessibility is crucial and can be done by discussing it in your workplace, trying out new things, and contributing to open source projects. Axe-Core, an NPM package, is a powerful tool for detecting accessibility violations. It covers a significant portion of accessibility rules and can be easily integrated into your development process. The browser extension and framework integration make accessibility testing even more convenient.
This is great because you can write some green tests, and then if a update happens in the future, or somebody goes in and touches some code, it can fail your CI builds if those are those pages or those components are no longer accessible like they once were. And they can act as great checklists as well for the developer.
It's also Ember template Lint. This goes alongside things like ESLint, which will let you know when there are some warnings or errors in the code that you are typing. This one focuses on the templates, the HTML, and will let you know in your code editor as you are typing something like, hey, I have an image tag and I forgot to write an alt attribute. When set up correctly, you can also have this fail in CI as well, as it goes through and lints all of your files.
So that's all great. Yay, applause for Ember. What we're here for is how to use these in other frameworks. How to take these tools and strategies and apply them to Vue, apply them to React and Svelte and anything else. So what's the first step? The first step is realizing that we need to prioritize accessibility. That means if you're in a nine to five, maybe you need to talk about it in your workplace with your team, with your product manager. Maybe it just means trying out some things. It also means in your communities, whether they are in person or online, open source projects you're really passionate about, or the frameworks themselves that maybe are lacking in certain areas and you can contribute to. That's why I'm here today is to talk about it, talk about prioritizing accessibility, talking about why it's important and spread the word a little bit and everywhere we can do this is a step in the right direction.
In the code again, there is a wonderful tool. It's an NPM package that was published by Dex systems called Axe-Core. This is made by a group that works on a lot of the standards around the web that are able to declare what are some warnings and violations for accessibility, and then to write some automation testing around it. Some of these tools can cover up to 50% of the accessibility rules that are out there. And that might not sound like a lot, but in some ways it really is, and it's a great start. Getting started with this kind of a tool is as simple as NPM installing it, running Axe, and then seeing what violations it has found. Now this is a core tool that is most often used to power other tools. And it's the foundation of so many other things, such as the browser extension. Browser extension is incredibly easy to get up and running with no matter what browser you're running. This is also maintained by DeX systems themselves. So it's got great support. And it can let you know exactly what it found on your fully rendered page or app and what the priority is in fixing it as well as maybe how to fix it. This is particularly great, not just for engineers, but QA, maybe design or product to log these issues and whatever kind of ticketing system you might have, if that's relevant to you. Now framework integration is where it gets even more exciting. If you're using Svelte, congratulations, you already have accessibility built into that framework.
5. Integration with React and Vue
If you're using React or Vue, it's as simple as installing an NPM package. Vue use, Vue acts and you're done. The framework integrations do the heavy lifting of de-duplicating warnings and intelligently re-checking for new warnings.
It should be already outputting to your browser dev tools, I believe some of these kinds of warnings. But if you're using React or Vue, it's as simple as installing an NPM packets for both of them. Perhaps limiting down to just your development environment or maybe a staging environment, if that is good for you, but it's just these simple lines of code, this is it. Vue use, Vue acts and you're done. Now, suddenly you have something that is using ax core to send to your browser dev tools with. Very clear understanding of whether something is critical, serious, or moderate, a URL of how to figure out what to fix, et cetera. What's great about the framework integrations is that not only are they that not too much work, but they do some of the heavy lifting of de-duplicating some of these warnings and hooking into the underlying systems that say, Hey, I have a component that just re-rendered and update was fired and they are able to intelligently re-check and see, Hey, is there something else to be aware of? A new warning that I haven't already put into the developer tools.
6. Linting, Automation, and Testing Frameworks
ESLint plugins for Vue.js accessibility and JSXA11y provide direct warnings in your code editor, making it easy to make adjustments and improve accessibility. These developer tools are usually free to use and have a significant impact on the accessibility of your application. For true automation, you can use Axe core by plugging in just axe and awaiting the results. This allows you to verify accessibility within your testing environment and end-to-end testing frameworks.
Now, as far as Linting goes, there is ESLint plugins for Vue.js accessibility and JSXA11y. I'm sure there are others as well, and these are able to tell you directly in your code editor of choice, just like anything else in ESLint, Hey, something you just typed or something in this file has a warning and it's right there, you can see it and edit that file in order to make your adjustments and then see those warnings go away. It is so satisfying and to be able to do this for accessibility. It's just an easy win. It's like almost no reason not to do this. These are developer tools, which means that they are. Usually free to put into your application aside from a little bit of NPM install time, because these don't even hit your users, but the effects of the things that you fix will, let's talk about automation. I would argue that a lot of things I just talked about in some ways are kind of automating. It's not manual effort to go through and find some of these things, but you know, if we want to talk about some true automation, maybe you're using just. Axe core can plug in just by using just axe, and then you can await axe, send us some HTML and then expect it to have no violations, it's as easy as that. Once you have that in place, you can verify that within CI within your testing environment, maybe within some component code that that component or whatever it is you're working on is accessible if you are using end to end testing frameworks.
7. Automation Testing and Community Contributions
There are plugins and libraries available for automation testing in different frameworks, such as WebDriver IO and cypress axe. The Vue A11y community is a promising resource for accessibility tools and contributions. While automated testing is valuable, it should be seen as an enhancement, not a replacement for manual testing. Real user testing and manual evaluation are essential for ensuring usability and accessibility. Today, we discussed the importance of accessibility, success stories, making it a priority, and the availability of AXe Tools.
So things that are slightly separated from the framework itself that are rendering full URLs, perhaps on a staging environment or a QA environment, for example, perhaps WebDriver IO. There is a plugin for that axe core WebDriver JS. Or if you are using cypress axe, there is a wonderful library for cypress. And it's as easy as this. I'm not cutting out very much code on these slides. It's this simple.
As far as communities go, as I mentioned earlier, a lot of frameworks have some great communities, some great documentation that are starting to come up. One of the most promising ones that I have seen so far is the Vue A11y community. They have a beautiful, very accessible website. It's great to start there with an accessible website where they have so much potential for posts, recipes, tips and tools. Their tools are the most built out, much like we had Ember addons that I was showing earlier. There are some Vue tools like Vue Skip To or Vue Announcer that can help you handle some of these things that are a little bit more difficult to pull off without these addons kind of lending you a hand. This Vue A11y community is like begging for some more contributions from the open source community. I would say if you're into Vue or curious about Vue and accessibility, it's open source. Hop on there, take some of the pages that are placeholders right now that are just begging for some recipes or best practices around accessibility. Write out some of those open support requests. The community will thank you, I'm sure.
John at Sparkbox said, automated test as an enhancement, not a replacement for manual usability and accessibility testing. It's important to keep in mind after everything I just said and how excited I am about automated testing for accessibility to know that it's impossible to really get all the way there, just as it's not reasonable to expect 100% test coverage on any application you're writing tests for. There's going to be some real user testing that you will have to do. Some manual walking through the app and seeing how usable and accessible it really is using screen readers. Using your keyboard to navigate through your applications. Perhaps the next time that you write a component just see if you can tab through it. It's a good place to start.
So today we talked about accessibility. We talked about why it's important, and some success stories about how Ember was able to do it, how some other frameworks are starting to do it as well. We talked about making accessibility a priority in your workplace or your community. That might mean a framework that you have a lot of passion about, or it might mean the team that you work with at your 9-5. We also talked about some AXe Tools that are available for practically any environment, and if it's not available for yours, there's Axe-Core. You might be the person to make that new NPM package that is powered by Axe-Core to make something wonderful happen.
8. Leaving a Personal Request and Getting Started
Finally, I want to leave you with a personal request to hire someone different than you if you have the means to do so. Your team, company, future employees, users, and I will thank you. Where do I start? Talk with somebody on your team, whether it's a 9 to 5 job or a personal project. Make it important, log issues, and start talking about accessibility. Get started with your main tool or framework, followed by accessibility or Axe. There are alternative tools for different frameworks like Angular.
Finally, I want to leave you with a personal request from me that is indirectly kind of related to this, and that request is to hire someone different than you if you have the means to do so. Your team will thank you, your company will thank you, future employees will thank you, your users will end up thanking you, and I will.
I want to say thank you for watching and joining me today. That is amazing. I do have to say that I was expecting the ones that were in the lead to maybe be in the lead but I did not expect it to be this close across the board. I think my main reaction is that there are some places where it is legally required. People have to adhere by a standard, a particular quality of reaching some like accessibility level, but a lot of the time it is in the back of my mind. I sure wish we could do accessibility. That is part of why I wanted to do this talk.
While you join me on stage, the camp that says it is unsure where to start is pulling ahead. That is going to be my first question to you as we go into our Q&A session. Where do I start? I want to know more. Where do I start? Absolutely. I hope that this talk was able to provide a little bit of that. But where you start is talking with somebody on your team. Again, whether that is 9 to 5 or some personal project that maybe it is just you or it is just you with your friends or open-source thing. It doesn't matter. Just talk with people. Make it important. Log some issues. Just say like, hey, I don't think this was going to work for somebody who is using a screen reader. Just log those issues. Start talking about it. In terms of meaningfully taking some action and doing some code, basically, getting started with whatever your main tool is, your framework, followed by accessibility or Axe, you're going to find these tools that I described and some other tools that I didn't get a chance to mention, like the ones for Angular, for example.
That's good. We actually had someone that said, that wanted to know if the ember tooling was a must, or if there's any alternative to the ember tooling. I can see a little ember behind you, so I know you're an ember fan. Yup. Guilty as charged. I have been doing ember for far too many years now, and just along with that, I've realized that I have some success stories to share, some things I'm really proud of, but what I really want to be able to share is how these things can be applied in other places.
9. Accessibility Tools and Convincing Managers
There are tools available for Svelte, Vue, React, and Angular. A linter can catch some accessibility problems, but not all. It helps with basic issues like missing labels and accessible text. However, it won't cover all scenarios, such as keyboard navigation. Convincing your manager about the importance of accessibility can be done by using similar arguments as for automation testing. It's crucial to emphasize the impact on the bottom line and the relevance across different industries.
So I hope that I was able to show some tools that are used for Svelte, Vue, React, and there are also ones out there for Angular. I just didn't want my slides to get too long, but there are tools out there for anything that you're using. That's good. That's really good, especially since accessibility I think is so important.
That makes a lot of sense. That makes a lot of sense. There's a lot of questions. We won't be getting to all of them. I just want to remind everybody, Ava's going to be in her speaker's room afterwards, so you can ask the questions that I didn't get to in Spatial.chat. In the meantime, I think one of the questions says, how do I convince my manager that accessibility is important? If that argument is, if users work in a restaurant, then accessibility is not an issue. And I think this is one of the most common sheets I've seen. Users work in some sort of whatever environment, be it the restaurant or you name it. It's not an issue. How do I convince my manager? There are several answers to this, but I'll try to get through them very quickly. You can use similar arguments that you have used for doing automation testing to begin with. You could argue very quickly that we don't have time for automation testing. Let's just keep shipping out code, but ultimately it hurts your bottom line. And you can prove that mathematically if you really work at it and try to find those arguments. Also, these kinds of things do apply to every different type of vertical, every different industry. For so long, we heard that mobile app development is not important.
10. Importance of Mobile and Diverse Hiring
We realized the importance of mobile over time. Hiring people different from yourself brings diverse perspectives, influencing culture. Culture is a crucial aspect of this conversation.
We don't have to worry about mobile. And then over time, we realized that was not the case. It's true that we need mobile for almost everything.
Lastly, I want to say that if you can hire people that are different than who you are, that was the last thing I said at the end of that talk, you're going to wind up with even more people with different perspectives, with different needs and desires and influences. And you might suddenly realize that your culture will change before your very eyes. I love that. I love that bit about culture. I think it's a really important piece of where this conversation starts, because it's one of those conversations that you'd hope it never comes up because you're doing the right thing.
Thank you, Eva, for the Q&A session and for your thought. It was really good. I think I got through 20 percent of your questions. So whoever had questions that I didn't get to, please join Ava in the speaker's room on spatial chat.