-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1857 from IBMa/joho-checkerReportsTestCases-1841
chore(extension): Checker XLS Report Test Case
- Loading branch information
Showing
9 changed files
with
263 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 14 additions & 12 deletions
26
accessibility-checker-extension/test/features/TC_HTML_report.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
@e2e | ||
Feature: HTML Report | ||
Scenario: Generate a basic HTML report from side panel | ||
When manual step | ||
""" | ||
Given page "https://altoromutual.12mc9fdq8fib.us-south.codeengine.appdomain.cloud/" | ||
When user opens Devtools | ||
When user opens Devtools panel "Elements" | ||
When user opens Devtools subpanel "Accessibility Checker" | ||
When user activates Button "Scan" | ||
When user activates Button "Export XLS" | ||
When user opens downloaded file "Accessibility_Report-Altoro Accessibility Testing Site.xlsx" | ||
""" | ||
|
||
Background: | ||
# Load the checker panel, scan the page, and then download the reports | ||
Given "desktop" page "altoro" and panel "assessment" | ||
Given browser download folder "TC_HTML_report" | ||
Then Button "Scan" is enabled | ||
When user activates Button "Scan" | ||
Then elem ".reportTreeGrid #tableGridHeader .gridHeaderCell > span" is visible | ||
Then elem "#totalIssuesCount" text ends with "issues found" | ||
When user activates Button "Export XLS" | ||
When wait 2000 | ||
Then downloaded file "Accessibility_Report-Altoro Accessibility Testing Site.html" exists | ||
|
||
Scenario: HTML report exists | ||
Then downloaded file "Accessibility_Report-Altoro Accessibility Testing Site.html" exists |
150 changes: 138 additions & 12 deletions
150
accessibility-checker-extension/test/features/TC_XLS_report.feature
Large diffs are not rendered by default.
Oops, something went wrong.
183 changes: 40 additions & 143 deletions
183
accessibility-checker-extension/test/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
"typescript": "^5.3.3" | ||
}, | ||
"dependencies": { | ||
"exceljs": "^4.4.0", | ||
"ts-node": "^10.9.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
accessibility-checker-extension/test/support/steps/steps_excel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {Given, Then} from '@cucumber/cucumber'; | ||
import { Workbook } from 'exceljs'; | ||
import { join } from 'path'; | ||
import { PupUtil } from '../util/pup'; | ||
import { strict as assert } from "assert"; | ||
|
||
Given("excel file {string}", async function(filename: string) { | ||
const workbook = new Workbook(); | ||
await workbook.xlsx.readFile(join(PupUtil.getTempDownloadFolder(), filename)); | ||
this.excelFile = workbook; | ||
}); | ||
|
||
Then ("Excel Sheet {string} Cell {string} is {string}", async function(sheetStr: string, cellStr: string, txt: string) { | ||
let workbook: Workbook = this.excelFile; | ||
let sheet = workbook.getWorksheet(sheetStr); | ||
if (!sheet) { | ||
assert.fail("Sheet does not exist"); | ||
} else { | ||
let cell = sheet.getCell(cellStr); | ||
assert.strictEqual(cell.text, txt); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters