From c5d7a1a7dcc539b36800ba086d6efacb043de8ab Mon Sep 17 00:00:00 2001 From: Randi Mays Date: Thu, 2 Nov 2023 12:02:14 -0500 Subject: [PATCH] VACMS-15699 Adjust homepage Cypress tests --- .../includes/tests/homepage.cypress.spec.js | 277 ------------------ 1 file changed, 277 deletions(-) diff --git a/src/site/includes/tests/homepage.cypress.spec.js b/src/site/includes/tests/homepage.cypress.spec.js index 00c7257301..3d31c93dab 100644 --- a/src/site/includes/tests/homepage.cypress.spec.js +++ b/src/site/includes/tests/homepage.cypress.spec.js @@ -32,19 +32,6 @@ describe('home page', () => { .should('be.visible') .contains(text); - const verifyLink = (index, linkText, href) => { - const link = () => cy.get('a').eq(index); - - link() - .scrollIntoView() - .should('exist') - .should('be.visible') - // Commenting out the text check until we can discuss with PW - TFC. - // .contains(linkText) - .should('have.attr', 'href') - .and('include', href); - }; - Cypress.config({ includeShadowDom: true, waitForAnimations: true, @@ -79,12 +66,7 @@ describe('home page', () => { verifyElement('.sitewide-search-drop-down-panel-button'); verifyLinkWithoutSelector(1, 'Contact us', '/contact-us'); verifyElement('.sign-in-nav'); - verifyElement('#vetnav'); verifyElement('.va-crisis-line'); - - verifyElement('[data-e2e-id="va-benefits-and-health-care-0"]'); - verifyElement('[data-e2e-id="about-va-1"]'); - verifyElement('[data-e2e-id="find-a-va-location-2"]'); }); // Hero ======================================================= @@ -96,26 +78,6 @@ describe('home page', () => { .scrollIntoView() .within(() => { verifyText('.homepage-hero__welcome-headline', 'Welcome to VA.gov'); - - verifyLinkWithoutSelector( - 0, - 'Learn what the PACT Act means for you', - '/the-pact-act-and-your-va-benefits', - ); - - verifyText( - '#the-pact-act-and-your-va-benef', - 'The PACT Act and your VA benefits', - ); - - verifyLinkWithoutSelector( - 1, - 'Learn how an account helps you', - '/creating-an-account-for-vagov', - ); - - verifyText('#create-an-account-to-manage-yo', 'Create an account'); - verifyButtonText(0, 'Create account'); }); // Common tasks =============================================== @@ -129,54 +91,7 @@ describe('home page', () => { verifyElement('#search-tools-header'); verifyElement('[data-widget-type="homepage-search"]'); - verifyText('#other-search-tools', 'Other search tools'); - verifyLink(0, 'Find a VA location', '/find-locations'); - verifyLink(1, 'Find a VA form', '/find-forms'); - verifyLink(2, 'Find benefit resources and support', '/resources'); - verifyText('#top-pages', 'Top pages'); - verifyLink( - 3, - 'Check your claim or appeal status', - '/claim-or-appeal-status', - ); - verifyLink(4, 'Review your payment history', '/va-payment-history'); - verifyLink( - 5, - 'File for disability compensation', - '/file-disability-claim-form-21-526ez', - ); - verifyLink( - 6, - 'Schedule or manage health appointments', - '/schedule-view-va-appointments', - ); - verifyLink( - 7, - 'Refill or track a prescription', - '/refill-track-prescriptions', - ); - verifyLink(8, 'Compare GI Bill benefits', '/gi-bill-comparison-tool'); - verifyLink( - 9, - 'Get mental health care', - '/health-needs-conditions/mental-health', - ); - verifyLink( - 10, - 'Review or update your dependents', - '/view-change-dependents', - ); - verifyLink( - 11, - 'Get reimbursed for travel pay', - '/get-reimbursed-for-travel-pay', - ); - verifyLink( - 12, - 'Get your VA medical records', - '/health-care/get-medical-records', - ); }); // News section =============================================== @@ -188,16 +103,6 @@ describe('home page', () => { .scrollIntoView() .within(() => { verifyText('#va------------news', 'VA NEWS'); - verifyText( - '#vas-mission-to-better-serve-al a', - 'mission to better serve all', - ); - verifyLinkWithoutSelector( - 1, - 'Read the full article', - '/vas-mission-to-better-serve-all', - ); - verifyLink(2, 'More VA news', 'news.va.gov'); }); // Benefits hub section ======================================= @@ -212,20 +117,6 @@ describe('home page', () => { '#explore-va-benefits-and-health', 'Explore VA benefits and health care', ); - - cy.get('[data-e2e="hub"]').should('have.length', 12); - verifyLink(0, 'Health care', '/health-care'); - verifyLink(1, 'Disability', '/disability'); - verifyLink(2, 'Education and training', '/education'); - verifyLink(3, 'Careers and employment', '/careers-employment'); - verifyLink(4, 'Pension', '/pension'); - verifyLink(5, 'Housing assistance', '/housing-assistance'); - verifyLink(6, 'Life insurance', '/life-insurance'); - verifyLink(7, 'Burials and memorials', '/burials-memorials'); - verifyLink(8, 'Records', '/records'); - verifyLink(9, 'Service member benefits', '/service-member-benefits'); - verifyLink(10, 'Family member benefits', '/family-member-benefits'); - verifyLink(11, 'VA department information', 'department.va.gov'); }); // Feedback button ============================================ @@ -247,179 +138,11 @@ describe('home page', () => { email() .scrollIntoView() .within(() => { - verifyText( - 'h2#sign-up-to-get-the-latest-va-u', - 'Sign up to get the latest VA updates', - ); - verifyElement('[name="email"]'); - verifyButtonText(0, 'Sign up'); }); // Footer ==================================================== verifyElement('.footer'); - - const footer = () => cy.get('.footer'); - - footer() - .scrollIntoView() - .within(() => { - // Column 1 - verifyLink(0, 'Homeless Veterans', '/homeless'); - verifyLink(1, 'Women Veterans', '/womenvet'); - verifyLink(2, 'Minority Veterans', '/centerforminorityveterans'); - verifyLink(3, 'LGBTQ+ Veterans', 'patientcare.va.gov/lgbt'); - verifyLink(4, 'PTSD', 'ptsd.va.gov'); - verifyLink(5, 'Mental health', 'mentalhealth.va.gov'); - verifyLink( - 6, - 'Adaptive sports and special events', - 'department.va.gov/veteran-sports/', - ); - verifyLink(7, 'VA outreach events', '/outreach-and-events/events/'); - verifyLink(8, 'National Resource Directory', 'nrd.gov/'); - - // Column 2 - verifyLink(9, 'VA forms', 'find-forms/'); - verifyLink( - 10, - 'VA health care access and quality', - 'accesstocare.va.gov/', - ); - verifyLink( - 11, - 'Accredited claims representatives', - '/ogc/accreditation.asp', - ); - verifyLink(12, 'VA mobile apps', 'mobile.va.gov/appstore/'); - verifyLink( - 13, - 'State Veterans Affairs offices', - 'department.va.gov/about/state-departments-of-veterans-affairs-office-locations/', - ); - verifyLink(14, 'Doing business with VA', '/opal/fo/dbwva.asp'); - verifyLink(15, 'Careers at VA', '/jobs/'); - verifyLink( - 16, - 'VA outreach materials', - '/outreach-and-events/outreach-materials', - ); - verifyLink(17, 'Your VA welcome kit', '/welcome-kit/'); - - // Column 3 - verifyLink(18, 'VA news', 'news.va.gov/'); - verifyLink(19, 'Press releases', '/opa/pressrel/'); - verifyLink( - 20, - 'Email updates', - 'public.govdelivery.com/accounts/USVA/subscriber/new/', - ); - verifyLink(21, 'Facebook', 'facebook.com/VeteransAffairs'); - verifyLink(22, 'Instagram', 'instagram.com/deptvetaffairs/'); - verifyLink(23, 'Twitter', 'twitter.com/DeptVetAffairs/'); - verifyLink(24, 'Flickr', 'flickr.com/photos/VeteransAffairs/'); - verifyLink(25, 'YouTube', 'youtube.com/user/DeptVetAffairs'); - verifyLink( - 26, - 'All VA social media', - 'digital.va.gov/web-governance/social-media/social-media-sites/', - ); - - // Column 4 - verifyElement('[data-show="#modal-crisisline"]'); - verifyLink(27, 'Resources and support', '/resources'); - verifyLink(28, 'Contact us', '/contact-us'); - verifyLink(29, '800-698-2411', 'tel:18006982411'); - verifyLink(30, 'TTY: 711', 'tel:+1711'); - verifyLink(31, 'Find a VA location', '/find-locations'); - - // Language section - verifyElement('.va-footer-links-bottom').eq(1); - - const languageSection = () => cy.get('.va-footer-links-bottom').eq(1); - - languageSection() - .scrollIntoView() - .within(() => { - verifyText('.va-footer-linkgroup-title', 'Language assistance'); - verifyLinkWithoutSelector( - 0, - 'EspaƱol', - '/asistencia-y-recursos-en-espanol', - ); - verifyLinkWithoutSelector( - 1, - 'Tagalog', - '/tagalog-wika-mapagkukunan-at-tulong', - ); - verifyLinkWithoutSelector( - 2, - 'Other languages', - '/how-to-get-free-language-assistance-from-va', - ); - }); - - // Logo section (footer) - verifyElement('.footer-banner'); - - // Bottom rail (footer) - verifyElement('.va-footer-links-bottom').eq(1); - - const bottomRail = () => cy.get('.va-footer-links-bottom').eq(2); - - bottomRail() - .scrollIntoView() - .within(() => { - verifyLinkWithoutSelector( - 0, - 'Accessibility', - '/accessibility-at-va', - ); - verifyLinkWithoutSelector( - 1, - 'Civil Rights', - '/resources/your-civil-rights-and-how-to-file-a-discrimination-complaint/', - ); - verifyLinkWithoutSelector( - 2, - 'Freedom of Information Act (FOIA)', - 'department.va.gov/foia', - ); - verifyLinkWithoutSelector(3, 'Harassment', '/report-harassment'); - verifyLinkWithoutSelector( - 4, - 'Office of Inspector General', - '/oig', - ); - verifyLinkWithoutSelector( - 5, - 'Plain language', - '/opa/Plain_Language.asp', - ); - verifyLinkWithoutSelector( - 6, - 'Privacy, policies, and legal information', - '/privacy-policy', - ); - verifyLinkWithoutSelector(7, 'VA Privacy Service', 'oprm.va.gov'); - verifyLinkWithoutSelector( - 8, - 'No FEAR Act Data', - '/ormdi/NOFEAR_Select.asp', - ); - verifyLinkWithoutSelector(9, 'USA.gov', 'usa.gov'); - verifyLinkWithoutSelector( - 10, - 'VA performance dashboard', - '/performance-dashboard', - ); - verifyLinkWithoutSelector( - 11, - 'Veterans Portrait Project', - '/veterans-portrait-project', - ); - }); - }); }); }); });