Commit dd33a889aa0ca583f6de9c70b90accf266c91188

Authored by Leonardo Merlin
1 parent a34f3d54

Add tests for a11y

e2e/pages/layout.js
@@ -4,14 +4,28 @@ module.exports = function(){ @@ -4,14 +4,28 @@ module.exports = function(){
4 describe('The common layout', function () { 4 describe('The common layout', function () {
5 5
6 describe('Accessibility (a11y) top bar', function(){ 6 describe('Accessibility (a11y) top bar', function(){
7 - it('should have a "go-to-content" anchor', function() {});  
8 - it('should have a "go-to-menu" anchor', function() {});  
9 - it('should have a "go-to-search" anchor', function() {});  
10 - it('should have a "go-to-footer" anchor', function() {}); 7 + it('should have a "skip-to-content" anchor', function() {
  8 + expect(element(by.id('skip-to-content')).getText()).toEqual('Ir para o conteúdo 1');
  9 + });
  10 + it('should have a "skip-to-navigation" anchor', function() {
  11 + expect(element(by.id('skip-to-navigation')).getText()).toEqual('Ir para o menu 2');
  12 + });
  13 + it('should have a "skip-to-search" anchor', function() {
  14 + expect(element(by.id('skip-to-search')).getText()).toEqual('Ir para a busca 3');
  15 + });
  16 + it('should have a "skip-to-footer" anchor', function() {
  17 + expect(element(by.id('skip-to-footer')).getText()).toEqual('Ir para o rodapé 4');
  18 + });
11 19
12 - it('should have a accessibility anchor', function() {});  
13 - it('should have a adjust contrast anchor', function() {});  
14 - it('should have a sitemap anchor', function() {}); 20 + it('should have a accessibility anchor', function() {
  21 + expect(element(by.id('siteaction-accessibility')).getText()).toEqual('Acessibilidade');
  22 + });
  23 + it('should have a adjust contrast anchor', function() {
  24 + expect(element(by.id('siteaction-contraste')).getText()).toEqual('Alto Contraste');
  25 + });
  26 + it('should have a sitemap anchor', function() {
  27 + expect(element(by.id('siteaction-mapadosite')).getText()).toEqual('Mapa do Site');
  28 + });
15 }); 29 });
16 30
17 describe('Header', function(){ 31 describe('Header', function(){
protractor.conf.js
@@ -19,11 +19,22 @@ @@ -19,11 +19,22 @@
19 19
20 baseUrl: 'http://localhost:3000', 20 baseUrl: 'http://localhost:3000',
21 21
  22 + rootElement: '[ng-app]',
  23 +
  24 + // The timeout in milliseconds for each script run on the browser. This should
  25 + // be longer than the maximum time your application needs to stabilize between
  26 + // tasks.
  27 + allScriptsTimeout: 11000,
  28 +
  29 + // How long to wait for a page to load.
  30 + getPageTimeout: 10000,
  31 +
22 // Spec patterns are relative to the current working directly when 32 // Spec patterns are relative to the current working directly when
23 // protractor is called. 33 // protractor is called.
24 specs: [paths.e2e + '/**/*.js'], 34 specs: [paths.e2e + '/**/*.js'],
25 35
26 // Options to be passed to Jasmine-node. 36 // Options to be passed to Jasmine-node.
  37 + 'framework': 'jasmine2',
27 jasmineNodeOpts: { 38 jasmineNodeOpts: {
28 showColors: true, 39 showColors: true,
29 defaultTimeoutInterval: 30000 40 defaultTimeoutInterval: 30000
src/app/components/a11y-bar/a11y-bar.html
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <span>3</span> 21 <span>3</span>
22 </a> 22 </a>
23 </li> 23 </li>
24 - <li class="last-item"> 24 + <li>
25 <a accesskey="4" href="#footer" id="skip-to-footer" ng-click="skipToFooter($event)"> 25 <a accesskey="4" href="#footer" id="skip-to-footer" ng-click="skipToFooter($event)">
26 Ir para o rodapé 26 Ir para o rodapé
27 <span>4</span> 27 <span>4</span>
@@ -32,14 +32,14 @@ @@ -32,14 +32,14 @@
32 32
33 <div class="col-sm-6"> 33 <div class="col-sm-6">
34 <ul class="action-links list-inline list-unstyled pull-right"> 34 <ul class="action-links list-inline list-unstyled pull-right">
35 - <li id="siteaction-accessibility">  
36 - <a href="#" title="Acessibilidade" accesskey="5" ng-click="actionAccessibility()">Acessibilidade</a> 35 + <li>
  36 + <a id="siteaction-accessibility" href="#" title="Acessibilidade" accesskey="5" ng-click="actionAccessibility()">Acessibilidade</a>
37 </li> 37 </li>
38 - <li id="siteaction-contraste">  
39 - <a href="#" title="Alto Contraste" accesskey="6" ng-click="actionContrast()">Alto Contraste</a> 38 + <li>
  39 + <a id="siteaction-contraste" href="#" title="Alto Contraste" accesskey="6" ng-click="actionContrast()">Alto Contraste</a>
40 </li> 40 </li>
41 - <li id="siteaction-mapadosite" class="last-item">  
42 - <a ui-sref="mapa-do-site" title="Mapa do Site" accesskey="7" ng-click="actionSitemap()">Mapa do Site</a> 41 + <li>
  42 + <a id="siteaction-mapadosite" ui-sref="mapa-do-site" title="Mapa do Site" accesskey="7" ng-click="actionSitemap()">Mapa do Site</a>
43 </li> 43 </li>
44 </ul> 44 </ul>
45 </div> 45 </div>