Skip to content

Commit

Permalink
feature/CDD-2285: updated the desktop tests to use desktop and tablet…
Browse files Browse the repository at this point in the history
… functionality, new test required for mobile dropdown
  • Loading branch information
luketowell committed Feb 5, 2025
1 parent 987dc7d commit db773d0
Show file tree
Hide file tree
Showing 3 changed files with 249 additions and 114 deletions.
163 changes: 108 additions & 55 deletions e2e/tests/topics/respiratory-viruses/covid-19.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,60 +92,6 @@ test.describe('COVID-19 page', () => {
})
})

test('Downloads a csv version of each chart', async ({ covid19Page, app }) => {
await test.step('loads the page', async () => {
await covid19Page.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'cases-by-specimen-date',
'7-day-case-rates-by-specimen-date',
'case-rates-by-age',
'daily-deaths-with-covid-19-on-the-death-certificate-by-date-of-death',
'bar-chart-with-overlaying-line-comparing-patients-admitted-to-hospital-with-covid-19',
'patients-in-hospital',
'admissions-rate-by-age',
'patients-in-mechanical-ventilation-beds',
'total-daily-number-of-pcr-tests-reported',
'weekly-positivity-of-people-receiving-a-pcr-test',
'people-aged-50-and-over-who-have-received-autumn-booster-vaccinations-by-vaccination-date',
'autumn-booster-vaccination-uptake-50-by-vaccination-date',
'people-aged-75-and-over-who-have-received-spring-booster-vaccinations-by-vaccination-date',
'spring-booster-vaccination-uptake-75-by-vaccination-date',
],
'csv'
)
})
})

test('Downloads a json version of each chart', async ({ covid19Page, app }) => {
await test.step('loads the page', async () => {
await covid19Page.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'cases-by-specimen-date',
'7-day-case-rates-by-specimen-date',
'case-rates-by-age',
'daily-deaths-with-covid-19-on-the-death-certificate-by-date-of-death',
'bar-chart-with-overlaying-line-comparing-patients-admitted-to-hospital-with-covid-19',
'patients-in-hospital',
'admissions-rate-by-age',
'patients-in-mechanical-ventilation-beds',
'total-daily-number-of-pcr-tests-reported',
'weekly-positivity-of-people-receiving-a-pcr-test',
'people-aged-50-and-over-who-have-received-autumn-booster-vaccinations-by-vaccination-date',
'autumn-booster-vaccination-uptake-50-by-vaccination-date',
'people-aged-75-and-over-who-have-received-spring-booster-vaccinations-by-vaccination-date',
'spring-booster-vaccination-uptake-75-by-vaccination-date',
],
'json'
)
})
})

test('Area selection already chosen upon visiting the page', async ({ covid19Page, app }) => {
await test.step('loads the page', async () => {
await app.goto('/topics/covid-19?areaType=Lower+Tier+Local+Authority&areaName=Southampton')
Expand Down Expand Up @@ -281,6 +227,60 @@ test.describe('COVID-19 page - tablet @tabletOnly', () => {
await covid19Page.goto()
await app.hasNav()
})

test('Downloads a csv version of each chart', async ({ covid19Page, app }) => {
await test.step('loads the page', async () => {
await covid19Page.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'cases-by-specimen-date',
'7-day-case-rates-by-specimen-date',
'case-rates-by-age',
'daily-deaths-with-covid-19-on-the-death-certificate-by-date-of-death',
'bar-chart-with-overlaying-line-comparing-patients-admitted-to-hospital-with-covid-19',
'patients-in-hospital',
'admissions-rate-by-age',
'patients-in-mechanical-ventilation-beds',
'total-daily-number-of-pcr-tests-reported',
'weekly-positivity-of-people-receiving-a-pcr-test',
'people-aged-50-and-over-who-have-received-autumn-booster-vaccinations-by-vaccination-date',
'autumn-booster-vaccination-uptake-50-by-vaccination-date',
'people-aged-75-and-over-who-have-received-spring-booster-vaccinations-by-vaccination-date',
'spring-booster-vaccination-uptake-75-by-vaccination-date',
],
'csv'
)
})
})

test('Downloads a json version of each chart', async ({ covid19Page, app }) => {
await test.step('loads the page', async () => {
await covid19Page.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'cases-by-specimen-date',
'7-day-case-rates-by-specimen-date',
'case-rates-by-age',
'daily-deaths-with-covid-19-on-the-death-certificate-by-date-of-death',
'bar-chart-with-overlaying-line-comparing-patients-admitted-to-hospital-with-covid-19',
'patients-in-hospital',
'admissions-rate-by-age',
'patients-in-mechanical-ventilation-beds',
'total-daily-number-of-pcr-tests-reported',
'weekly-positivity-of-people-receiving-a-pcr-test',
'people-aged-50-and-over-who-have-received-autumn-booster-vaccinations-by-vaccination-date',
'autumn-booster-vaccination-uptake-50-by-vaccination-date',
'people-aged-75-and-over-who-have-received-spring-booster-vaccinations-by-vaccination-date',
'spring-booster-vaccination-uptake-75-by-vaccination-date',
],
'json'
)
})
})
})

test.describe('COVID-19 page - desktop @desktopOnly', () => {
Expand All @@ -290,6 +290,60 @@ test.describe('COVID-19 page - desktop @desktopOnly', () => {
await covid19Page.goto()
await app.hasNav()
})

test('Downloads a csv version of each chart', async ({ covid19Page, app }) => {
await test.step('loads the page', async () => {
await covid19Page.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'cases-by-specimen-date',
'7-day-case-rates-by-specimen-date',
'case-rates-by-age',
'daily-deaths-with-covid-19-on-the-death-certificate-by-date-of-death',
'bar-chart-with-overlaying-line-comparing-patients-admitted-to-hospital-with-covid-19',
'patients-in-hospital',
'admissions-rate-by-age',
'patients-in-mechanical-ventilation-beds',
'total-daily-number-of-pcr-tests-reported',
'weekly-positivity-of-people-receiving-a-pcr-test',
'people-aged-50-and-over-who-have-received-autumn-booster-vaccinations-by-vaccination-date',
'autumn-booster-vaccination-uptake-50-by-vaccination-date',
'people-aged-75-and-over-who-have-received-spring-booster-vaccinations-by-vaccination-date',
'spring-booster-vaccination-uptake-75-by-vaccination-date',
],
'csv'
)
})
})

test('Downloads a json version of each chart', async ({ covid19Page, app }) => {
await test.step('loads the page', async () => {
await covid19Page.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'cases-by-specimen-date',
'7-day-case-rates-by-specimen-date',
'case-rates-by-age',
'daily-deaths-with-covid-19-on-the-death-certificate-by-date-of-death',
'bar-chart-with-overlaying-line-comparing-patients-admitted-to-hospital-with-covid-19',
'patients-in-hospital',
'admissions-rate-by-age',
'patients-in-mechanical-ventilation-beds',
'total-daily-number-of-pcr-tests-reported',
'weekly-positivity-of-people-receiving-a-pcr-test',
'people-aged-50-and-over-who-have-received-autumn-booster-vaccinations-by-vaccination-date',
'autumn-booster-vaccination-uptake-50-by-vaccination-date',
'people-aged-75-and-over-who-have-received-spring-booster-vaccinations-by-vaccination-date',
'spring-booster-vaccination-uptake-75-by-vaccination-date',
],
'json'
)
})
})
})

test.describe('COVID-19 page - no JS', () => {
Expand Down Expand Up @@ -323,7 +377,6 @@ test.describe('COVID-19 page - no JS', () => {
})

test('Downloads json charts', async ({ covid19Page, app }) => {
test.use({ viewport: viewports.desktop })
await test.step('loads the page', async () => {
await covid19Page.goto()
})
Expand Down
116 changes: 76 additions & 40 deletions e2e/tests/topics/respiratory-viruses/influenza.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,46 +64,6 @@ test.describe('Influenza page', () => {
})
})

test('downloads a csv version of each chart', async ({ influenzaPage, app }) => {
test.use({ viewport: viewports.desktop })
await test.step('loads the page', async () => {
await influenzaPage.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'line-chart-with-overlaying-line-comparing-hospital-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-hospital-admission-rates-by-age',
'line-chart-with-overlaying-line-comparing-icu-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-icu-admission-rates-by-age',
'bar-chart-with-overlaying-line-comparing-positivity-for-influenza-tests',
'line-chart-comparing-weekly-positivity-for-influenza-tests-by-age',
],
'csv'
)
})
})

test('downloads a json version of each chart', async ({ influenzaPage, app }) => {
test.use({ viewport: viewports.desktop })
await test.step('loads the page', async () => {
await influenzaPage.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'line-chart-with-overlaying-line-comparing-hospital-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-hospital-admission-rates-by-age',
'line-chart-with-overlaying-line-comparing-icu-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-icu-admission-rates-by-age',
'bar-chart-with-overlaying-line-comparing-positivity-for-influenza-tests',
'line-chart-comparing-weekly-positivity-for-influenza-tests-by-age',
],
'json'
)
})
})

test('Area selection already chosen upon visiting the page', async ({ influenzaPage, app }) => {
await test.step('loads the page', async () => {
await app.goto('/topics/influenza?areaType=Lower+Tier+Local+Authority&areaName=Southampton')
Expand Down Expand Up @@ -220,6 +180,44 @@ test.describe('Influenza page - tablet @tabletOnly', () => {
await influenzaPage.goto()
await app.hasNav()
})

test('downloads a json version of each chart', async ({ influenzaPage, app }) => {
await test.step('loads the page', async () => {
await influenzaPage.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'line-chart-with-overlaying-line-comparing-hospital-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-hospital-admission-rates-by-age',
'line-chart-with-overlaying-line-comparing-icu-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-icu-admission-rates-by-age',
'bar-chart-with-overlaying-line-comparing-positivity-for-influenza-tests',
'line-chart-comparing-weekly-positivity-for-influenza-tests-by-age',
],
'json'
)
})
})

test('downloads a csv version of each chart', async ({ influenzaPage, app }) => {
await test.step('loads the page', async () => {
await influenzaPage.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'line-chart-with-overlaying-line-comparing-hospital-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-hospital-admission-rates-by-age',
'line-chart-with-overlaying-line-comparing-icu-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-icu-admission-rates-by-age',
'bar-chart-with-overlaying-line-comparing-positivity-for-influenza-tests',
'line-chart-comparing-weekly-positivity-for-influenza-tests-by-age',
],
'csv'
)
})
})
})

test.describe('Influenza page - desktop @desktopOnly', () => {
Expand All @@ -229,6 +227,44 @@ test.describe('Influenza page - desktop @desktopOnly', () => {
await influenzaPage.goto()
await app.hasNav()
})

test('downloads a json version of each chart', async ({ influenzaPage, app }) => {
await test.step('loads the page', async () => {
await influenzaPage.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'line-chart-with-overlaying-line-comparing-hospital-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-hospital-admission-rates-by-age',
'line-chart-with-overlaying-line-comparing-icu-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-icu-admission-rates-by-age',
'bar-chart-with-overlaying-line-comparing-positivity-for-influenza-tests',
'line-chart-comparing-weekly-positivity-for-influenza-tests-by-age',
],
'json'
)
})
})

test('downloads a csv version of each chart', async ({ influenzaPage, app }) => {
await test.step('loads the page', async () => {
await influenzaPage.goto()
})
await test.step('downloads charts', async () => {
await app.canDownloadChart(
[
'line-chart-with-overlaying-line-comparing-hospital-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-hospital-admission-rates-by-age',
'line-chart-with-overlaying-line-comparing-icu-admission-rates-of-patients-admitted-to-hospital-with-influenza',
'line-chart-comparing-influenza-icu-admission-rates-by-age',
'bar-chart-with-overlaying-line-comparing-positivity-for-influenza-tests',
'line-chart-comparing-weekly-positivity-for-influenza-tests-by-age',
],
'csv'
)
})
})
})

test.describe('Influenza page - no JS', () => {
Expand Down
Loading

0 comments on commit db773d0

Please sign in to comment.