helpers for abbruch and nicht-angetreten
This commit is contained in:
parent
b211aeb41f
commit
a8bc3284e4
@ -260,6 +260,42 @@ const iWasDelayed = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const iDidntTravel = {
|
||||||
|
name: "iDidntTravel",
|
||||||
|
match: node => node.classList.contains("antrags-typ-auswahl"),
|
||||||
|
execute: node => {
|
||||||
|
const noTravel = $$(node, "input#antragstyp-nicht-angetreten");
|
||||||
|
if (noTravel instanceof HTMLInputElement){
|
||||||
|
noTravel.dispatchEvent(new Event("change"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const iWentBack = {
|
||||||
|
name: "iWentBack",
|
||||||
|
match: node => node.classList.contains("antrags-typ-auswahl"),
|
||||||
|
execute: node => {
|
||||||
|
const wentBack = $$(node, "input#antragstyp-abgebrochen");
|
||||||
|
if (wentBack instanceof HTMLInputElement){
|
||||||
|
wentBack.dispatchEvent(new Event("change"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const focusTurnaroundStationInput = {
|
||||||
|
name: "focusTurnaroundStationInput",
|
||||||
|
expects: "node",
|
||||||
|
match: node => node instanceof Element && Array.from(node.children).some(c => c.classList.contains("abbruchbahnhof")),
|
||||||
|
execute: node => {
|
||||||
|
$$(node, ".abbruchbahnhof .fahrgastrechte-bahnhof__halt-search input").focus();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const moreThan60Minutes = {
|
const moreThan60Minutes = {
|
||||||
name: "moreThan60Minutes",
|
name: "moreThan60Minutes",
|
||||||
match: node => node.classList.contains("verspaetungs-auswahl"),
|
match: node => node.classList.contains("verspaetungs-auswahl"),
|
||||||
@ -271,7 +307,10 @@ const moreThan60Minutes = {
|
|||||||
const continueToForm = {
|
const continueToForm = {
|
||||||
name: "continueToForm",
|
name: "continueToForm",
|
||||||
match: node => node.classList.contains("verspaetung-bestaetigung"),
|
match: node => node.classList.contains("verspaetung-bestaetigung"),
|
||||||
execute: node => $$(node, 'button.fahrgastrechte-continue-button').dispatchEvent(_clickEv())
|
execute: node => {
|
||||||
|
$$(node, 'button.fahrgastrechte-continue-button').dispatchEvent(_clickEv()).focus();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const focusDepartureInput = {
|
const focusDepartureInput = {
|
||||||
@ -445,7 +484,7 @@ const enterPaymentDetails = {
|
|||||||
const defaultStages = [
|
const defaultStages = [
|
||||||
startClaim, fillData, clickContinue,
|
startClaim, fillData, clickContinue,
|
||||||
{"delay": [iWasDelayed, moreThan60Minutes, continueToForm,
|
{"delay": [iWasDelayed, moreThan60Minutes, continueToForm,
|
||||||
focusDepartureInput, jumpToTimeInput], "nodep": [], "abort": []},
|
focusDepartureInput, jumpToTimeInput], "nodep": [iDidntTravel, focusDepartureInput], "abort": [iWentBack, focusDepartureInput, focusTurnaroundStationInput]},
|
||||||
activateAppellationDropdown, enterAppellationAndActivateTitleDropdown,
|
activateAppellationDropdown, enterAppellationAndActivateTitleDropdown,
|
||||||
enterTitleAndActivateCountryDropdown, enterCountry,
|
enterTitleAndActivateCountryDropdown, enterCountry,
|
||||||
enterTextPersonalData, /* continueToPayout, */ enterPaymentDetails
|
enterTextPersonalData, /* continueToPayout, */ enterPaymentDetails
|
||||||
|
Loading…
Reference in New Issue
Block a user