Compare commits
31 Commits
feature/in
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eac41bad5c | ||
|
|
25a4a2f5cd | ||
|
|
9394dd2990 | ||
|
|
8fa0656366 | ||
|
|
712df1d8a0 | ||
|
|
9b523f0acf | ||
|
|
96ea2af153 | ||
|
|
660c520561 | ||
|
|
5f7fbab021 | ||
|
|
44a69a48a4 | ||
|
|
5e7f97f2fb | ||
|
|
c1eabb9dac | ||
|
|
a1387db6b1 | ||
|
|
a30942daae | ||
|
|
fc360fd2ca | ||
|
|
369a2cc1b7 | ||
|
|
a27ffb3016 | ||
|
|
d79c581ea8 | ||
|
|
355837ffd0 | ||
|
|
7773e85811 | ||
|
|
b194ff6924 | ||
|
|
365c599cd3 | ||
|
|
4ccbef77d2 | ||
|
|
966b3f1c1f | ||
|
|
38da11fd99 | ||
|
|
eece05bced | ||
|
|
79c4ecdc7a | ||
|
|
67b91d9624 | ||
|
|
1f77198683 | ||
|
|
a624b4c8a2 | ||
|
|
6d17cdacc1 |
26
.github/workflows/todos.yml
vendored
Normal file
26
.github/workflows/todos.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Sync TODOs with Issues
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync_todos:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
issues: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Sync TODOs
|
||||||
|
uses: Solo-Web-Works/TODO-Sync@v1
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
summary_file: TODO_SUMMARY.md
|
||||||
|
dry_run: false
|
||||||
|
commit: false
|
||||||
@@ -13,4 +13,4 @@ $env:DEBUG='playwright-a11y-dashboard:*'; npm start
|
|||||||
## Notes, issues, and tasks
|
## Notes, issues, and tasks
|
||||||
|
|
||||||
- [Initial Project Outline](Outline.md)
|
- [Initial Project Outline](Outline.md)
|
||||||
- [Project Task Board](https://git.keithsolomon.net/keith/Playwright-A11y-Dashboard/projects/1)
|
- [Project Task Board](https://git.keithsolomon.net/keith/Playwright-A11y-Dashboard/projects/2)
|
||||||
|
|||||||
11
app.js
11
app.js
@@ -4,8 +4,10 @@ const path = require('path');
|
|||||||
const cookieParser = require('cookie-parser');
|
const cookieParser = require('cookie-parser');
|
||||||
const logger = require('morgan');
|
const logger = require('morgan');
|
||||||
|
|
||||||
const indexRouter = require('./routes/index');
|
var indexRouter = require('./routes/index');
|
||||||
const usersRouter = require('./routes/users');
|
var usersRouter = require('./routes/users');
|
||||||
|
const apiRouter = require('./routes/api');
|
||||||
|
const sitesRouter = require('./routes/sites');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
@@ -20,8 +22,13 @@ app.use(express.urlencoded({ extended: false }));
|
|||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
app.use(express.static(path.join(__dirname, 'public')));
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register routers for different routes
|
||||||
|
*/
|
||||||
app.use('/', indexRouter);
|
app.use('/', indexRouter);
|
||||||
|
app.use('/api', apiRouter);
|
||||||
app.use('/users', usersRouter);
|
app.use('/users', usersRouter);
|
||||||
|
app.use('/sites', sitesRouter);
|
||||||
|
|
||||||
// catch 404 and forward to error handler
|
// catch 404 and forward to error handler
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
|
|||||||
8
auth.js
Normal file
8
auth.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
const { createClient } = require('@supabase/supabase-js');
|
||||||
|
|
||||||
|
const supabase = createClient(
|
||||||
|
'https://rwulmnzzmieuosakijoe.supabase.co',
|
||||||
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InJ3dWxtbnp6bWlldW9zYWtpam9lIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgwNTQ4NDEsImV4cCI6MjA2MzYzMDg0MX0.ZEBJ6v0-u77z1cqRJvA8WOcGRxd8fcN0vqeYJNQgd_U'
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports.supabase = supabase;
|
||||||
17
helpers/axe-test.js
Normal file
17
helpers/axe-test.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
const base = require('@playwright/test');
|
||||||
|
const AxeBuilder = require('@axe-core/playwright').default;
|
||||||
|
|
||||||
|
// Extend base test by providing "makeAxeBuilder"
|
||||||
|
//
|
||||||
|
// This new "test" can be used in multiple test files, and each of them will get
|
||||||
|
// a consistently configured AxeBuilder instance.
|
||||||
|
exports.test = base.test.extend({
|
||||||
|
makeAxeBuilder: async ({ page }, use) => {
|
||||||
|
const makeAxeBuilder = () => new AxeBuilder({ page })
|
||||||
|
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
|
||||||
|
.exclude('#commonly-reused-element-with-known-issue');
|
||||||
|
|
||||||
|
await use(makeAxeBuilder);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
exports.expect = base.expect;
|
||||||
69
models/SiteModel.js
Normal file
69
models/SiteModel.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
* Model for managing sites table in the database.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const { supabase } = require('../auth');
|
||||||
|
|
||||||
|
class SiteModel {
|
||||||
|
|
||||||
|
static tableName = 'sites';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts a new site into the database.
|
||||||
|
*
|
||||||
|
* @param {string} name - The name of the site.
|
||||||
|
* @param {string} domainName - The domain name of the site.
|
||||||
|
*
|
||||||
|
* @returns {Promise<Object>} - The result of the insert operation.
|
||||||
|
*/
|
||||||
|
async insert(name, domainName) {
|
||||||
|
const { error } = await supabase.from(siteModel.tableName).insert({
|
||||||
|
name: name,
|
||||||
|
domain_name: domainName,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
console.error('Error inserting site:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all sites from the database.
|
||||||
|
*
|
||||||
|
* @returns {Promise<Array>} - An array of site objects.
|
||||||
|
*/
|
||||||
|
async getAll() {
|
||||||
|
const { data, error } = await supabase.from(SiteModel.tableName).select('*');
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
console.error('Error fetching sites:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a site by its ID.
|
||||||
|
*
|
||||||
|
* @param {number} id - The ID of the site.
|
||||||
|
*
|
||||||
|
* @returns {Promise<Object>} - The site object.
|
||||||
|
*/
|
||||||
|
async getById(id) {
|
||||||
|
const { data, error } = await supabase.from(SiteModel.tableName).select('*').eq('id', id).single();
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
console.error('Error fetching site by ID:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = SiteModel;
|
||||||
1081
package-lock.json
generated
1081
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,12 +9,17 @@
|
|||||||
"build:css": "tailwindcss -i ./styles/base.css -o ./public/stylesheets/style.css --minify"
|
"build:css": "tailwindcss -i ./styles/base.css -o ./public/stylesheets/style.css --minify"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@axe-core/playwright": "^4.10.1",
|
||||||
|
"@playwright/test": "^1.52.0",
|
||||||
|
"@supabase/supabase-js": "^2.49.8",
|
||||||
|
"axe-playwright": "^2.1.0",
|
||||||
"cookie-parser": "~1.4.4",
|
"cookie-parser": "~1.4.4",
|
||||||
"debug": "~2.6.9",
|
"debug": "~2.6.9",
|
||||||
"ejs": "^3.1.10",
|
"ejs": "^3.1.10",
|
||||||
"express": "~4.16.1",
|
"express": "~4.16.1",
|
||||||
"http-errors": "~1.6.3",
|
"http-errors": "~1.6.3",
|
||||||
"morgan": "~1.9.1"
|
"morgan": "~1.9.1",
|
||||||
|
"jsdom": "^26.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/cli": "^4.1.7",
|
"@tailwindcss/cli": "^4.1.7",
|
||||||
|
|||||||
@@ -181,6 +181,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@layer utilities {
|
@layer utilities {
|
||||||
|
.static {
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
.container {
|
.container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@media (width >= 40rem) {
|
@media (width >= 40rem) {
|
||||||
@@ -211,6 +214,9 @@
|
|||||||
.mb-4 {
|
.mb-4 {
|
||||||
margin-bottom: calc(var(--spacing) * 4);
|
margin-bottom: calc(var(--spacing) * 4);
|
||||||
}
|
}
|
||||||
|
.contents {
|
||||||
|
display: contents;
|
||||||
|
}
|
||||||
.flex {
|
.flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
@@ -226,6 +232,12 @@
|
|||||||
.w-full {
|
.w-full {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.border-collapse {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
.resize {
|
||||||
|
resize: both;
|
||||||
|
}
|
||||||
.items-center {
|
.items-center {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
@@ -245,6 +257,10 @@
|
|||||||
margin-inline-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)));
|
margin-inline-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.border {
|
||||||
|
border-style: var(--tw-border-style);
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
.bg-gray-200 {
|
.bg-gray-200 {
|
||||||
background-color: var(--color-gray-200);
|
background-color: var(--color-gray-200);
|
||||||
}
|
}
|
||||||
@@ -272,6 +288,18 @@
|
|||||||
.text-white {
|
.text-white {
|
||||||
color: var(--color-white);
|
color: var(--color-white);
|
||||||
}
|
}
|
||||||
|
.underline {
|
||||||
|
text-decoration-line: underline;
|
||||||
|
}
|
||||||
|
.outline {
|
||||||
|
outline-style: var(--tw-outline-style);
|
||||||
|
outline-width: 1px;
|
||||||
|
}
|
||||||
|
.transition {
|
||||||
|
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;
|
||||||
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
||||||
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
||||||
|
}
|
||||||
.hover\:text-gray-400 {
|
.hover\:text-gray-400 {
|
||||||
&:hover {
|
&:hover {
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
@@ -393,10 +421,22 @@ hr {
|
|||||||
inherits: false;
|
inherits: false;
|
||||||
initial-value: 0;
|
initial-value: 0;
|
||||||
}
|
}
|
||||||
|
@property --tw-border-style {
|
||||||
|
syntax: "*";
|
||||||
|
inherits: false;
|
||||||
|
initial-value: solid;
|
||||||
|
}
|
||||||
|
@property --tw-outline-style {
|
||||||
|
syntax: "*";
|
||||||
|
inherits: false;
|
||||||
|
initial-value: solid;
|
||||||
|
}
|
||||||
@layer properties {
|
@layer properties {
|
||||||
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
||||||
*, ::before, ::after, ::backdrop {
|
*, ::before, ::after, ::backdrop {
|
||||||
--tw-space-x-reverse: 0;
|
--tw-space-x-reverse: 0;
|
||||||
|
--tw-border-style: solid;
|
||||||
|
--tw-outline-style: solid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
27
routes/api.js
Normal file
27
routes/api.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
// import router from express
|
||||||
|
var express = require('express');
|
||||||
|
const PlaywrightService = require('../services/PlaywrightService');
|
||||||
|
var router = express.Router();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET run accessibility test on domain
|
||||||
|
* Only works for homepage
|
||||||
|
* // TODO: Crawl site map and queue all pages
|
||||||
|
*/
|
||||||
|
router.get('/test/accessibility/:domain', function(req, res) {
|
||||||
|
req.setTimeout(5000000000000);
|
||||||
|
const domain = req.params.domain; // Get the domain from the request parameters
|
||||||
|
|
||||||
|
const playwrightService = new PlaywrightService(domain);
|
||||||
|
|
||||||
|
// Call the runAccessibilityTest method
|
||||||
|
playwrightService.getAccessibilityResults().then(results => {
|
||||||
|
// Send the results as a JSON response
|
||||||
|
res.json(results);
|
||||||
|
}).catch(err => {
|
||||||
|
// Handle any errors that occur during the test
|
||||||
|
res.status(500).json({ error: err.message });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
var express = require('express');
|
var express = require('express');
|
||||||
var router = express.Router();
|
var router = express.Router();
|
||||||
|
const SiteModel = require('../models/SiteModel');
|
||||||
|
const sitesModel = new SiteModel();
|
||||||
|
|
||||||
/* GET home page. */
|
/* GET home page. */
|
||||||
router.get('/', function(req, res, next) {
|
router.get('/', async function(req, res, next) {
|
||||||
res.render('index', { title: 'Express' });
|
const sites = await sitesModel.getAll();
|
||||||
|
console.log('Sites:', sites);
|
||||||
|
res.render('index', { title: 'Express', sites: sites });
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
70
routes/sites.js
Normal file
70
routes/sites.js
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const router = express.Router();
|
||||||
|
const SiteModel = require('../models/SiteModel');
|
||||||
|
const siteModel = new SiteModel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET sites listing.
|
||||||
|
*
|
||||||
|
* Returns a list of all sites in JSON format.
|
||||||
|
*/
|
||||||
|
router.get('/', async function(req, res, next) {
|
||||||
|
const sites = await siteModel.getAll();
|
||||||
|
|
||||||
|
res.json(sites);
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET site by ID.
|
||||||
|
*
|
||||||
|
* Returns a specific site by its ID in JSON format.
|
||||||
|
*/
|
||||||
|
router.get('/:id', async function(req, res, next) {
|
||||||
|
const siteId = req.params.id;
|
||||||
|
|
||||||
|
const site = await siteModel.getById(siteId);
|
||||||
|
|
||||||
|
if (!site) {
|
||||||
|
return res.status(404).send('Site not found');
|
||||||
|
} else {
|
||||||
|
res.json(site);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST create a new site.
|
||||||
|
*
|
||||||
|
* Creates a new site with the provided domain name.
|
||||||
|
*
|
||||||
|
* // TODO: Implement validation for domain name format
|
||||||
|
* // TODO: Implement error handling for duplicate domains
|
||||||
|
* // TODO: Ability to add additional site properties (e.g., name, description)
|
||||||
|
*/
|
||||||
|
router.post('/add/:domain', function(req, res, next) {
|
||||||
|
const domain = req.params.domain;
|
||||||
|
|
||||||
|
const newSite = siteModel.insert(domain);
|
||||||
|
|
||||||
|
if (!newSite) {
|
||||||
|
return res.status(400).send('Error creating site');
|
||||||
|
} else {
|
||||||
|
res.status(201).json(newSite);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PUT update an existing site.
|
||||||
|
*
|
||||||
|
* Updates an existing site with the provided ID and new data.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// TODO: Implement update functionality
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE remove a site by ID.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// TODO: Implement delete functionality
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
110
services/PlaywrightService.js
Normal file
110
services/PlaywrightService.js
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
// import playwright dependencies
|
||||||
|
const { chromium } = require('playwright');
|
||||||
|
const { injectAxe, checkA11y } = require('axe-playwright');
|
||||||
|
const jsdom = require("jsdom");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PlaywrightService class
|
||||||
|
*
|
||||||
|
* This class is used to interact with the Playwright library
|
||||||
|
*/
|
||||||
|
class PlaywrightService {
|
||||||
|
|
||||||
|
#domain; // domain of the site to be tested
|
||||||
|
|
||||||
|
// constructor
|
||||||
|
constructor(domain) {
|
||||||
|
this.#domain = domain;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get sitemap url for the this domain
|
||||||
|
sitemapUrl() {
|
||||||
|
return `${this.rootUrl()}/sitemap.xml`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get the url of the site to be tested
|
||||||
|
rootUrl() {
|
||||||
|
return `https://${this.#domain}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the list of urls to be tested by querying
|
||||||
|
* the sitemap and returning the list of urls
|
||||||
|
*
|
||||||
|
* @param {string} url - The URL of the sitemap
|
||||||
|
*
|
||||||
|
* @returns {Array} - The list of urls to be tested
|
||||||
|
*/
|
||||||
|
async getUrlList() {
|
||||||
|
const browser = await chromium.launch();
|
||||||
|
const page = await browser.newPage();
|
||||||
|
let urls = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
await page.goto(this.sitemapUrl());
|
||||||
|
const content = await page.content();
|
||||||
|
const dom = new jsdom.JSDOM(content);
|
||||||
|
const sitemapUrls = dom.window.document.querySelectorAll('a[href]');
|
||||||
|
urls = Array.from(sitemapUrls).map(link => link.href);
|
||||||
|
|
||||||
|
console.log('Sitemap URLs:', urls);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching sitemap:', error);
|
||||||
|
} finally {
|
||||||
|
await browser.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
return urls;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loops through the list of urls and runs the
|
||||||
|
* accessibility test on each url
|
||||||
|
*
|
||||||
|
* @returns {Array} - The list of results from the accessibility test
|
||||||
|
*/
|
||||||
|
async getAccessibilityResults() {
|
||||||
|
const urls = await this.getUrlList();
|
||||||
|
let results = [];
|
||||||
|
|
||||||
|
while (urls.length > 0) {
|
||||||
|
const url = urls.pop();
|
||||||
|
console.log('Running accessibility test on:', url);
|
||||||
|
const result = await PlaywrightService.#runAccessibilityTest(url);
|
||||||
|
results.push([url, result]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run accessibility test on given url
|
||||||
|
*
|
||||||
|
* @param {string} url - The URL of the page to test
|
||||||
|
*
|
||||||
|
* @returns {Array} - The list of results from the accessibility test
|
||||||
|
*/
|
||||||
|
static async #runAccessibilityTest(url) {
|
||||||
|
const browser = await chromium.launch();
|
||||||
|
const page = await browser.newPage();
|
||||||
|
let results = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
await page.goto(url); // TODO: Retry if this times out
|
||||||
|
await injectAxe(page);
|
||||||
|
results = await page.evaluate(async () => {
|
||||||
|
return await window.axe.run();
|
||||||
|
});
|
||||||
|
} catch(error) {
|
||||||
|
console.error('Error running accessibility test:', error);
|
||||||
|
} finally {
|
||||||
|
await browser.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
return results?.violations || 'No violations found';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = PlaywrightService;
|
||||||
@@ -3,6 +3,12 @@
|
|||||||
<article class="container mx-auto py-4 min-h-[70dvh]">
|
<article class="container mx-auto py-4 min-h-[70dvh]">
|
||||||
<h2>Welcome to the <%= title %> EJS Template</h2>
|
<h2>Welcome to the <%= title %> EJS Template</h2>
|
||||||
<p>This is a simple example of using EJS for templating.</p>
|
<p>This is a simple example of using EJS for templating.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<% for (let i = 0; i < sites.length; i++) { %>
|
||||||
|
<li><%= sites[i].name %></li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<%- include('footer'); -%>
|
<%- include('footer'); -%>
|
||||||
|
|||||||
Reference in New Issue
Block a user