Merge branch 'master' into feature/gui

This commit is contained in:
2022-09-14 18:57:17 +02:00
3 changed files with 50 additions and 27 deletions
+2 -8
View File
@@ -26,17 +26,13 @@ mongoManager.connect().then(r => {
android.devices().then((devices) => {
let segmentNumber = listToBook.length / devices.length;
for (let i = 0; i < devices.length; i++) {
startWithList(contactList.slice(i * segmentNumber, segmentNumber * (i + 1)), devices[i]);
startWithList(listToBook.slice(i * segmentNumber, segmentNumber * (i + 1)), devices[i]);
}
})
})
}
)
function startBookWithNumbers(startNumber, endNumber) {
}
// Connect to the device.
async function needToBook(contact, mongoManager) {
@@ -73,6 +69,4 @@ async function startWithList(contacts, device) {
const contents = await startBook(contactPojo, device);
console.log(contents);
}, Promise.resolve());
}
module.exports = startBookWithNumbers
}
+4 -4
View File
@@ -17,10 +17,10 @@ adb -s 76a3ac8d shell am start -n com.android.chrome/com.google.android.apps.chr
adb -s 47e7e36b shell pm clear com.android.chrome
adb -s 47e7e36b shell am set-debug-app --persistent com.android.chrome
adb -s 47e7e36b shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#asus tab
adb -s 751005221815 shell pm clear com.android.chrome
adb -s 751005221815 shell am set-debug-app --persistent com.android.chrome
adb -s 751005221815 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#huawei
adb -s EPHUT20825001518 shell pm clear com.android.chrome
adb -s EPHUT20825001518 shell am set-debug-app --persistent com.android.chrome
adb -s EPHUT20825001518 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#xiaomi tab
adb -s 5ac879a2 shell pm clear com.android.chrome
+44 -15
View File
@@ -120,9 +120,15 @@ class CommandorPage {
}
async fillEmail(page) {
await page.locator(EMAIL_ID).focus();
await delay(getRandomWaitTime())
await page.locator(EMAIL_ID).fill(this.contact.mail);
try {
if (!page.isClosed()) {
await page.locator(EMAIL_ID).focus();
await delay(getRandomWaitTime())
await page.locator(EMAIL_ID).fill(this.contact.mail);
}
} catch (e) {
console.log(e)
}
}
async inputPhoneNumber(page) {
@@ -157,24 +163,47 @@ class CommandorPage {
}
async inputPassportId(page) {
await page.locator(PASSPORT_ID).focus()
await delay(getRandomWaitTime())
await page.locator(PASSPORT_ID).fill(this.contact.passportNumber.toString())
try {
if (!page.isClosed()) {
await page.locator(PASSPORT_ID).focus()
await delay(getRandomWaitTime())
await page.locator(PASSPORT_ID).fill(this.contact.passportNumber.toString())
}
} catch (e) {
console.log(e);
this.isTerminated = true;
}
}
async checkCGU(page) {
await page.locator(CGU_ID).focus()
await page.locator(CGU_ID).click()
await delay(getRandomWaitTime())
await page.locator(PROCESSING_ID).focus()
await page.locator(PROCESSING_ID).click()
try {
if (!page.isClosed()) {
await page.locator(CGU_ID).focus()
await page.locator(CGU_ID).click()
await delay(getRandomWaitTime())
await page.locator(PROCESSING_ID).focus()
await page.locator(PROCESSING_ID).click()
}
} catch (e) {
console.log(e);
this.isTerminated = true;
}
}
async chooseStore(page) {
await page.locator(PREFER_STORE).focus()
await delay(1000)
await page.click(PREFER_STORE);
await page.selectOption(PREFER_STORE, "faubourg");
try {
if (!page.isClosed()) {
await page.locator(PREFER_STORE).focus()
await delay(1000)
await page.click(PREFER_STORE);
await page.selectOption(PREFER_STORE, "faubourg");
}
} catch (e) {
console.log(e);
this.isTerminated = true;
}
// await page.click(PREFER_STORE);
}