28 lines
878 B
JavaScript
28 lines
878 B
JavaScript
const {_android: android} = require('playwright');
|
|
const ExcelUtil = require("./src/excel/ExcelUtil");
|
|
const CommandorPage = require("./src/workers/CommandorPage");
|
|
const MongoManager = require("./src/workers/mongo_manager");
|
|
|
|
function delay(delayInms) {
|
|
return new Promise(resolve => {
|
|
setTimeout(() => {
|
|
resolve(2);
|
|
}, delayInms);
|
|
});
|
|
}
|
|
|
|
const mongoManager = new MongoManager();
|
|
mongoManager.connect()
|
|
|
|
let excelUtil = new ExcelUtil();
|
|
let contactList = excelUtil.readContacts();
|
|
(async () => {
|
|
// Connect to the device.
|
|
const [device] = await android.devices();
|
|
console.log(`Model: ${device.model()}`);
|
|
console.log(`Serial: ${device.serial()}`);
|
|
let commandor = new CommandorPage(contactList[3], device, mongoManager);
|
|
//read contacts form excel
|
|
await commandor.loadPage();
|
|
// Take screenshot of the whole device.
|
|
})(); |