Skip to content

Commit

Permalink
Moved playwirght config and package.json files to root directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-dynamsoft committed Oct 9, 2024
1 parent d4ee0dd commit 1885d50
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VINScanner/tests/pages/MinElementPage.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion VINScanner/tests/pages/VinScannerPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion VINScanner/tests/unittest/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion VINScanner/tests/unittest/minimum-elements.test.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
4 changes: 2 additions & 2 deletions VINScanner/playwright.config.ts → playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 1885d50

Please sign in to comment.