add support for random store
This commit is contained in:
+2
-2
@@ -35,8 +35,8 @@ async function needToBook(contact, mongoManager) {
|
||||
}
|
||||
|
||||
async function startBook(contactPojo, device, selectedStore) {
|
||||
console.log(`Model: ${device.model()}`);
|
||||
console.log(`Serial: ${device.serial()}`);
|
||||
console.log(`型号: ${device.model()}`);
|
||||
console.log(`序列号: ${device.serial()}`);
|
||||
if (await needToBook(contactPojo, mongoManager)) {
|
||||
let commandor = new CommandorPage(contactPojo, device, mongoManager, selectedStore);
|
||||
//read contacts form excel
|
||||
|
||||
@@ -196,10 +196,12 @@ class CommandorPage {
|
||||
async chooseStore(page) {
|
||||
try {
|
||||
if (!page.isClosed()) {
|
||||
await page.locator(PREFER_STORE).focus()
|
||||
await delay(1000)
|
||||
await page.click(PREFER_STORE);
|
||||
await page.selectOption(PREFER_STORE, this.selectedStore);
|
||||
if (selectedStore !== "random") {
|
||||
await page.locator(PREFER_STORE).focus()
|
||||
await delay(1000)
|
||||
await page.click(PREFER_STORE);
|
||||
await page.selectOption(PREFER_STORE, this.selectedStore);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
||||
Reference in New Issue
Block a user