Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .achecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ baselineFolder: .accessibility-checker/test/baselines
# optional - Where the tool can read/write cached files (ace-node.js / archive.json)
# Default: `${os.tmpdir()}/accessibility-checker/`
cacheFolder: .accessibility-checker/tmp

headless: "shell"
perfMetrics: false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ dist-ssr
.vscode/*
!.vscode/extensions.json
.idea
*.iml
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Any kind of Cache
.cache/
3 changes: 3 additions & 0 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require: tsx
# 1 hour for report generation
timeout: 7200000
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# folders
public
node_modules
power-bi-desktop
automation
.vscode

# files
*.html
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions"
]
}
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ You'll need to install [Node.js (>= 18.19.0)](https://nodejs.org/en) and then ru
```
npm install
```
followed by
```
npx playwright install
```
which installs the headless browsers for Playwright, so it can take screenshots.
2. Or simply use the predefined command from the [package.json](package.json) which executes both of the previous commands
```
npm run setup
Expand All @@ -42,6 +37,8 @@ You'll need to install [Node.js (>= 18.19.0)](https://nodejs.org/en) and then ru
```
npm run dev
```
> **Hint:**
> In case the target site blocks scraping requests, set the environment variable `USE_PROXY=true` (prepend to the run command, for instance)

Now you're good to go.

Expand Down
35 changes: 35 additions & 0 deletions automation/azure/dev-ops/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: $(TeamProject)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
resources:
repositories:
- repository: self
- repository: senacor-main
type: github
endpoint: senacor
ref: feature/add-automation
name: senacor/digital-access-reporting-tool
- repository: senacor-screenshots
type: github
endpoint: senacor
ref: feature/screenshots
name: senacor/digital-access-reporting-tool

trigger:
branches:
include:
- main

stages:
- stage: build
displayName: build
jobs:
- template: ./templates/azure-pipelines-build-template.yml
parameters:
name: 'create_WCAG_report'
- stage: deploy
dependsOn: build
jobs:
- template: ./templates/azure-pipelines-deploy-template.yml
parameters:
job_name: kick_off_power_bi
target_environment: 'qa'
variable_group_name: m365
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
parameters:
name: ''
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: 'ubuntu-latest'
demands:
- npm
- node.js
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- checkout: senacor-main
- task: UseNode@1
displayName: 'Use Node 23.x'
inputs:
version: 23.x
checkLatest: true
- task: Cache@2
inputs:
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
cacheHitVar: CACHE_RESTORED
- script: npm ci
displayName: 'Install'
- script: npm run gen
displayName: 'Generate report'
- publish: $(System.DefaultWorkingDirectory)/.accessibility-checker/accessibility-report.json
artifact: reports
displayName: 'Publish Reports to the Pipeline'
- publish: $(System.DefaultWorkingDirectory)/screenshots
artifact: screenshots
displayName: 'Publish Screenshots to the Pipeline'
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
parameters:
# unique name of the job
job_name: deploy_report
# friendly name of the job
display_name: Upload Accessibility Report to SharePoint Site
# name of target environment deploying to
target_environment: ''
variable_group_name: ''
jobs:
- deployment: ${{ parameters.job_name }}
displayName: ${{ parameters.display_name }}
pool:
vmImage: 'ubuntu-latest'
uses:
repositories: [senacor-screenshots]
environment: ${{ parameters.target_environment }}
variables:
- group: ${{ parameters.variable_group_name }} # m365_client_id, m365_user_login, m365_user_password, m365_site_url, m365_reports_folder
- name: screenshots.branch
value: $[ resources.repositories['senacor-screenshots'].ref ]
strategy:
runOnce:
deploy:
steps:
- script: sudo npm install --global @pnp/cli-microsoft365
displayName: 'Install Microsoft Office365 CLI'
- script: m365 login --authType password --userName $(m365_user_login) --password $(m365_user_password) --appId $(m365_client_id)
displayName: 'Login to Microsoft Office365'
- script: m365 spo file add --path $(Pipeline.Workspace)/reports/accessibility-report.json --webUrl $(m365_site_url) --folder '$(m365_reports_folder)'
displayName: 'Upload Accessibility Report to SharePoint'
- script: m365 logout
displayName: 'Logout from Microsoft Office365'
- checkout: senacor-screenshots
clean: true
persistCredentials: true
- script: |
git config user.email "$(m365_user_login)"
git config user.name "$(echo $(m365_user_login) | sed -r 's/(.*)\.(.*)\@.*/\u\1 \u\2/')"
displayName: 'Configure Git'
- script: |
git switch -c feature/screenshots
cp -r ../screenshots .
git add screenshots/*
git commit -m "feat(add-screenshots): added screenshot after scraping '$(URL)' [skip ci]"
git push origin HEAD:$(screenshots.branch)
displayName: 'Checkin Screenshot'
8 changes: 8 additions & 0 deletions automation/azure/pdf/.funcignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git*
.vscode
__azurite_db*__.json
__blobstorage__
__queuestorage__
local.settings.json
test
.venv
135 changes: 135 additions & 0 deletions automation/azure/pdf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don’t work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Azure Functions artifacts
bin
obj
appsettings.json
local.settings.json

# Azurite artifacts
__blobstorage__
__queuestorage__
__azurite_db*__.json
.python_packages
6 changes: 6 additions & 0 deletions automation/azure/pdf/merge/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions",
"ms-python.python"
]
}
15 changes: 15 additions & 0 deletions automation/azure/pdf/merge/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Python Functions",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 9091
},
"preLaunchTask": "func: host start"
}
]
}
9 changes: 9 additions & 0 deletions automation/azure/pdf/merge/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.scmDoBuildDuringDeployment": true,
"azureFunctions.pythonVenv": "../.venv",
"azureFunctions.projectLanguage": "Python",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.projectLanguageModel": 2
}
27 changes: 27 additions & 0 deletions automation/azure/pdf/merge/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"label": "func: host start",
"command": "host start",
"problemMatcher": "$func-python-watch",
"isBackground": true,
"dependsOn": "pip install (functions)"
},
{
"label": "pip install (functions)",
"type": "shell",
"osx": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
},
"windows": {
"command": "${config:azureFunctions.pythonVenv}\\Scripts\\python -m pip install -r requirements.txt"
},
"linux": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
},
"problemMatcher": []
}
]
}
Loading