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
35 changes: 33 additions & 2 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ jobs:
node-version: 20

- name: Install dependencies
run: cd web/siteplan && npm install
run: npm ci
working-directory: web/siteplan

- name: Eslint
run: cd web/siteplan && npm run lint
run: npm run lint
working-directory: web/siteplan

lint-textviewer:
runs-on: ubuntu-latest
Expand All @@ -71,3 +73,32 @@ jobs:
- name: Eslint
run: cd web/textviewer && npm run lint

test-siteplan:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
with:
node-version: 20

- name: Install dependencies
run: npm ci
working-directory: web/siteplan

- name: Install Playwright Browsers
run: npm exec playwright install --with-deps
working-directory: web/siteplan

- name: Run Playwright tests
run: npm run test:e2e
working-directory: web/siteplan

- uses: actions/upload-artifact@v6
if: ${{ !cancelled() }}
with:
name: playwright-report
path: web/siteplan/playwright-report/
retention-days: 1

10 changes: 9 additions & 1 deletion web/siteplan/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ dist/
public/siteplan.json
public/font
.vscode
.env
.env

# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
85 changes: 85 additions & 0 deletions web/siteplan/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion web/siteplan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"serve": "vite --port 8080",
"build": "vite build --mode development",
"build-prod": "vite build --mode production",
"lint": "eslint src"
"lint": "eslint src",
"test:e2e": "playwright test"
},
"dependencies": {
"@turf/boolean-disjoint": "^7.3.1",
Expand All @@ -26,6 +27,7 @@
"vuex": "^4.1.0"
},
"devDependencies": {
"@playwright/test": "^1.57.0",
"@stylistic/eslint-plugin": "5.7.0",
"@types/geojson": "^7946.0.15",
"@typescript-eslint/eslint-plugin": "^8.53.0",
Expand Down
39 changes: 39 additions & 0 deletions web/siteplan/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { defineConfig, devices } from '@playwright/test'

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',

use: {
/* Base URL to use in actions like `await page.goto('')`. */
baseURL: 'http://localhost:8080',

trace: process.env.CI ? 'retain-on-failure' : 'on',
video: process.env.CI ? 'retain-on-failure' : 'on'
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
}
],

/* Run your local dev server before starting the tests */
webServer: {
command: 'npm run serve',
url: 'http://localhost:8080',
reuseExistingServer: !process.env.CI
}
})
7 changes: 3 additions & 4 deletions web/siteplan/public/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@

.rotate-control-container {
top: 1.25em;
transform: scaleY(2);
}

.rotate-control-button {
font-size: 2.3em;
width: 0.65em;
transform: scaleY(-2);
transform: scaleY(-1);
}

.rotate-control-container.rotate-control-right {
left: 3.9em;
transform: scaleX(-1);
transform: scaleY(2) scaleX(-1);
}

.rotate-control-container.rotate-control-left {
Expand Down
1 change: 1 addition & 0 deletions web/siteplan/src/util/Controls/CenterMainRouteControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default class CenterMainRouteControl extends Control {
this.view = view
button.addEventListener('click', () => {
this.centerView()
button.blur()
}, false)
}

Expand Down
1 change: 1 addition & 0 deletions web/siteplan/src/util/Controls/ExtentControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default class ExtentControl extends Control {
this.view.set(ExtentControl.EXTENT_CONTROL_KEY, this)
button.addEventListener('click', () => {
this.fit()
button.blur()
}, false)
}

Expand Down
1 change: 1 addition & 0 deletions web/siteplan/src/util/Controls/RotateViewControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default class RotateViewControl extends Control {
this.view = view
button.addEventListener('click', () => {
this.onClick()
button.blur()
}, false)
}

Expand Down
Loading
Loading