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