try to set store via excel
This commit is contained in:
@@ -10,7 +10,7 @@ class ExcelUtil {
|
|||||||
(info, index, list) => {
|
(info, index, list) => {
|
||||||
if (index > 0 && info.length > 0) {
|
if (index > 0 && info.length > 0) {
|
||||||
// console.log(info)
|
// console.log(info)
|
||||||
if (info[0].includes("Aijing")){
|
if (info[0].includes("Aijing")) {
|
||||||
console.log("found");
|
console.log("found");
|
||||||
}
|
}
|
||||||
let name = info[0].trim().split(" ")
|
let name = info[0].trim().split(" ")
|
||||||
@@ -19,7 +19,11 @@ class ExcelUtil {
|
|||||||
let phoneNumber = info[1];
|
let phoneNumber = info[1];
|
||||||
let passportNumber = info[2];
|
let passportNumber = info[2];
|
||||||
let mail = info[3];
|
let mail = info[3];
|
||||||
let newContact = new ContactPojo(phoneNumber, passportNumber, lastName, firstName, mail);
|
let store = info[4];
|
||||||
|
if (store === undefined || store.length === 0) {
|
||||||
|
store = "random"
|
||||||
|
}
|
||||||
|
let newContact = new ContactPojo(phoneNumber, passportNumber, lastName, firstName, mail, store);
|
||||||
contactList.push(newContact);
|
contactList.push(newContact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
class ContactPojo {
|
class ContactPojo {
|
||||||
|
|
||||||
constructor(phoneNumber, passportNumber, lastName, firstName, mail) {
|
constructor(phoneNumber, passportNumber, lastName, firstName, mail, store) {
|
||||||
this.phoneNumber = phoneNumber;
|
this.phoneNumber = phoneNumber;
|
||||||
this.passportNumber = passportNumber;
|
this.passportNumber = passportNumber;
|
||||||
this.lastName = lastName;
|
this.lastName = lastName;
|
||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
this.mail = mail;
|
this.mail = mail;
|
||||||
|
this.store = store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -441,7 +441,10 @@ class CommandorPage {
|
|||||||
await delay(getRandomWaitTime())
|
await delay(getRandomWaitTime())
|
||||||
try {
|
try {
|
||||||
if (!this.page.isClosed() && !this.isTerminated) {
|
if (!this.page.isClosed() && !this.isTerminated) {
|
||||||
if (this.selectedStore !== "random") {
|
if (this.contact.store === undefined || this.contact.store.length === 0) {
|
||||||
|
this.contact.store = this.selectedStore;
|
||||||
|
}
|
||||||
|
if (this.contact.store !== "random") {
|
||||||
// page.focus(PREFER_STORE);
|
// page.focus(PREFER_STORE);
|
||||||
await delay(500)
|
await delay(500)
|
||||||
// page.click(PREFER_STORE);
|
// page.click(PREFER_STORE);
|
||||||
|
|||||||
Reference in New Issue
Block a user