1# Copyright 2024 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5from __future__ import annotations 6 7from typing import Tuple, Type 8 9from crossbench.action_runner.action.action import ACTIONS, Action 10from crossbench.action_runner.action.click import ClickAction 11from crossbench.action_runner.action.dump_html import DumpHtmlAction 12from crossbench.action_runner.action.get import GetAction 13from crossbench.action_runner.action.inject_new_document_script import \ 14 InjectNewDocumentScriptAction 15from crossbench.action_runner.action.js import JsAction 16from crossbench.action_runner.action.screenshot import ScreenshotAction 17from crossbench.action_runner.action.scroll import ScrollAction 18from crossbench.action_runner.action.swipe import SwipeAction 19from crossbench.action_runner.action.switch_tab import SwitchTabAction 20from crossbench.action_runner.action.text_input import TextInputAction 21from crossbench.action_runner.action.wait import WaitAction 22from crossbench.action_runner.action.wait_for_element import \ 23 WaitForElementAction 24from crossbench.action_runner.action.wait_for_ready_state import \ 25 WaitForReadyStateAction 26 27ACTIONS_TUPLE: Tuple[Type[Action], ...] = ( 28 ClickAction, 29 DumpHtmlAction, 30 GetAction, 31 InjectNewDocumentScriptAction, 32 JsAction, 33 ScreenshotAction, 34 ScrollAction, 35 SwipeAction, 36 SwitchTabAction, 37 TextInputAction, 38 WaitAction, 39 WaitForElementAction, 40 WaitForReadyStateAction, 41) 42for action_cls in ACTIONS_TUPLE: 43 ACTIONS[action_cls.TYPE] = action_cls 44 45assert len(ACTIONS_TUPLE) == len(ACTIONS), "Non unique Action.TYPE present" 46