implement country setting
This commit is contained in:
parent
2d0b884c0d
commit
37a04c2155
@ -279,34 +279,39 @@ const enterAppellationAndActivateTitleDropdown = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const enterTitle = {
|
const enterTitleAndActivateCountryDropdown = {
|
||||||
name: "enterTitle",
|
name: "enterTitle",
|
||||||
/**@param {Element} node */
|
/**@param {Element} node */
|
||||||
match: node => node.classList.contains("db-web-dropdown-outer-container") && node.querySelector(".db-web-select-list") !== null,
|
match: node => node.classList.contains("db-web-dropdown-outer-container") && node.querySelector(".db-web-select-list") !== null,
|
||||||
/**@param {Element} node */
|
/**@param {Element} node */
|
||||||
execute: node => {
|
execute: node => {
|
||||||
settings.get("addr__title").then(foundKeys => {
|
|
||||||
console.log("storage returned", foundKeys);
|
|
||||||
ensureSettingsProp("addr__title", v => {
|
ensureSettingsProp("addr__title", v => {
|
||||||
const selectList = $$(node, "ul");
|
const selectList = $$(node, "ul");
|
||||||
selectList.querySelector(`[data-value=${foundKeys.addr__title}]`).dispatchEvent(_clickEv());
|
selectList.querySelector(`[data-value=${foundKeys.addr__title}]`).dispatchEvent(_clickEv());
|
||||||
}, () => { node.parentElement.parentElement.parentElement.querySelector("button").dispatchEvent(_clickEv()); })
|
}, () => {
|
||||||
});
|
node.parentElement.parentElement.parentElement.querySelector("button").dispatchEvent(_clickEv());
|
||||||
|
}
|
||||||
|
);
|
||||||
|
document.querySelector(".test-adresse-land.db-web-select button").dispatchEvent(_clickEv());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const enterFirstName = {
|
|
||||||
name: "enterFirstName",
|
const enterCountry = {
|
||||||
|
name: "enterCountry",
|
||||||
expects: "mutation",
|
expects: "mutation",
|
||||||
match: mutation => {
|
match: mutation => {
|
||||||
return mutation.target.parentNode.parentNode.classList.contains("test-name-titel") &&
|
return mutation.target.parentNode.parentNode.classList.contains("test-adresse-land") &&
|
||||||
Array.from(mutation.removedNodes).some(
|
Array.from(mutation.addedNodes).some(
|
||||||
n => n.nodeType === Node.ELEMENT_NODE &&
|
n => n.nodeType === Node.ELEMENT_NODE &&
|
||||||
n.classList.contains("db-web-dropdown-outer-container"))
|
n.classList.contains("db-web-dropdown-outer-container"))
|
||||||
},
|
},
|
||||||
execute: () => {
|
execute: () => {
|
||||||
let node = document;
|
ensureSettingsProp("addr__country", v => {
|
||||||
settings.get()
|
const selectList = $(".test-adresse-land ul");
|
||||||
|
selectList.querySelector(`[data-value=${v}]`).dispatchEvent(_clickEv());
|
||||||
|
}, () => $(".test-adresse-land.db-web-select button").dispatchEvent(_clickEv()));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,9 +398,11 @@ const enterPaymentDetails = {
|
|||||||
}
|
}
|
||||||
const defaultStages = [
|
const defaultStages = [
|
||||||
startClaim, fillData, clickContinue,
|
startClaim, fillData, clickContinue,
|
||||||
iWasDelayed, moreThan60Minutes, continueToForm, focusDepartureInput, jumpToTimeInput,
|
iWasDelayed, moreThan60Minutes, continueToForm,
|
||||||
activateAppellationDropdown, enterAppellationAndActivateTitleDropdown, enterTitle,
|
focusDepartureInput, jumpToTimeInput,
|
||||||
enterTextPersonalData, /* continueToPayout */, enterPaymentDetails
|
activateAppellationDropdown, enterAppellationAndActivateTitleDropdown,
|
||||||
|
enterTitleAndActivateCountryDropdown, enterCountry,
|
||||||
|
enterTextPersonalData, /* continueToPayout, */ enterPaymentDetails
|
||||||
];
|
];
|
||||||
/** @type Stage[] */
|
/** @type Stage[] */
|
||||||
stages = defaultStages;
|
stages = defaultStages;
|
Loading…
Reference in New Issue
Block a user