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

Frontend: Demo in madlib #3870

Merged
merged 17 commits into from
Dec 19, 2024
Merged
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"build": "vite build",
"cspell": "cspell '../**/*.{ts,tsx,css,md,py}' --no-progress --no-must-find-files --gitignore",
"dev": "env-cmd -f .env.development npm run start -- --host & npm run tsc:watch",
"e2e": "npx playwright install chromium && npx playwright test --project=E2E_CI --workers 2",
"e2e": "npx playwright install chromium && npx playwright test --project=E2E_NIGHTLY --workers 2",
"e2e-staging": "npx playwright install chromium && cross-env E2E_BASE_URL=https://dev.healthequitytracker.org npx playwright test --project=E2E_NIGHTLY --workers 5",
"e2e-prod": "npx playwright install chromium && cross-env E2E_BASE_URL=https://healthequitytracker.org npx playwright test --project=E2E_NIGHTLY --workers 5",
"e2e-new": "npx playwright codegen http://localhost:3000",
Expand Down
1 change: 0 additions & 1 deletion frontend/playwright-tests/arv_adherence.nightly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ test('ARV Adherence', async ({ page }) => {
.locator('#rate-map')
.getByRole('heading', { name: 'Medicare ARV Beneficiaries, Ages 18+' })
.click()
await page.getByText('Demographic', { exact: true }).nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
await page
Expand Down
1 change: 0 additions & 1 deletion frontend/playwright-tests/asthma.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test('Asthma', async ({ page }) => {
.click()
await page.getByLabel('open the topic info modal').click()
await page.getByLabel('close topic info modal').click()
await page.getByText('Demographic').nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
benhammondmusic marked this conversation as resolved.
Show resolved Hide resolved
await page
Expand Down
6 changes: 2 additions & 4 deletions frontend/playwright-tests/bb_ami.nightly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { test } from '@playwright/test'

test('PHRMA: Beta Blockers after Heart Attack (AMI)', async ({ page }) => {
await page.goto('/exploredata?mls=1.medicare_cardiovascular-3.00&group1=All')
await page
.getByRole('combobox', { name: 'Demographic Race/ethnicity' })
.click()
await page.getByRole('option', { name: 'Eligibility' }).click()
await page.getByRole('button', { name: 'Race and Ethnicity' }).click()
await page.getByRole('menuitem', { name: 'Eligibility' }).click()
await page.getByText('Medicare eligibility:').click()
await page
.getByRole('button', { name: 'Eligible due to disability', exact: true })
Expand Down
3 changes: 0 additions & 3 deletions frontend/playwright-tests/beta_blockers.nightly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ test('Beta Blockers Adherence', async ({ page }) => {
await page.goto(
'/exploredata?mls=1.medicare_cardiovascular-3.00&group1=All&dt1=beta_blockers_adherence',
)
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page
.locator('#rate-map')
.getByRole('heading', {
name: 'Population adherent to beta blockers in the United States',
})
.click()
await page.getByText('Demographic', { exact: true }).nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
benhammondmusic marked this conversation as resolved.
Show resolved Hide resolved
await page
Expand Down
2 changes: 0 additions & 2 deletions frontend/playwright-tests/black_men_gun_homicides.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,4 @@ test('Black Men Homicide Test: Bottom Half of Cards', async ({ page }) => {
await page
.getByRole('columnheader', { name: 'Population share (Black NH,' })
.click()
await page.getByRole('combobox', { name: 'Demographic City Size' }).click()
await page.getByLabel('Race/Ethnicity unavailable').click()
})
12 changes: 0 additions & 12 deletions frontend/playwright-tests/cardiovascular_diseases.nightly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ import { test } from '@playwright/test'

test('Cardiovascular Diseases', async ({ page }) => {
await page.goto('/exploredata?mls=1.cardiovascular_diseases-3.00&group1=All')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page
.locator('#rate-map')
.getByRole('heading', {
name: 'Cardiovascular diseases in the United States',
})
.click()
await page
.getByRole('combobox', { name: 'Demographic Race/ethnicity' })
.click()
await page.locator('#menu- div').first().click()
await page.getByText('Compare mode').nth(2).click()
await page
.locator('#rate-chart')
Expand Down Expand Up @@ -45,10 +39,4 @@ test('Cardiovascular Diseases', async ({ page }) => {
await page
.getByText('Cases of cardiovascular diseases', { exact: true })
.click()
await page.getByRole('heading', { name: 'What data are missing?' }).click()
await page
.getByText(
'Do you have information that belongs on the Health Equity Tracker? We would love',
)
.click()
})
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { test } from '@playwright/test'

test('Care Avoidance Due To Cost', async ({ page }) => {
await page.goto('/exploredata?mls=1.avoided_care-3.00&group1=All')
await page.getByText('Race and Ethnicity:').click()
await page
.getByRole('button', { name: 'Race and Ethnicity', exact: true })
.click()
await page.locator('.MuiBackdrop-root').click()
await page.getByText('Demographic').nth(2).click()

await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
benhammondmusic marked this conversation as resolved.
Show resolved Hide resolved
await page
Expand Down
4 changes: 2 additions & 2 deletions frontend/playwright-tests/cawp.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test('CAWP: Congress', async ({ page }) => {
.click()

await page.getByRole('button', { name: 'US Congress', exact: true }).click()
await page.getByRole('button', { name: 'State legislatures' }).click()
await page.getByRole('menuitem', { name: 'State legislatures' }).click()
await page
.getByRole('button', { name: 'Population vs. distribution' })
.click()
Expand All @@ -76,7 +76,7 @@ test('CAWP: Congress', async ({ page }) => {
test('CAWP: State Legislature', async ({ page }) => {
await page.goto('/exploredata?mls=1.women_in_gov-3.00&group1=All')
await page.getByRole('button', { name: 'US Congress', exact: true }).click()
await page.getByRole('button', { name: 'State legislatures' }).click()
await page.getByRole('menuitem', { name: 'State legislatures' }).click()
await page.getByLabel('Race and Ethnicity:').click()
await page.getByRole('button', { name: 'Black or African American' }).click()

Expand Down
5 changes: 3 additions & 2 deletions frontend/playwright-tests/ccb_adherence.nightly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ test('calcium channel blocker adherence', async ({ page }) => {
await page.goto(
'/exploredata?mls=1.medicare_cardiovascular-3.00&group1=All&dt1=ccb_adherence',
)
await page.getByText('Race and Ethnicity:').click()
await page
.getByRole('button', { name: 'Race and Ethnicity', exact: true })
.click()
await page.locator('.MuiBackdrop-root').click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'Population adherent to' })
.click()
await page.getByLabel('open the topic info modal').click()
await page.getByLabel('close topic info modal').click()
await page.getByText('Demographic', { exact: true }).nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
benhammondmusic marked this conversation as resolved.
Show resolved Hide resolved
await page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ test('Chronic Kidney Disease', async ({ page }) => {
await page.getByRole('dialog').getByText('Measurement Definition:').click()
await page.getByText('For specific calculations and')
await page.getByLabel('close topic info modal').click()
await page.getByText('Demographic').nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
benhammondmusic marked this conversation as resolved.
Show resolved Hide resolved
await page
Expand Down
5 changes: 0 additions & 5 deletions frontend/playwright-tests/copd.nightly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ import { test } from '@playwright/test'

test('COPD Flow', async ({ page }) => {
await page.goto('/exploredata?mls=1.copd-3.00&group1=All')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page.getByLabel('open the topic info modal').click()
await page.getByLabel('close topic info modal').click()
await page.getByText('Demographic').nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'COPD in the United States' })
Expand Down
15 changes: 0 additions & 15 deletions frontend/playwright-tests/covid.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@ import { test } from '@playwright/test'

test('Covid Cases', async ({ page }) => {
await page.goto('/exploredata?mls=1.covid-3.00&group1=All&dt1=covid_cases')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'Rates of COVID-19 cases since' })
.click()
await page.getByLabel('open the topic info modal').click()
await page.getByLabel('close topic info modal').click()
await page.getByText('Demographic').nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
await page
.getByRole('heading', { name: 'Monthly COVID-19 cases per' })
.click()
Expand Down Expand Up @@ -45,10 +38,6 @@ test('Covid Cases', async ({ page }) => {

test('Covid Deaths', async ({ page }) => {
await page.goto('/exploredata?mls=1.covid-3.00&group1=All&dt1=covid_deaths')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page.getByLabel('open the topic info modal').click()
await page.getByLabel('close topic info modal').click()
await page
.locator('#rate-chart')
.getByRole('heading', { name: 'Rates of COVID-19' })
Expand All @@ -71,10 +60,6 @@ test('Covid Deaths', async ({ page }) => {

test('Covid Hospitalizations', async ({ page }) => {
await page.goto('/exploredata?mls=1.covid-3.00&dt1=covid_hospitalizations')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page.getByLabel('open the topic info modal').click()
await page.getByLabel('close topic info modal').click()
await page
.locator('#rate-chart')
.getByRole('heading', { name: 'Rates of COVID-19' })
Expand Down
16 changes: 0 additions & 16 deletions frontend/playwright-tests/diabetes.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@ import { test } from '@playwright/test'

test('Diabetes USA', async ({ page }) => {
await page.goto('/exploredata?mls=1.diabetes-3.00&group1=All')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'Diabetes in the United States' })
.click()
await page.getByLabel('open the topic info modal').click()
await page.getByLabel('close topic info modal').click()
await page.getByText('Demographic').nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
await page
.locator('#rate-chart')
.getByRole('heading', { name: 'Diabetes in the United States' })
Expand Down Expand Up @@ -53,13 +46,4 @@ test('Diabetes County', async ({ page }) => {
.getByRole('heading', { name: 'Ages 18+' })
.click()
await page.locator('#rate-chart').getByText('Sources: County Health').click()
await page
.getByRole('combobox', { name: 'Demographic Race/ethnicity' })
.click()
await page.locator('#menu- div').first().click()
await page
.getByRole('combobox', { name: 'Demographic Race/ethnicity' })
.click()
await page.getByLabel('Age unavailable at the county').click()
await page.getByLabel('Sex unavailable at the county').click()
})
6 changes: 0 additions & 6 deletions frontend/playwright-tests/doac_adherence.nightly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ test('DOAC Adherence', async ({ page }) => {
await page.goto(
'/exploredata?mls=1.medicare_cardiovascular-3.00&group1=All&dt1=doac_adherence',
)

await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page
.locator('#rate-map')
.getByRole('heading', {
name: 'Population adherent to direct oral anticoagulants in the United States',
})
.click()
await page.getByText('Demographic', { exact: true }).nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
await page
.locator('#rate-chart')
.getByRole('heading', {
Expand Down
5 changes: 0 additions & 5 deletions frontend/playwright-tests/frequent_mental_distress.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ import { test } from '@playwright/test'

test('Frequent Mental Distress', async ({ page }) => {
await page.goto('/exploredata?mls=1.frequent_mental_distress-3.00&group1=All')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'Frequent mental distress in' })
.click()
await page.getByText('Demographic').nth(2).click()
await page.getByText('Off').nth(2).click()
await page.locator('#menu- div').first().click()
await page
.getByRole('button', { name: 'Expand state/territory rate' })
.click()
Expand Down
5 changes: 0 additions & 5 deletions frontend/playwright-tests/health_insurance.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import { test } from '@playwright/test'

test('Health Insurance Flow', async ({ page }) => {
await page.goto('/exploredata?mls=1.health_insurance-3.00&group1=All')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page.getByText('Demographic').nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'Uninsured people in the United States' })
Expand Down
13 changes: 2 additions & 11 deletions frontend/playwright-tests/hiv.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@ import { test } from '@playwright/test'

test('HIV: Prevalance', async ({ page }) => {
await page.goto('/exploredata?mls=1.hiv-3.00&group1=All&dt1=hiv_prevalence')
await page.getByText('Race and Ethnicity:').click()
await page.locator('.MuiBackdrop-root').click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'HIV prevalence in the United' })
.click()
await page.getByLabel('open the topic info modal').click()
await page.getByLabel('close topic info modal').click()
await page.getByText('Demographic').nth(2).click()
await page.getByText('Off').nth(1).click()
await page.locator('#menu- div').first().click()
await page
.getByRole('heading', { name: 'HIV prevalence over time in' })
.click()
Expand All @@ -36,9 +29,8 @@ test('HIV: Prevalance', async ({ page }) => {
await page.getByText('Share this report:').click()
await page.getByText('HIV prevalence', { exact: true }).click()
await page.getByRole('heading', { name: 'What data are missing?' }).click()
await page.getByText('Do you have information that').click()
await page.getByRole('button', { name: 'Prevalence', exact: true }).click()
await page.getByRole('button', { name: 'New diagnoses' }).click()
await page.getByRole('menuitem', { name: 'New diagnoses' }).click()
})

test('HIV: Diagnoses', async ({ page }) => {
Expand Down Expand Up @@ -68,7 +60,7 @@ test('HIV: Diagnoses', async ({ page }) => {
await page.getByText('New HIV diagnoses', { exact: true }).click()
await page.getByText('Do you have information that').click()
await page.getByRole('button', { name: 'New diagnoses' }).click()
await page.getByRole('button', { name: 'Deaths' }).click()
await page.getByRole('menuitem', { name: 'Deaths' }).click()
})

test('HIV: Deaths', async ({ page }) => {
Expand All @@ -92,5 +84,4 @@ test('HIV: Deaths', async ({ page }) => {
await page.getByRole('heading', { name: 'Age-adjusted HIV deaths' }).click()
await page.getByText('Share this report:').click()
await page.getByText('HIV deaths', { exact: true }).click()
await page.getByText('Do you have information that').click()
})
17 changes: 2 additions & 15 deletions frontend/playwright-tests/hiv_black_women.ci.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import { test } from '@playwright/test'

test('HIV Black Women: Prevalance Top Cards', async ({ page }) => {
await page.goto('/exploredata?mls=1.hiv_black_women-3.00')
await page.getByRole('combobox', { name: 'Demographic Age' }).click()
await page.getByLabel('Race/Ethnicity unavailable').click()
await page.getByLabel('Sex unavailable for').click()
await page.getByRole('option', { name: 'Age' }).click()
await page.getByLabel('Age:').click()
await page.getByRole('button', { name: '+' }).click()
await page
Expand All @@ -22,7 +18,6 @@ test('HIV Black Women: Prevalance Top Cards', async ({ page }) => {
})
.click()
await page.getByLabel('Include 55+').click()
await page.getByLabel('Include 55+').click()
await page.getByText("Due to COVID-19's effects on").click()
await page
.locator('#rate-chart')
Expand Down Expand Up @@ -73,21 +68,13 @@ test('HIV Black Women: Prevalance Bottom Cards', async ({ page }) => {
.getByRole('button', { name: 'Prevalence for Black Women', exact: true })
.click()
await page
.getByRole('button', { name: 'New Diagnoses for Black Women' })
.getByRole('menuitem', { name: 'New Diagnoses for Black Women' })
.click()
await page
.getByRole('heading', { name: 'Missing data for HIV deaths,' })
.click()
await page.getByText('County-level data is').click()
await page.getByText('To protect personal privacy,').click()
await page
.getByRole('button', { name: 'New Diagnoses for Black Women' })
.click()
await page
.getByRole('button', { name: 'New Diagnoses for Black Women' })
.click()
await page.getByLabel('Age:').click()
await page.getByRole('button', { name: 'All' }).click()
})

test('HIV Black Women: Diagnoses', async ({ page }) => {
Expand All @@ -105,7 +92,7 @@ test('HIV Black Women: Diagnoses', async ({ page }) => {
await page
.getByRole('button', { name: 'New Diagnoses for Black Women' })
.click()
await page.getByRole('button', { name: 'Deaths for Black women' }).click()
await page.getByRole('menuitem', { name: 'Deaths for Black women' }).click()
})

test('HIV Black Women: Deaths', async ({ page }) => {
Expand Down
6 changes: 2 additions & 4 deletions frontend/playwright-tests/hiv_care.nightly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { test } from '@playwright/test'

test('HIV Linkage To Care', async ({ page }) => {
await page.goto('/exploredata?mls=1.hiv_care-3.00&group1=All')
await page
.getByRole('combobox', { name: 'Demographic Race/ethnicity' })
.click()
await page.getByRole('option', { name: 'Age' }).click()
await page.getByRole('button', { name: 'Race and Ethnicity' }).click()
await page.getByRole('menuitem', { name: 'Age' }).click()
await page
.locator('#rate-map')
.getByRole('heading', { name: 'Linkage to HIV care in the' })
Expand Down
Loading
Loading