RecreationBench / web /cresvia.example /tests /static /content.scripted.spec.ts
VoyagerXHF's picture
Upload folder using huggingface_hub (part 29)
dbe005a verified
Raw History Blame Contribute Delete
86.6 kB
import { test, expect } from '@playwright/test';
test.describe('Functional - homepage', () => {
test('homepage: title matches GT', async ({ page }) => {
await page.goto('/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('cresvia');
});
test('homepage: h1 "Grow your money quietly, on au"', async ({ page }) => {
await page.goto('/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Grow your money quietly, on autopilot' || t.startsWith('Grow your money quietly, on autopilot'))).toBeTruthy();
});
test('homepage: h1 "Invest with fewer tax headache"', async ({ page }) => {
await page.goto('/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Invest with fewer tax headaches' || t.startsWith('Invest with fewer tax headaches'))).toBeTruthy();
});
test('homepage: h2 "Hands-off investing"', async ({ page }) => {
await page.goto('/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing' || t.startsWith('Hands-off investing'))).toBeTruthy();
});
test('homepage: nav link "Individuals"', async ({ page }) => {
await page.goto('/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('homepage: nav link "Employers"', async ({ page }) => {
await page.goto('/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('homepage: nav link "Advisors"', async ({ page }) => {
await page.goto('/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('homepage: nav link "Automated investing A globally"', async ({ page }) => {
await page.goto('/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing A globally diversified mix, with all tra' || t.startsWith('Automated investing A globally diversified mix, with all tra')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - a10', () => {
test('a10: title matches GT', async ({ page }) => {
await page.goto('/a10/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('automated investing');
});
test('a10: h1 "Wealth on autopilot"', async ({ page }) => {
await page.goto('/a10/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Wealth on autopilot' || t.startsWith('Wealth on autopilot'))).toBeTruthy();
});
test('a10: h2 "Welcome to a smarter way to in"', async ({ page }) => {
await page.goto('/a10/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Welcome to a smarter way to invest' || t.startsWith('Welcome to a smarter way to invest'))).toBeTruthy();
});
test('a10: h2 "The fundamentals of investing"', async ({ page }) => {
await page.goto('/a10/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'The fundamentals of investing' || t.startsWith('The fundamentals of investing'))).toBeTruthy();
});
test('a10: h2 "Debt feels heavy. Your plan do"', async ({ page }) => {
await page.goto('/a10/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Debt feels heavy. Your plan doesn\'t have to.' || t.startsWith('Debt feels heavy. Your plan doesn\'t have to.'))).toBeTruthy();
});
test('a10: nav link "Households"', async ({ page }) => {
await page.goto('/a10/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Households' || t.startsWith('Households')), 'link text in nav').toBeTruthy();
});
test('a10: nav link "Businesses"', async ({ page }) => {
await page.goto('/a10/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Businesses' || t.startsWith('Businesses')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('a10: nav link "Planners"', async ({ page }) => {
await page.goto('/a10/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Planners' || t.startsWith('Planners')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('a10: nav link "Hands-off investing Broadly di"', async ({ page }) => {
await page.goto('/a10/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing Broadly diversified across markets, with' || t.startsWith('Hands-off investing Broadly diversified across markets, with')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - affiliate_partner_offer', () => {
test('affiliate_partner_offer: title matches GT', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('special offer');
});
test('affiliate_partner_offer: h1 "New member offer Grow faster w"', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'New member offer Grow faster with a boost on your balance' || t.startsWith('New member offer Grow faster with a boost on your balance'))).toBeTruthy();
});
test('affiliate_partner_offer: h2 "See how Cresvia’s Cash Reserve"', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'See how Cresvia’s Cash Reserve stacks up' || t.startsWith('See how Cresvia’s Cash Reserve stacks up'))).toBeTruthy();
});
test('affiliate_partner_offer: h2 "What makes Cresvia’s Cash Rese"', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'What makes Cresvia’s Cash Reserve better?' || t.startsWith('What makes Cresvia’s Cash Reserve better?'))).toBeTruthy();
});
test('affiliate_partner_offer: h2 "Unlock a higher APY."', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Unlock a higher APY.' || t.startsWith('Unlock a higher APY.'))).toBeTruthy();
});
test('affiliate_partner_offer: nav link "For members"', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'For members' || t.startsWith('For members')), 'link text in nav').toBeTruthy();
});
test('affiliate_partner_offer: nav link "Companies"', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Companies' || t.startsWith('Companies')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('affiliate_partner_offer: nav link "Planners"', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Planners' || t.startsWith('Planners')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('affiliate_partner_offer: nav link "Automated portfolios Broadly d"', async ({ page }) => {
await page.goto('/affiliate-partner-offer/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated portfolios Broadly diversified worldwide, with eve' || t.startsWith('Automated portfolios Broadly diversified worldwide, with eve')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - award_disclosures', () => {
test('award_disclosures: title matches GT', async ({ page }) => {
await page.goto('/award-disclosures/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('award disclosures');
});
test('award_disclosures: h1 "Award Disclosures"', async ({ page }) => {
await page.goto('/award-disclosures/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Award Disclosures' || t.startsWith('Award Disclosures'))).toBeTruthy();
});
test('award_disclosures: h3 "Accounts"', async ({ page }) => {
await page.goto('/award-disclosures/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Accounts' || t.startsWith('Accounts'))).toBeTruthy();
});
test('award_disclosures: h3 "Tools"', async ({ page }) => {
await page.goto('/award-disclosures/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Tools' || t.startsWith('Tools'))).toBeTruthy();
});
test('award_disclosures: h3 "Service"', async ({ page }) => {
await page.goto('/award-disclosures/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Service' || t.startsWith('Service'))).toBeTruthy();
});
test('award_disclosures: nav link "Individuals"', async ({ page }) => {
await page.goto('/award-disclosures/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('award_disclosures: nav link "Employers"', async ({ page }) => {
await page.goto('/award-disclosures/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('award_disclosures: nav link "Advisors"', async ({ page }) => {
await page.goto('/award-disclosures/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('award_disclosures: nav link "Automated investing A globally"', async ({ page }) => {
await page.goto('/award-disclosures/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing A globally diversified portfolio with tr' || t.startsWith('Automated investing A globally diversified portfolio with tr')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - b4a_homepage_lets_talk', () => {
test('b4a_homepage_lets_talk: title matches GT', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('cresvia advisor solutions');
});
test('b4a_homepage_lets_talk: h1 "Grow your practice with ease"', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Grow your practice with ease' || t.startsWith('Grow your practice with ease'))).toBeTruthy();
});
test('b4a_homepage_lets_talk: h2 "Technology that keeps pace wit"', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Technology that keeps pace with you.' || t.startsWith('Technology that keeps pace with you.'))).toBeTruthy();
});
test('b4a_homepage_lets_talk: h2 "See Cresvia Advisor Solutions "', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'See Cresvia Advisor Solutions in action.' || t.startsWith('See Cresvia Advisor Solutions in action.'))).toBeTruthy();
});
test('b4a_homepage_lets_talk: h2 "Service and support built to g"', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Service and support built to grow your RIA.' || t.startsWith('Service and support built to grow your RIA.'))).toBeTruthy();
});
test('b4a_homepage_lets_talk: nav link "Individuals"', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('b4a_homepage_lets_talk: nav link "Employers"', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('b4a_homepage_lets_talk: nav link "Advisors"', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('b4a_homepage_lets_talk: header link "Cresvia for Advisor Solutions "', async ({ page }) => {
await page.goto('/b4a-homepage-lets-talk/');
const links = page.locator('header a, [role="banner"] a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Cresvia for Advisor Solutions LogoCresvia' || t.startsWith('Cresvia for Advisor Solutions LogoCresvia')), 'link text in header').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - cresvia_checking_disclosure', () => {
test('cresvia_checking_disclosure: title matches GT', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('everyday checking disclosure');
});
test('cresvia_checking_disclosure: h1 "Cresvia Checking Disclosure"', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Cresvia Checking Disclosure' || t.startsWith('Cresvia Checking Disclosure'))).toBeTruthy();
});
test('cresvia_checking_disclosure: h3 "Accounts"', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Accounts' || t.startsWith('Accounts'))).toBeTruthy();
});
test('cresvia_checking_disclosure: h3 "Tools"', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Tools' || t.startsWith('Tools'))).toBeTruthy();
});
test('cresvia_checking_disclosure: h3 "Service"', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Service' || t.startsWith('Service'))).toBeTruthy();
});
test('cresvia_checking_disclosure: nav link "Individuals"', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('cresvia_checking_disclosure: nav link "Employers"', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('cresvia_checking_disclosure: nav link "Advisors"', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('cresvia_checking_disclosure: nav link "Hands-off investing Broadly di"', async ({ page }) => {
await page.goto('/cresvia-checking-disclosure/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing Broadly diversified holdings, with every' || t.startsWith('Hands-off investing Broadly diversified holdings, with every')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - catalant', () => {
test('catalant: title matches GT', async ({ page }) => {
await page.goto('/catalant/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('automated investing');
});
test('catalant: h1 "Effortless investing"', async ({ page }) => {
await page.goto('/catalant/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Effortless investing' || t.startsWith('Effortless investing'))).toBeTruthy();
});
test('catalant: h1 "\$0 in management fees for six "', async ({ page }) => {
await page.goto('/catalant/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === '\$0 in management fees for six months' || t.startsWith('\$0 in management fees for six months'))).toBeTruthy();
});
test('catalant: h2 "A trusted name in automated mo"', async ({ page }) => {
await page.goto('/catalant/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'A trusted name in automated money management, blending smart technology with real human expertise.' || t.startsWith('A trusted name in automated money management, blending smart technology with real human expertise.'))).toBeTruthy();
});
test('catalant: h2 "Investing built around your go"', async ({ page }) => {
await page.goto('/catalant/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Investing built around your goals.' || t.startsWith('Investing built around your goals.'))).toBeTruthy();
});
test('catalant: nav link "Individuals"', async ({ page }) => {
await page.goto('/catalant/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('catalant: nav link "Employers"', async ({ page }) => {
await page.goto('/catalant/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('catalant: nav link "Advisors"', async ({ page }) => {
await page.goto('/catalant/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('catalant: nav link "Automated investing Broadly di"', async ({ page }) => {
await page.goto('/catalant/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing Broadly diversified, with all trading, r' || t.startsWith('Automated investing Broadly diversified, with all trading, r')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - concierge', () => {
test('concierge: title matches GT', async ({ page }) => {
await page.goto('/concierge/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('personal concierge');
});
test('concierge: h1 "Get going with an advisor at y"', async ({ page }) => {
await page.goto('/concierge/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Get going with an advisor at your side' || t.startsWith('Get going with an advisor at your side'))).toBeTruthy();
});
test('concierge: h2 "Money decisions can feel compl"', async ({ page }) => {
await page.goto('/concierge/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Money decisions can feel complicated. Here\'s how we help:' || t.startsWith('Money decisions can feel complicated. Here\'s how we help:'))).toBeTruthy();
});
test('concierge: h2 "Questions we hear the most:"', async ({ page }) => {
await page.goto('/concierge/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Questions we hear the most:' || t.startsWith('Questions we hear the most:'))).toBeTruthy();
});
test('concierge: h2 "Ready to speak with an expert?"', async ({ page }) => {
await page.goto('/concierge/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Ready to speak with an expert?' || t.startsWith('Ready to speak with an expert?'))).toBeTruthy();
});
test('concierge: nav link "Individuals"', async ({ page }) => {
await page.goto('/concierge/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('concierge: nav link "Employers"', async ({ page }) => {
await page.goto('/concierge/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('concierge: nav link "Advisors"', async ({ page }) => {
await page.goto('/concierge/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('concierge: nav link "Automated investing A globally"', async ({ page }) => {
await page.goto('/concierge/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing A globally diversified portfolio with tr' || t.startsWith('Automated investing A globally diversified portfolio with tr')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - goals_quiz', () => {
test('goals_quiz: page loads without error', async ({ page }) => {
const response = await page.goto('/goals-quiz/');
expect(response?.status()).toBeLessThan(400);
await expect(page.locator('body')).toBeVisible();
});
test('goals_quiz: title matches GT', async ({ page }) => {
await page.goto('/goals-quiz/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('get started with cresvia');
});
test('goals_quiz: h2 "Which starting point feels rig"', async ({ page }) => {
await page.goto('/goals-quiz/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Which starting point feels right?' || t.startsWith('Which starting point feels right?'))).toBeTruthy();
});
test('goals_quiz: h3 "Accounts"', async ({ page }) => {
await page.goto('/goals-quiz/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Accounts' || t.startsWith('Accounts'))).toBeTruthy();
});
test('goals_quiz: h3 "Guidance"', async ({ page }) => {
await page.goto('/goals-quiz/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Guidance' || t.startsWith('Guidance'))).toBeTruthy();
});
test('goals_quiz: h3 "Workplace retirement benefits"', async ({ page }) => {
await page.goto('/goals-quiz/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Workplace retirement benefits' || t.startsWith('Workplace retirement benefits'))).toBeTruthy();
});
test('goals_quiz: header link "Cresvia LogoCresvia"', async ({ page }) => {
await page.goto('/goals-quiz/');
const links = page.locator('header a, [role="banner"] a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Cresvia LogoCresvia' || t.startsWith('Cresvia LogoCresvia')), 'link text in header').toBeTruthy();
});
test('goals_quiz: nav link "Support Hub"', async ({ page }) => {
await page.goto('/goals-quiz/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Support Hub' || t.startsWith('Support Hub')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('help')), 'href fragment present').toBeTruthy();
});
test('goals_quiz: nav link "Reach out"', async ({ page }) => {
await page.goto('/goals-quiz/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Reach out' || t.startsWith('Reach out')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('contact')), 'href fragment present').toBeTruthy();
});
test('goals_quiz: footer link "Partner Banks"', async ({ page }) => {
await page.goto('/goals-quiz/');
const links = page.locator('footer a, [role="contentinfo"] a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Partner Banks' || t.startsWith('Partner Banks')), 'link text in footer').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('cash-portfolio')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - goldman_sachs_tax_smart_bonds', () => {
test('goldman_sachs_tax_smart_bonds: title matches GT', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('tax');
});
test('goldman_sachs_tax_smart_bonds: h1 "Kestrelmark Tax-Smart Bonds Po"', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Kestrelmark Tax-Smart Bonds Portfolio' || t.startsWith('Kestrelmark Tax-Smart Bonds Portfolio'))).toBeTruthy();
});
test('goldman_sachs_tax_smart_bonds: h1 "Kestrelmark Tax-Smart Bonds"', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Kestrelmark Tax-Smart Bonds' || t.startsWith('Kestrelmark Tax-Smart Bonds'))).toBeTruthy();
});
test('goldman_sachs_tax_smart_bonds: h2 "More Helpful Resources"', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'More Helpful Resources' || t.startsWith('More Helpful Resources'))).toBeTruthy();
});
test('goldman_sachs_tax_smart_bonds: h2 "Get invested."', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Get invested.' || t.startsWith('Get invested.'))).toBeTruthy();
});
test('goldman_sachs_tax_smart_bonds: nav link "For Members"', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'For Members' || t.startsWith('For Members')), 'link text in nav').toBeTruthy();
});
test('goldman_sachs_tax_smart_bonds: nav link "Workplace"', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Workplace' || t.startsWith('Workplace')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('goldman_sachs_tax_smart_bonds: nav link "Planners"', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Planners' || t.startsWith('Planners')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('goldman_sachs_tax_smart_bonds: nav link "Hands-off investing A globally"', async ({ page }) => {
await page.goto('/goldman-sachs-tax-smart-bonds/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing A globally diversified account where eve' || t.startsWith('Hands-off investing A globally diversified account where eve')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - how_it_works', () => {
test('how_it_works: title matches GT', async ({ page }) => {
await page.goto('/how-it-works/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('cresvia');
});
test('how_it_works: h1 "How Cresvia works"', async ({ page }) => {
await page.goto('/how-it-works/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'How Cresvia works' || t.startsWith('How Cresvia works'))).toBeTruthy();
});
test('how_it_works: h2 "How our tools support every st"', async ({ page }) => {
await page.goto('/how-it-works/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'How our tools support every stage of your financial life:' || t.startsWith('How our tools support every stage of your financial life:'))).toBeTruthy();
});
test('how_it_works: h2 "Step 1 Share what you’d like t"', async ({ page }) => {
await page.goto('/how-it-works/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Step 1 Share what you’d like to do with your money.' || t.startsWith('Step 1 Share what you’d like to do with your money.'))).toBeTruthy();
});
test('how_it_works: h2 "Step 2 We’ll set up your accou"', async ({ page }) => {
await page.goto('/how-it-works/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Step 2 We’ll set up your account.' || t.startsWith('Step 2 We’ll set up your account.'))).toBeTruthy();
});
test('how_it_works: nav link "Individuals"', async ({ page }) => {
await page.goto('/how-it-works/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('how_it_works: nav link "Employers"', async ({ page }) => {
await page.goto('/how-it-works/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('how_it_works: nav link "Advisors"', async ({ page }) => {
await page.goto('/how-it-works/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('how_it_works: nav link "Automated investing Broadly di"', async ({ page }) => {
await page.goto('/how-it-works/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing Broadly diversified across markets, with' || t.startsWith('Automated investing Broadly diversified across markets, with')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - investments', () => {
test('investments: title matches GT', async ({ page }) => {
await page.goto('/investments/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('portfolio options');
});
test('investments: h1 "Curated portfolios built by pr"', async ({ page }) => {
await page.goto('/investments/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Curated portfolios built by pros' || t.startsWith('Curated portfolios built by pros'))).toBeTruthy();
});
test('investments: h2 "Portfolio picks"', async ({ page }) => {
await page.goto('/investments/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Portfolio picks' || t.startsWith('Portfolio picks'))).toBeTruthy();
});
test('investments: h2 "Make the portfolio yours."', async ({ page }) => {
await page.goto('/investments/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Make the portfolio yours.' || t.startsWith('Make the portfolio yours.'))).toBeTruthy();
});
test('investments: h2 "Get invested."', async ({ page }) => {
await page.goto('/investments/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Get invested.' || t.startsWith('Get invested.'))).toBeTruthy();
});
test('investments: nav link "Individuals"', async ({ page }) => {
await page.goto('/investments/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('investments: nav link "Employers"', async ({ page }) => {
await page.goto('/investments/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('investments: nav link "Advisors"', async ({ page }) => {
await page.goto('/investments/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('investments: nav link "Hands-off investing Broadly di"', async ({ page }) => {
await page.goto('/investments/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing Broadly diversified holdings with every ' || t.startsWith('Hands-off investing Broadly diversified holdings with every ')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - legal', () => {
test('legal: title matches GT', async ({ page }) => {
await page.goto('/legal/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('legal resources');
});
test('legal: h1 "Legal resources"', async ({ page }) => {
await page.goto('/legal/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Legal resources' || t.startsWith('Legal resources'))).toBeTruthy();
});
test('legal: h3 "Terms"', async ({ page }) => {
await page.goto('/legal/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Terms' || t.startsWith('Terms'))).toBeTruthy();
});
test('legal: h3 "Policies"', async ({ page }) => {
await page.goto('/legal/');
const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Policies' || t.startsWith('Policies'))).toBeTruthy();
});
test('legal: nav link "Individuals"', async ({ page }) => {
await page.goto('/legal/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('legal: nav link "Businesses"', async ({ page }) => {
await page.goto('/legal/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Businesses' || t.startsWith('Businesses')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('legal: nav link "Advisors"', async ({ page }) => {
await page.goto('/legal/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('legal: nav link "Hands-off investing Broadly di"', async ({ page }) => {
await page.goto('/legal/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing Broadly diversified worldwide, with ever' || t.startsWith('Hands-off investing Broadly diversified worldwide, with ever')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - mobile_app', () => {
test('mobile_app: title matches GT', async ({ page }) => {
await page.goto('/mobile-app/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('cresvia mobile app');
});
test('mobile_app: h1 "Grow your money anywhere"', async ({ page }) => {
await page.goto('/mobile-app/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Grow your money anywhere' || t.startsWith('Grow your money anywhere'))).toBeTruthy();
});
test('mobile_app: h2 "A money app designed around yo"', async ({ page }) => {
await page.goto('/mobile-app/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'A money app designed around your life.' || t.startsWith('A money app designed around your life.'))).toBeTruthy();
});
test('mobile_app: h2 "View your full story."', async ({ page }) => {
await page.goto('/mobile-app/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'View your full story.' || t.startsWith('View your full story.'))).toBeTruthy();
});
test('mobile_app: h2 "Manage funds anywhere."', async ({ page }) => {
await page.goto('/mobile-app/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Manage funds anywhere.' || t.startsWith('Manage funds anywhere.'))).toBeTruthy();
});
test('mobile_app: nav link "Individuals"', async ({ page }) => {
await page.goto('/mobile-app/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('mobile_app: nav link "Employers"', async ({ page }) => {
await page.goto('/mobile-app/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('mobile_app: nav link "Advisors"', async ({ page }) => {
await page.goto('/mobile-app/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('mobile_app: nav link "Hands-off investing Broadly di"', async ({ page }) => {
await page.goto('/mobile-app/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing Broadly diversified across markets, with' || t.startsWith('Hands-off investing Broadly diversified across markets, with')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - pricing', () => {
test('pricing: title matches GT', async ({ page }) => {
await page.goto('/pricing/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('cresvia\'s pricing');
});
test('pricing: h1 "One fair fee, built around you"', async ({ page }) => {
await page.goto('/pricing/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'One fair fee, built around you' || t.startsWith('One fair fee, built around you'))).toBeTruthy();
});
test('pricing: h1 "0.25%"', async ({ page }) => {
await page.goto('/pricing/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === '0.25%' || t.startsWith('0.25%'))).toBeTruthy();
});
test('pricing: h2 "What does automated investing "', async ({ page }) => {
await page.goto('/pricing/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'What does automated investing cost?' || t.startsWith('What does automated investing cost?'))).toBeTruthy();
});
test('pricing: h2 "Investing in your future shoul"', async ({ page }) => {
await page.goto('/pricing/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Investing in your future should pay you back.' || t.startsWith('Investing in your future should pay you back.'))).toBeTruthy();
});
test('pricing: nav link "Individuals"', async ({ page }) => {
await page.goto('/pricing/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('pricing: nav link "Employers"', async ({ page }) => {
await page.goto('/pricing/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('pricing: nav link "Advisors"', async ({ page }) => {
await page.goto('/pricing/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('pricing: nav link "Automated investing Broadly di"', async ({ page }) => {
await page.goto('/pricing/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing Broadly diversified portfolios with all ' || t.startsWith('Automated investing Broadly diversified portfolios with all ')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - refer_a_friend_offer', () => {
test('refer_a_friend_offer: title matches GT', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('limited offer');
});
test('refer_a_friend_offer: h1 "Existing members: earn extra r"', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Existing members: earn extra rewards for every referral' || t.startsWith('Existing members: earn extra rewards for every referral'))).toBeTruthy();
});
test('refer_a_friend_offer: h2 "See how Cresvia\'s Cash Reserve"', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'See how Cresvia\'s Cash Reserve compares today' || t.startsWith('See how Cresvia\'s Cash Reserve compares today'))).toBeTruthy();
});
test('refer_a_friend_offer: h2 "Why choose Cresvia\'s Cash Rese"', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Why choose Cresvia\'s Cash Reserve account?' || t.startsWith('Why choose Cresvia\'s Cash Reserve account?'))).toBeTruthy();
});
test('refer_a_friend_offer: h2 "Get a stronger APY."', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Get a stronger APY.' || t.startsWith('Get a stronger APY.'))).toBeTruthy();
});
test('refer_a_friend_offer: nav link "Individuals"', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('refer_a_friend_offer: nav link "Employers"', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('refer_a_friend_offer: nav link "Advisors"', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('refer_a_friend_offer: nav link "Automated investing A globally"', async ({ page }) => {
await page.goto('/refer-a-friend-offer/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing A globally diversified portfolio with ev' || t.startsWith('Automated investing A globally diversified portfolio with ev')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - referral', () => {
test('referral: title matches GT', async ({ page }) => {
await page.goto('/referral/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('a friend invited you to join cresvia');
});
test('referral: h1 "Friend reward: Earn up to 4.00"', async ({ page }) => {
await page.goto('/referral/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Friend reward: Earn up to 4.00% APY' || t.startsWith('Friend reward: Earn up to 4.00% APY'))).toBeTruthy();
});
test('referral: h2 "See how Cresvia\'s Cash Reserve"', async ({ page }) => {
await page.goto('/referral/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'See how Cresvia\'s Cash Reserve compares' || t.startsWith('See how Cresvia\'s Cash Reserve compares'))).toBeTruthy();
});
test('referral: h2 "What makes Cresvia\'s Cash Rese"', async ({ page }) => {
await page.goto('/referral/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'What makes Cresvia\'s Cash Reserve stand out?' || t.startsWith('What makes Cresvia\'s Cash Reserve stand out?'))).toBeTruthy();
});
test('referral: h2 "Enjoy a higher APY."', async ({ page }) => {
await page.goto('/referral/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Enjoy a higher APY.' || t.startsWith('Enjoy a higher APY.'))).toBeTruthy();
});
test('referral: nav link "Individuals"', async ({ page }) => {
await page.goto('/referral/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('referral: nav link "Employers"', async ({ page }) => {
await page.goto('/referral/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('referral: nav link "Advisors"', async ({ page }) => {
await page.goto('/referral/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('referral: nav link "Automated investing Broadly di"', async ({ page }) => {
await page.goto('/referral/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing Broadly diversified worldwide, with trad' || t.startsWith('Automated investing Broadly diversified worldwide, with trad')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - retirement', () => {
test('retirement: title matches GT', async ({ page }) => {
await page.goto('/retirement/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('retirement planning');
});
test('retirement: h1 "The confident path to retireme"', async ({ page }) => {
await page.goto('/retirement/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'The confident path to retirement' || t.startsWith('The confident path to retirement'))).toBeTruthy();
});
test('retirement: h2 "Retirement raises a lot of que"', async ({ page }) => {
await page.goto('/retirement/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Retirement raises a lot of questions. We have answers.' || t.startsWith('Retirement raises a lot of questions. We have answers.'))).toBeTruthy();
});
test('retirement: h2 "There\'s more to Cresvia than j"', async ({ page }) => {
await page.goto('/retirement/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'There\'s more to Cresvia than just retirement.' || t.startsWith('There\'s more to Cresvia than just retirement.'))).toBeTruthy();
});
test('retirement: h2 "We\'ll help you retire just the"', async ({ page }) => {
await page.goto('/retirement/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'We\'ll help you retire just the way you want.' || t.startsWith('We\'ll help you retire just the way you want.'))).toBeTruthy();
});
test('retirement: nav link "Individuals"', async ({ page }) => {
await page.goto('/retirement/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('retirement: nav link "Employers"', async ({ page }) => {
await page.goto('/retirement/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('retirement: nav link "Advisors"', async ({ page }) => {
await page.goto('/retirement/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('retirement: nav link "Hands-off investing Broadly di"', async ({ page }) => {
await page.goto('/retirement/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing Broadly diversified worldwide, with ever' || t.startsWith('Hands-off investing Broadly diversified worldwide, with ever')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - retirement_income', () => {
test('retirement_income: title matches GT', async ({ page }) => {
await page.goto('/retirement-income/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('lasting retirement');
});
test('retirement_income: h1 "Turning your savings into stea"', async ({ page }) => {
await page.goto('/retirement-income/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Turning your savings into steady income shouldn\'t feel complicated' || t.startsWith('Turning your savings into steady income shouldn\'t feel complicated'))).toBeTruthy();
});
test('retirement_income: h2 "A dependable way to protect th"', async ({ page }) => {
await page.goto('/retirement-income/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'A dependable way to protect the years ahead.' || t.startsWith('A dependable way to protect the years ahead.'))).toBeTruthy();
});
test('retirement_income: h2 "How does Cresvia support peopl"', async ({ page }) => {
await page.goto('/retirement-income/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'How does Cresvia support people in retirement?' || t.startsWith('How does Cresvia support people in retirement?'))).toBeTruthy();
});
test('retirement_income: h2 "Your money stays protected at "', async ({ page }) => {
await page.goto('/retirement-income/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Your money stays protected at Cresvia.' || t.startsWith('Your money stays protected at Cresvia.'))).toBeTruthy();
});
test('retirement_income: nav link "Households"', async ({ page }) => {
await page.goto('/retirement-income/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Households' || t.startsWith('Households')), 'link text in nav').toBeTruthy();
});
test('retirement_income: nav link "Businesses"', async ({ page }) => {
await page.goto('/retirement-income/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Businesses' || t.startsWith('Businesses')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('retirement_income: nav link "Planners"', async ({ page }) => {
await page.goto('/retirement-income/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Planners' || t.startsWith('Planners')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('retirement_income: nav link "Hands-off investing Broadly di"', async ({ page }) => {
await page.goto('/retirement-income/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Hands-off investing Broadly diversified across markets, with' || t.startsWith('Hands-off investing Broadly diversified across markets, with')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - sitemap', () => {
test('sitemap: title matches GT', async ({ page }) => {
await page.goto('/sitemap/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('cresvia.com sitemap');
});
test('sitemap: h1 "The Cresvia Sitemap"', async ({ page }) => {
await page.goto('/sitemap/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'The Cresvia Sitemap' || t.startsWith('The Cresvia Sitemap'))).toBeTruthy();
});
test('sitemap: h2 "Personal site"', async ({ page }) => {
await page.goto('/sitemap/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Personal site' || t.startsWith('Personal site'))).toBeTruthy();
});
test('sitemap: h2 "Workplace site"', async ({ page }) => {
await page.goto('/sitemap/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Workplace site' || t.startsWith('Workplace site'))).toBeTruthy();
});
test('sitemap: h2 "Advisor site"', async ({ page }) => {
await page.goto('/sitemap/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisor site' || t.startsWith('Advisor site'))).toBeTruthy();
});
test('sitemap: header link "Cresvia LogoCresvia"', async ({ page }) => {
await page.goto('/sitemap/');
const links = page.locator('header a, [role="banner"] a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Cresvia LogoCresvia' || t.startsWith('Cresvia LogoCresvia')), 'link text in header').toBeTruthy();
});
test('sitemap: nav link "Help Center"', async ({ page }) => {
await page.goto('/sitemap/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Help Center' || t.startsWith('Help Center')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('help')), 'href fragment present').toBeTruthy();
});
test('sitemap: nav link "Contact us"', async ({ page }) => {
await page.goto('/sitemap/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Contact us' || t.startsWith('Contact us')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('contact')), 'href fragment present').toBeTruthy();
});
test('sitemap: footer link "Review Cresvia Checking Disclo"', async ({ page }) => {
await page.goto('/sitemap/');
const links = page.locator('footer a, [role="contentinfo"] a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Review Cresvia Checking Disclosures.' || t.startsWith('Review Cresvia Checking Disclosures.')), 'link text in footer').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('cresvia-checking-disclosure')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - socially_responsible_broad_impact_portfolio', () => {
test('socially_responsible_broad_impact_portfolio: title matches GT', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('cresvia broad impact portfolio');
});
test('socially_responsible_broad_impact_portfolio: h1 "Wide Impact Portfolio"', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Wide Impact Portfolio' || t.startsWith('Wide Impact Portfolio'))).toBeTruthy();
});
test('socially_responsible_broad_impact_portfolio: h1 "Wide Impact"', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Wide Impact' || t.startsWith('Wide Impact'))).toBeTruthy();
});
test('socially_responsible_broad_impact_portfolio: h2 "Helpful Resources"', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Helpful Resources' || t.startsWith('Helpful Resources'))).toBeTruthy();
});
test('socially_responsible_broad_impact_portfolio: h2 "Stay invested."', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Stay invested.' || t.startsWith('Stay invested.'))).toBeTruthy();
});
test('socially_responsible_broad_impact_portfolio: nav link "Individuals"', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('socially_responsible_broad_impact_portfolio: nav link "Employers"', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('socially_responsible_broad_impact_portfolio: nav link "Advisors"', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('socially_responsible_broad_impact_portfolio: nav link "Automated investing Broadly di"', async ({ page }) => {
await page.goto('/socially-responsible-broad-impact-portfolio/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing Broadly diversified holdings with every ' || t.startsWith('Automated investing Broadly diversified holdings with every ')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - verify', () => {
test('verify: title matches GT', async ({ page }) => {
await page.goto('/verify/');
const t = (await page.title()).toLowerCase();
expect(t).toContain('cresvia mobile app');
});
test('verify: h1 "Download the Cresvia app"', async ({ page }) => {
await page.goto('/verify/');
const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Download the Cresvia app' || t.startsWith('Download the Cresvia app'))).toBeTruthy();
});
test('verify: h2 "A money app designed around yo"', async ({ page }) => {
await page.goto('/verify/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'A money app designed around your goals.' || t.startsWith('A money app designed around your goals.'))).toBeTruthy();
});
test('verify: h2 "See the whole picture."', async ({ page }) => {
await page.goto('/verify/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'See the whole picture.' || t.startsWith('See the whole picture.'))).toBeTruthy();
});
test('verify: h2 "Manage money from anywhere"', async ({ page }) => {
await page.goto('/verify/');
const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Manage money from anywhere' || t.startsWith('Manage money from anywhere'))).toBeTruthy();
});
test('verify: nav link "Individuals"', async ({ page }) => {
await page.goto('/verify/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Individuals' || t.startsWith('Individuals')), 'link text in nav').toBeTruthy();
});
test('verify: nav link "Employers"', async ({ page }) => {
await page.goto('/verify/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Employers' || t.startsWith('Employers')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('work')), 'href fragment present').toBeTruthy();
});
test('verify: nav link "Advisors"', async ({ page }) => {
await page.goto('/verify/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Advisors' || t.startsWith('Advisors')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('advisors')), 'href fragment present').toBeTruthy();
});
test('verify: nav link "Automated investing A globally"', async ({ page }) => {
await page.goto('/verify/');
const links = page.locator('nav a');
const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim());
expect(texts.some(t => t === 'Automated investing A globally diversified mix with all trad' || t.startsWith('Automated investing A globally diversified mix with all trad')), 'link text in nav').toBeTruthy();
const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase()));
expect(hrefs.some(h => h.includes('investing')), 'href fragment present').toBeTruthy();
});
});
test.describe('Functional - Routing', () => {
test('navigate to investments via "Portfolio optionsDiscover port"', async ({ page }) => {
await page.goto('/');
const link = page.locator('a[href*="investments"]').first();
expect(await link.count(), 'nav link to investments exists').toBeGreaterThan(0);
await link.click();
await page.waitForTimeout(1200);
expect(page.url().toLowerCase(), 'URL changed to destination').toContain('investments');
const bodyText = (await page.evaluate(() => document.body.innerText)).replace(/\s+/g, ' ');
expect(bodyText, 'destination distinctive content shown').toContain('Curated portfolios built by pros');
});
test('navigate to affiliate_partner_offer via "Claim offer"', async ({ page }) => {
await page.goto('/');
const link = page.locator('a[href*="affiliate-partner-offer"]').first();
expect(await link.count(), 'nav link to affiliate_partner_offer exists').toBeGreaterThan(0);
await link.click();
await page.waitForTimeout(1200);
expect(page.url().toLowerCase(), 'URL changed to destination').toContain('affiliate-partner-offer');
const bodyText = (await page.evaluate(() => document.body.innerText)).replace(/\s+/g, ' ');
expect(bodyText, 'destination distinctive content shown').toContain('New member offer Grow faster with a boost on your balance');
});
test('navigate to concierge via "Rollover supportTalk to a spec"', async ({ page }) => {
await page.goto('/');
const link = page.locator('a[href*="concierge"]').first();
expect(await link.count(), 'nav link to concierge exists').toBeGreaterThan(0);
await link.click();
await page.waitForTimeout(1200);
expect(page.url().toLowerCase(), 'URL changed to destination').toContain('concierge');
const bodyText = (await page.evaluate(() => document.body.innerText)).replace(/\s+/g, ' ');
expect(bodyText, 'destination distinctive content shown').toContain('Get going with an advisor at your side');
});
});