diff --git a/src/gcintranet/appFooter.ejs b/src/gcintranet/appFooter.ejs index 383af3cb9..d03668ec0 100644 --- a/src/gcintranet/appFooter.ejs +++ b/src/gcintranet/appFooter.ejs @@ -19,9 +19,11 @@ const footerSection=pr.footerSections[sectionIndex];-%> <%_ if (footerSection.customFooterLinks != null) { -%> <%_ if (sectionIndex < 3) { -%> -
<%_ if (footerSection.sectionName != null) { -%> -

<%= footerSection.sectionName %>

+
+

<%= footerSection.sectionName %>

+ <%_ } else { -%> +
<%_ } -%>
    <%_ for (var linkIndex=0; linkIndex <%_ } -%> <%_ } else if (sectionIndex == 0) { /*For backward compatibility */ -%> -
    <%_ if (footerSection.sectionName != null) { -%> -

    <%= footerSection.sectionName %>

    +
    +

    <%= footerSection.sectionName %>

    + <%_ } else { -%> +
    <%_ } -%>
      <%_ for (var linkIndex=0; linkIndex { refFooter: '{"cdnEnv": "localhost"}' }); + generateTestFile('./test/html/gcintranet/template-gcintranetapp-en.html', 'gcintranet', 'gcintranet-appFooter-noFooterSectionName-en', { + refTop: '{"cdnEnv": "localhost", "subTheme": "labour"}', + appTop: '{"cdnEnv": "localhost", "appName": [{"text": "Application name", "href": "#"}]}', + preFooter: '{"cdnEnv": "localhost"}', + appFooter: '{"subTheme":"labour", "footerSections":[{ "customFooterLinks":[{ "href":"#", "text":"link1-1-new Window", "newWindow":true }] }, { "sectionName":"Custom Section 2", "customFooterLinks":[{ "href":"#", "text":"link2-1-new Window", "newWindow":true }] }, { "sectionName":"Custom Section 3", "customFooterLinks":[{ "href":"#", "text":"link3-1-new Window", "newWindow":true }] }], "cdnEnv": "localhost"}', + refFooter: '{"cdnEnv": "localhost"}' + }); + + generateTestFile('./test/html/gcintranet/template-gcintranetapp-fr.html', 'gcintranet', 'gcintranet-appFooter-noFooterSectionName-fr', { + refTop: '{"cdnEnv": "localhost"}', + appTop: '{"cdnEnv": "localhost", "appName": [{"text": "Application name", "href": "#"}]}', + preFooter: '{"cdnEnv": "localhost"}', + appFooter: '{"subTheme":"labour", "footerSections":[{ "customFooterLinks":[{ "href":"#", "text":"link1-1-new Window", "newWindow":true }] }, { "sectionName":"Custom Section 2", "customFooterLinks":[{ "href":"#", "text":"link2-1-new Window", "newWindow":true }] }, { "sectionName":"Custom Section 3", "customFooterLinks":[{ "href":"#", "text":"link3-1-new Window", "newWindow":true }] }], "cdnEnv": "localhost"}', + refFooter: '{"cdnEnv": "localhost"}' + }); + it('Validate the footer links', async () => { await footerLinksIntranet(theme, 'en'); await footerLinksIntranet(theme, 'fr'); @@ -294,6 +310,16 @@ describe('AppFooter section tests for GCIntranet', () => { await cssScriptECCC(theme, 'en'); }); + it('Test if aria-label when no footer section name', async () => { + await customFooterNoSectionName(theme, 'en'); + await customFooterNoSectionName(theme, 'fr'); + }); + + it('Test if aria-labelledby with footer section name', async () => { + await customFooterWithSectionName(theme, 'en'); + await customFooterWithSectionName(theme, 'fr'); + }); + it('Accessibility', async () => { await accessibility(theme, 'en'); await accessibility(theme, 'fr'); @@ -415,6 +441,16 @@ async function footerContactLink(theme, lang){ await expect(appFooterPage.contactLink).toHaveHrefContaining('contactLinksTest'); } +async function customFooterNoSectionName(theme, lang){ + await appFooterPage.open(theme, lang, 'noFooterSectionName'); + await expect(appFooterPage.footerSectionIntranet).toHaveAttribute('aria-label'); +} + +async function customFooterWithSectionName(theme, lang){ + await appFooterPage.open(theme, lang); + await expect(appFooterPage.footerSectionIntranet).toHaveAttribute('aria-labelledby'); +} + async function accessibility(theme, lang) { await appFooterPage.open(theme, lang); await runAccessbilityTest(); diff --git a/wdio.conf.js b/wdio.conf.js index 495679d6e..0156c13bd 100644 --- a/wdio.conf.js +++ b/wdio.conf.js @@ -36,7 +36,8 @@ exports.config = { // directory is where your package.json resides, so `wdio` will be called from there. // specs: [ - './test/specs/**/*.js' + // './test/specs/**/*.js' + './test/specs/**/appFooter.js' ], // Patterns to exclude. exclude: [