Skip to content

Commit

Permalink
Fixing uploading accessibility report format (#197)
Browse files Browse the repository at this point in the history
* Fixing uploading accessibility report format

* Replace all illegal chars in filename
  • Loading branch information
dominicwest authored Apr 29, 2024
1 parent e468231 commit 52b0226
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/reusable_e2e_test_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,14 @@ jobs:
if: ${{ !cancelled() && failure() }}

- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
id: now
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
if: ${{ !cancelled() }}

- name: Upload accessibility report
uses: actions/upload-artifact@v4
with:
name: accessibility-report-${{ inputs.environment }}-${{ inputs.browser }}-${{ env.NOW }}
name: accessibility-report-${{ inputs.environment }}-${{ inputs.browser }}-${{ steps.now.outputs.NOW }}
path: /home/runner/work/gap-automated-tests/gap-automated-tests/cypress/accessibility/logs
retention-days: 30
if: ${{ !cancelled() }}
3 changes: 2 additions & 1 deletion cypress/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ function accessibilityLogInfo(violationData) {
const info = formatAccessibilityViolations(violationData, url);

const specName = Cypress.spec.name;
const testName = Cypress.currentTest.title;
// Replaces all illegal chars for a filename
const testName = Cypress.currentTest.title.replace(/[<>"=/\\]/g, '');

cy.writeFile(
`cypress/accessibility/logs/${specName}/${testName}.md`,
Expand Down

0 comments on commit 52b0226

Please sign in to comment.