From 6d5fb9a3b97ba696cbbbe37ff0b65faab23456b9 Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Mon, 30 Jan 2023 12:49:09 -0500 Subject: [PATCH] report coverage --- cypress/e2e/03-readOnly/reports.cy.d.ts | 1 + cypress/e2e/03-readOnly/reports.cy.js | 28 +++ cypress/e2e/03-readOnly/reports.cy.ts | 36 ++++ views/report-search.ejs | 218 ++++++++++++------------ 4 files changed, 176 insertions(+), 107 deletions(-) create mode 100644 cypress/e2e/03-readOnly/reports.cy.d.ts create mode 100644 cypress/e2e/03-readOnly/reports.cy.js create mode 100644 cypress/e2e/03-readOnly/reports.cy.ts diff --git a/cypress/e2e/03-readOnly/reports.cy.d.ts b/cypress/e2e/03-readOnly/reports.cy.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/cypress/e2e/03-readOnly/reports.cy.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/cypress/e2e/03-readOnly/reports.cy.js b/cypress/e2e/03-readOnly/reports.cy.js new file mode 100644 index 00000000..c29f2941 --- /dev/null +++ b/cypress/e2e/03-readOnly/reports.cy.js @@ -0,0 +1,28 @@ +import { testView } from '../../../test/_globals.js'; +import { logout, login, ajaxDelayMillis } from '../../support/index.js'; +describe('Reports', () => { + beforeEach(() => { + logout(); + login(testView); + cy.visit('/reports'); + }); + afterEach(logout); + it('Has no detectable accessibility issues', () => { + cy.visit('/reports'); + cy.location('pathname').should('equal', '/reports'); + cy.injectAxe(); + cy.checkA11y(); + }); + it('Exports all reports without parameters', () => { + cy.get("a:not(.is-hidden)[download][href*='/reports/']").each(($reportLink) => { + cy.wrap($reportLink).click({ force: true }); + cy.wait(ajaxDelayMillis); + }); + }); + it('Exports all reports with parameters', () => { + cy.get("form[action*='/reports/']").each(($reportLink) => { + cy.wrap($reportLink).invoke('attr', 'target', '_blank').submit(); + cy.wait(ajaxDelayMillis); + }); + }); +}); diff --git a/cypress/e2e/03-readOnly/reports.cy.ts b/cypress/e2e/03-readOnly/reports.cy.ts new file mode 100644 index 00000000..ff43c8a3 --- /dev/null +++ b/cypress/e2e/03-readOnly/reports.cy.ts @@ -0,0 +1,36 @@ +import { testView } from '../../../test/_globals.js' + +import { logout, login, ajaxDelayMillis } from '../../support/index.js' + +describe('Reports', () => { + beforeEach(() => { + logout() + login(testView) + cy.visit('/reports') + }) + + afterEach(logout) + + it('Has no detectable accessibility issues', () => { + cy.visit('/reports') + cy.location('pathname').should('equal', '/reports') + cy.injectAxe() + cy.checkA11y() + }) + + it('Exports all reports without parameters', () => { + cy.get("a:not(.is-hidden)[download][href*='/reports/']").each( + ($reportLink) => { + cy.wrap($reportLink).click({ force: true }) + cy.wait(ajaxDelayMillis) + } + ) + }) + + it('Exports all reports with parameters', () => { + cy.get("form[action*='/reports/']").each(($reportLink) => { + cy.wrap($reportLink).invoke('attr', 'target', '_blank').submit() + cy.wait(ajaxDelayMillis) + }) + }) +}) diff --git a/views/report-search.ejs b/views/report-search.ejs index ada712ab..520981ab 100644 --- a/views/report-search.ejs +++ b/views/report-search.ejs @@ -3,52 +3,52 @@
@@ -78,7 +78,7 @@ CSV
-

Open Work Orders

+

Open Work Orders

All active work orders without completion dates.

@@ -89,19 +89,19 @@ @@ -120,7 +120,9 @@ CSV
-

Current <%= configFunctions.getProperty("aliases.occupancy") %> By <%= configFunctions.getProperty("aliases.map") %>

+

+ Current <%= configFunctions.getProperty("aliases.occupancy") %> By <%= configFunctions.getProperty("aliases.map") %> +

-

Transactions by Date

+

Transactions by Date

-

<%= configFunctions.getProperty("aliases.lots") %> By <%= configFunctions.getProperty("aliases.map") %>

-
-
- -
-
-
- -
-
-
- -
-
+

+ <%= configFunctions.getProperty("aliases.lots") %> By <%= configFunctions.getProperty("aliases.map") %> +

+
+
+ +
+
+
+ +
+
+
+ +
+
@@ -220,7 +224,7 @@ CSV
-

<%= configFunctions.getProperty("aliases.lots") %> By Type

+

<%= configFunctions.getProperty("aliases.lots") %> By Type

-

<%= configFunctions.getProperty("aliases.lots") %> By Status

+

<%= configFunctions.getProperty("aliases.lots") %> By Status

@@ -313,7 +317,7 @@
-

Occupancy (<%= configFunctions.getProperty("aliases.occupancy") %>) Tables

+

Occupancy (<%= configFunctions.getProperty("aliases.occupancy") %>) Tables

@@ -384,7 +388,7 @@
-

Work Order Tables

+

Work Order Tables

-

Lot (<%= configFunctions.getProperty("aliases.lot") %>) Tables

+

Lot (<%= configFunctions.getProperty("aliases.lot") %>) Tables