Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(): add e2e playwright test #3

Merged
merged 11 commits into from
Dec 16, 2024
Merged
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
41 changes: 41 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
timeout-minutes: 5
runs-on: ${{ matrix.os }}
steps:
- name: boost
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -yq libboost-dev
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install dependencies
run: |
npm ci
- name: Fix Ubuntu 24.04 issue https://github.com/electron/electron/issues/17972
run: |
file=node_modules/electron/dist/chrome-sandbox
sudo chown root $file
sudo chmod 4755 $file
- name: Build
run: npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: xvfb-run npm test
env:
DEBUG: pw:browser*
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 7
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
/bin
/minkowski
/deepnest-*win32-x64
package-lock.json
git_token.rtf
.idea
*.zip
.python-version
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["ms-playwright.playwright"]
}
44 changes: 44 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export type DeepNestConfig = {
units: "mm" | "inch";
scale: number;
spacing: number;
curveTolerance: number;
clipperScale: number;
rotations: number;
threads: number;
populationSize: number;
mutationRate: number;
placementType: "gravity" | "box" | "convexhull";
mergeLines: boolean;
/**
* ratio of material reduction to laser time. 0 = optimize material only, 1 = optimize laser time only
*/
timeRatio: number;
simplify: boolean;
dxfImportScale: number;
dxfExportScale: number;
endpointTolerance: number;
conversionServer: string;
};

export type SheetPlacement = {
filename: string;
id: number;
rotation: number;
source: number;
x: number;
y: number;
};

export type NestingResult = {
area: number;
fitness: number;
index: number;
mergedLength: number;
selected: boolean;
placements: {
sheet: number;
sheetid: number;
sheetplacements: SheetPlacement[];
}[];
};
Loading
Loading