-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50f2626
commit f9fcb69
Showing
7 changed files
with
37 additions
and
105 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { test as baseTest } from "@playwright/test"; | ||
import { MRZScannerPage } from "./MRZScanner.fixture"; | ||
|
||
export const test = baseTest.extend<{ | ||
mrzScannerPage: MRZScannerPage; | ||
}>({ | ||
mrzScannerPage: async ({ page }, use) => { | ||
const mrzScannerPage = new MRZScannerPage(page); | ||
await use(mrzScannerPage); | ||
}, | ||
}); | ||
|
||
export { expect } from "@playwright/test"; |
33 changes: 10 additions & 23 deletions
33
...ew/pr-4/tests/e2e/test-MRZScanner.spec.ts → pr-preview/pr-4/e2e/tests/MRZScanner.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,40 @@ | ||
import { test, expect } from '../fixtures'; | ||
import { test, expect } from "../fixtures"; | ||
|
||
// Adding userAgent to avoid firefox headless mode to block the script as it is being detected as bot. | ||
const userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0"; | ||
|
||
|
||
test.describe.configure({ mode: 'serial' }); | ||
|
||
test.describe("Verify the VIN Scanner Page title and veirfy user can select different settings", () => { | ||
test.use({userAgent}); | ||
test.describe.configure({ mode: "serial" }); | ||
|
||
test.describe("Verify the MRZ Scanner page title and verify user can select different settings", () => { | ||
test.beforeEach(async ({ mrzScannerPage }) => { | ||
|
||
// Navigate to the VIN Scanner page | ||
// Navigate to the MRZ Scanner page | ||
await mrzScannerPage.navigateTo(); | ||
}); | ||
|
||
test("should display the correct title", async ({ mrzScannerPage }) => { | ||
// Validate the page title | ||
const title = await mrzScannerPage.getTitle(); | ||
await expect(title).toContain("Dynamsoft MRZ Scanner"); | ||
|
||
}); | ||
|
||
|
||
test('should click "Both" button on the page and validate the header label text', async ({ mrzScannerPage }) => { | ||
await mrzScannerPage.clickStartButton(); | ||
|
||
await mrzScannerPage.clickScanBothButton(); | ||
const selectedBtn = await mrzScannerPage.getSelectedButton(); | ||
await expect(selectedBtn).toHaveText('Both'); | ||
|
||
await expect(selectedBtn).toHaveText("Both"); | ||
}); | ||
|
||
test('should click "ID" button on the page and validate the header label text', async ({ mrzScannerPage }) => { | ||
await mrzScannerPage.clickStartButton(); | ||
|
||
await mrzScannerPage.clickscanIDButton(); | ||
const selectedBtn = await mrzScannerPage.getSelectedButton(); | ||
await expect(selectedBtn).toHaveText('ID'); | ||
|
||
await expect(selectedBtn).toHaveText("ID"); | ||
}); | ||
|
||
test('should click "Passport" button on the page and validate the header label text', async ({ mrzScannerPage }) => { | ||
await mrzScannerPage.clickStartButton(); | ||
|
||
await mrzScannerPage.clickscanPassportButton(); | ||
const selectedBtn = await mrzScannerPage.getSelectedButton(); | ||
await expect(selectedBtn).toHaveText('Passport'); | ||
|
||
await mrzScannerPage.clickscanPassportButton(); | ||
const selectedBtn = await mrzScannerPage.getSelectedButton(); | ||
await expect(selectedBtn).toHaveText("Passport"); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.