The recent development of battery electric trucks (BETs) suggests that they could play a vital role in transitioning to zero-emission road freight. To facilitate this transition, it is important to understand under which conditions BETs can be a viable alternative to internal combustion engine trucks (ICETs). Concurrently, the advancement of autonomous driving technology adds uncertainty and complexity to analyzing how the cost competitiveness of future zero-emissions trucks, such as autonomous electric trucks (AETs) may develop. This study examines the cost performance of BETs and AETs compared to ICETs, and how it varies over different market and technology conditions, charging strategies, and transport applications. Focus is on heavy-duty tractor-trailer trucks operating full truckload shuttle-flows in Sweden. Due to the inherent uncertainty and interactions among the analyzed factors, the analysis is performed as computational experiments using a simulation model of BET, AET, and ICET shuttle flow operations and associated costs. In total, 19,200 experiments are performed by sampling the model across 1200 scenarios representing various transport applications and technical and economic conditions for sixteen charging strategies with different combinations of depot, destination, and en route charging. The results indicate that both BETs and AETs are cost competitive compared to ICETs in a large share of scenarios. High asset utilization is important for offsetting additional investment costs in vehicles and chargers, highlighting the importance of deploying these vehicles in applications that enable high productivity. The cost performance for BETs is primarily influenced by energy related costs, charging strategy, and charging infrastructure utilization. The AET cost performance is in addition heavily affected by remote operations cost, and costs for the automated driving system. When feasible, relying only on depot charging is in many scenarios the most cost-effective charging strategy, with the primary exceptions being highly energy-demanding scenarios with long distances and heavy goods in which the required battery is too heavy to operate the truck within vehicle weight regulations if not complemented by destination, or en route charging. However, many experiments do not lead to a reduced payload capacity for BETs and AETs compared to ICETs, and a large majority of the considered scenarios are feasible to operate with a BET or AET within current gross vehicle weight regulations.