-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* elemento <a> com ausência de texto descritivo. ajuste dos links vazios acontent, anavigation e afooter para atender os critérios de acessibilidade * descrição das alterações no arquivo CHANGES.rst * Correções apontadas na revisão de código * Code review PR #140. * Code review
- Loading branch information
Showing
14 changed files
with
125 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# -*- coding: utf-8 -*- | ||
from brasil.gov.temas.testing import FUNCTIONAL_TESTING | ||
from plone.app.theming.interfaces import IThemeSettings | ||
from plone.app.theming.utils import applyTheme | ||
from plone.app.theming.utils import getTheme | ||
from plone.registry.interfaces import IRegistry | ||
from plone.testing.z2 import Browser | ||
from zope.component import getUtility | ||
|
||
import Globals | ||
import transaction | ||
import unittest | ||
|
||
|
||
class LinksAcessibilidadeTestCase(unittest.TestCase): | ||
|
||
layer = FUNCTIONAL_TESTING | ||
|
||
def setUp(self): | ||
Globals.DevelopmentMode = True | ||
self.portal = self.layer['portal'] | ||
self.settings = getUtility(IRegistry).forInterface(IThemeSettings) | ||
self.browser = Browser(self.layer['app']) | ||
transaction.commit() | ||
|
||
def base_test(self, cor): | ||
"""Teste base dos temas.""" | ||
theme = getTheme(cor) | ||
applyTheme(theme) | ||
self.settings.enabled = True | ||
transaction.commit() | ||
|
||
self.browser.open(self.portal.absolute_url()) | ||
|
||
# Testa se a âncora para o conteúdo aparece. | ||
self.assertIn( | ||
'<a name="acontent" id="acontent" class="anchor">', | ||
self.browser.contents, | ||
) | ||
|
||
# Testa se a âncora para o menu aparece. | ||
self.assertIn( | ||
'<a name="anavigation" id="anavigation" class="anchor">', | ||
self.browser.contents, | ||
) | ||
|
||
# Testa se o input para a busca aparece. | ||
self.assertIn( | ||
'name="SearchableText"', | ||
self.browser.contents, | ||
) | ||
|
||
# Testa se a âncora para o rodapé aparece. | ||
self.assertIn( | ||
'<a name="afooter" id="afooter" class="anchor">', | ||
self.browser.contents, | ||
) | ||
|
||
def test_link_para_conteudo_tema_amarelo(self): | ||
self.base_test('amarelo') | ||
|
||
def test_link_para_conteudo_tema_azul(self): | ||
self.base_test('azul') | ||
|
||
def test_link_para_conteudo_tema_branco(self): | ||
self.base_test('branco') | ||
|
||
def test_link_para_conteudo_tema_verde(self): | ||
self.base_test('verde') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters