From 1885d50ffd6e0f2564d03cfef65f2e55926f0eb9 Mon Sep 17 00:00:00 2001 From: eugene-dynamsoft Date: Wed, 9 Oct 2024 14:21:55 -0700 Subject: [PATCH] Moved playwirght config and package.json files to root directory. --- VINScanner/tests/pages/MinElementPage.ts | 2 +- VINScanner/tests/pages/VinScannerPage.ts | 2 +- VINScanner/tests/unittest/index.test.ts | 2 +- .../tests/unittest/minimum-elements.test.ts | 2 +- .../package-lock.json => package-lock.json | 0 package.json | 21 +++++++++++++++++++ ...aywright.config.ts => playwright.config.ts | 4 ++-- 7 files changed, 27 insertions(+), 6 deletions(-) rename VINScanner/package-lock.json => package-lock.json (100%) create mode 100644 package.json rename VINScanner/playwright.config.ts => playwright.config.ts (97%) diff --git a/VINScanner/tests/pages/MinElementPage.ts b/VINScanner/tests/pages/MinElementPage.ts index eb87237..13ea6d6 100644 --- a/VINScanner/tests/pages/MinElementPage.ts +++ b/VINScanner/tests/pages/MinElementPage.ts @@ -1,6 +1,6 @@ import { Page, Locator } from '@playwright/test'; -const URL = '/minimum-elements.html'; +const URL = '/VINScanner/minimum-elements.html'; export class MinElementPage { private page: Page; diff --git a/VINScanner/tests/pages/VinScannerPage.ts b/VINScanner/tests/pages/VinScannerPage.ts index 93d0565..8ef2a97 100644 --- a/VINScanner/tests/pages/VinScannerPage.ts +++ b/VINScanner/tests/pages/VinScannerPage.ts @@ -2,7 +2,7 @@ import { Page, Locator } from "@playwright/test"; // TODO: Update the URL when we upload the page to live server. -const URL = '/index.html'; +const URL = '/VINScanner/index.html'; export class VinScannerPage { private page: Page; diff --git a/VINScanner/tests/unittest/index.test.ts b/VINScanner/tests/unittest/index.test.ts index 49e4767..9782cb5 100644 --- a/VINScanner/tests/unittest/index.test.ts +++ b/VINScanner/tests/unittest/index.test.ts @@ -8,7 +8,7 @@ import { test, expect } from '@playwright/test'; 5. Test whether the result can be populated and copied //TODO */ -const URL = '/index.html'; +const URL = '/VINScanner/index.html'; test.beforeEach(async ({ page }) => { await page.goto(URL); diff --git a/VINScanner/tests/unittest/minimum-elements.test.ts b/VINScanner/tests/unittest/minimum-elements.test.ts index dd58bca..8f1a38c 100644 --- a/VINScanner/tests/unittest/minimum-elements.test.ts +++ b/VINScanner/tests/unittest/minimum-elements.test.ts @@ -1,6 +1,6 @@ import { test, expect } from '@playwright/test'; -const URL = '/minimum-elements.html'; +const URL = '/VINScanner/minimum-elements.html'; test.beforeEach(async ({ page }) => { await page.goto(URL); diff --git a/VINScanner/package-lock.json b/package-lock.json similarity index 100% rename from VINScanner/package-lock.json rename to package-lock.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..0938952 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "capture-vision-javascript-samples", + "version": "1.0.0", + "description": "| Sample Name | Description |\r | ------------ | ------------------------------------------------------------------------------------ |\r | `VIN Scanner` | Scan the VIN code from a barcode or a text line and extract the vehicle information. |", + "main": "index.js", + "scripts": { + "start": "vite --port 3000", + "test": "npx playwright test" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@playwright/test": "^1.47.1", + "@types/node": "^22.5.0" + }, + "dependencies": { + "playwright": "^1.47.1", + "vite": "^5.4.2" + } +} diff --git a/VINScanner/playwright.config.ts b/playwright.config.ts similarity index 97% rename from VINScanner/playwright.config.ts rename to playwright.config.ts index 49c45e7..188a19c 100644 --- a/VINScanner/playwright.config.ts +++ b/playwright.config.ts @@ -5,7 +5,7 @@ import * as path from "path"; * See https://playwright.dev/docs/test-configuration. */ export default defineConfig({ - testDir: "./tests", + testDir: "./VINScanner/tests", /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ @@ -40,7 +40,7 @@ export default defineConfig({ "--headless=chrome", "--use-fake-device-for-media-stream", // "--use-fake-ui-for-media-stream", - `--use-file-for-fake-video-capture=${path.join(__dirname, './tests/video-src/sample.y4m')}`, + `--use-file-for-fake-video-capture=${path.join(__dirname, './VINScanner/tests/video-src/sample.y4m')}`, ], }, contextOptions: {