implement country setting
This commit is contained in:
parent
2d0b884c0d
commit
37a04c2155
@ -258,8 +258,8 @@ const activateAppellationDropdown = {
|
||||
match: node => node.classList.contains("persoenlicheangaben") && hasConfiguredPersonalData,
|
||||
execute: node => {
|
||||
return ensureSettingsProp("addr__appellation", () => {
|
||||
const selectList = node.querySelector('.test-name-anrede.db-web-select');
|
||||
selectList.querySelector('button').dispatchEvent(_clickEv());
|
||||
const selectList = node.querySelector('.test-name-anrede.db-web-select');
|
||||
selectList.querySelector('button').dispatchEvent(_clickEv());
|
||||
}, () => true);
|
||||
}
|
||||
}
|
||||
@ -269,44 +269,49 @@ const enterAppellationAndActivateTitleDropdown = {
|
||||
match: node => node.classList.contains("db-web-dropdown-outer-container") && node.querySelector(".db-web-select-list") !== null,
|
||||
execute: node => {
|
||||
ensureSettingsProp("addr__appellation", v => {
|
||||
const selectList = $$(node, "ul");
|
||||
selectList.querySelector(`[data-value=${foundKeys.addr__appellation}]`).dispatchEvent(_clickEv());
|
||||
const selectList = $$(node, "ul");
|
||||
selectList.querySelector(`[data-value=${foundKeys.addr__appellation}]`).dispatchEvent(_clickEv());
|
||||
}, () => {
|
||||
node.parentElement.parentElement.parentElement.querySelector("button").dispatchEvent(_clickEv());
|
||||
node.parentElement.parentElement.parentElement.querySelector("button").dispatchEvent(_clickEv());
|
||||
});
|
||||
$('.test-name-titel.db-web-select button').dispatchEvent(_clickEv());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
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 => {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,7 +359,7 @@ const enterTextPersonalData = {
|
||||
continueBtn.dispatchEvent(_clickEv());
|
||||
}, delay);
|
||||
});
|
||||
return true;
|
||||
return true;
|
||||
|
||||
},
|
||||
}
|
||||
@ -371,7 +376,7 @@ const continueToPayout = {
|
||||
const enterPaymentDetails = {
|
||||
name: "enterPaymentDetails",
|
||||
match: node => node.querySelector(".entschaedigung") &&
|
||||
hasConfiguredBankDetails,
|
||||
hasConfiguredBankDetails,
|
||||
execute: node => {
|
||||
const xfrRadio = node.querySelector('#ueberweisung');
|
||||
xfrRadio.dispatchEvent(new Event('change'));
|
||||
@ -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