Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-15699 Adjust homepage Cypress tests #1772

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
277 changes: 0 additions & 277 deletions src/site/includes/tests/homepage.cypress.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 =======================================================
Expand All @@ -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 ===============================================
Expand All @@ -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 ===============================================
Expand All @@ -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 =======================================
Expand All @@ -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 ============================================
Expand All @@ -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',
);
});
});
});
});
});
Loading