helpers for abbruch and nicht-angetreten
This commit is contained in:
		@@ -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 = {
 | 
			
		||||
    name: "moreThan60Minutes",
 | 
			
		||||
    match: node => node.classList.contains("verspaetungs-auswahl"),
 | 
			
		||||
@@ -271,7 +307,10 @@ const moreThan60Minutes = {
 | 
			
		||||
const continueToForm = {
 | 
			
		||||
    name: "continueToForm",
 | 
			
		||||
    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 = {
 | 
			
		||||
@@ -445,7 +484,7 @@ const enterPaymentDetails = {
 | 
			
		||||
const defaultStages = [
 | 
			
		||||
    startClaim, fillData, clickContinue,
 | 
			
		||||
    {"delay": [iWasDelayed, moreThan60Minutes, continueToForm,
 | 
			
		||||
        focusDepartureInput, jumpToTimeInput], "nodep": [], "abort": []},
 | 
			
		||||
        focusDepartureInput, jumpToTimeInput], "nodep": [iDidntTravel, focusDepartureInput], "abort": [iWentBack, focusDepartureInput, focusTurnaroundStationInput]},
 | 
			
		||||
    activateAppellationDropdown, enterAppellationAndActivateTitleDropdown,
 | 
			
		||||
    enterTitleAndActivateCountryDropdown, enterCountry,
 | 
			
		||||
    enterTextPersonalData, /* continueToPayout, */ enterPaymentDetails
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user