- Note that the test is currently only running on Chrome browser. You can modify the playwright.config.js to run the test on other browsers.
- Scan Count test following the below steps:
- Launch the browser
- Navigate to the specified URL (I use live server to host the hellow-world.html file)
- Scan the QR code
- Verify the scan count
- Close the browser
- Repeat the above steps with a delay
-
Ensure you have Node.js installed
-
Ensure you have VS Code Liver Server [https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer] installed and setup.
-
Follow the steps to configure the code under tests/scan-count-spec.ts to use your own local setup
- Configure line 4 to your local live server URL
const url = 'https://192.168.1.178:5503/hello-world.html';
- Configure the camera option on line 27 if you do not want to use the default camera upon launching the site
/* Selecting the Camera option to scan */ // await page.selectOption('.dce-sel-camera', { label: 'Camo' });
- Configure your test duration and interval on line 8 and 9
const duration = 25 * 60 * 1000; // 25 minutes in milliseconds for total test duration const interval = 3 * 60 * 1000; // 3 minutes milliseconds delay between each scan loop
- Configure line 4 to your local live server URL
- Clone the repository:
git clone https://github.com/eugene-dynamsoft/DBR-JS-Scan-Count-Test.git
- Navigate to the project directory:
cd DBR-JS-Scan-Count-Test
- Install required dependencies:
npm install
- Run the test
npm test