Skip to content

ui_test

UITest

Bases: WorkflowTaskNode

Shows all supported widgets for testing

Source code in client/ayon_workflow/plugins/workflow/ui_test.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class UITest(WorkflowTaskNode):
    """Shows all supported widgets for testing"""

    version = "0.0.1"
    inputs = [
        InputAttribute(
            name="string",
            description="whatever",
        ),
        InputAttribute(
            name="filepath",
            description="whatever",
            widget={
                "name": "filepath",
            },
        ),
        InputAttribute(
            name="text",
            description="whatever",
            widget={
                "name": "text",
            },
        ),
        InputAttribute(
            name="choice",
            description="whatever",
            widget={
                "name": "choice",
                "options": ["GET", "POST", "PUT", "DELETE", "PATCH"],
            },
        ),
        InputAttribute(
            name="bool",
            description="A binary choice",
        ),
        InputAttribute(
            name="int",
            description="whatever",
        ),
        InputAttribute(
            name="enum",
            description="whatever",
            widget={
                "name": "enum",
                "fields": ["do this", "do that", "have a break"],
            },
        ),
        InputAttribute(
            name="float",
            description="whatever",
        ),
        InputAttribute(
            name="string_array",
            description="whatever",
        ),
        InputAttribute(
            name="float_array",
            description="whatever",
        ),
        InputAttribute(
            name="int_array",
            description="whatever",
        ),
    ]
    outputs = []

    def execute(
        self,
        string: str = "some string data",
        filepath: str = "/foo/bar.txt",
        text: str = "Enter longer text with line breaks.",
        choice: str = "/foo/bar.txt",
        bool: bool = True,
        int: int = 42,
        enum: int = 1,
        float: float = 1.234567,
        string_array: List[str] = ["foo", "bar", "baz"],
        float_array: List[float] = [],
        int_array: List[int] = [],
    ):
        """ Do nothing, UI/UX dev only.
        """
        pass

execute(string='some string data', filepath='/foo/bar.txt', text='Enter longer text with line breaks.', choice='/foo/bar.txt', bool=True, int=42, enum=1, float=1.234567, string_array=['foo', 'bar', 'baz'], float_array=[], int_array=[])

Do nothing, UI/UX dev only.

Source code in client/ayon_workflow/plugins/workflow/ui_test.py
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
def execute(
    self,
    string: str = "some string data",
    filepath: str = "/foo/bar.txt",
    text: str = "Enter longer text with line breaks.",
    choice: str = "/foo/bar.txt",
    bool: bool = True,
    int: int = 42,
    enum: int = 1,
    float: float = 1.234567,
    string_array: List[str] = ["foo", "bar", "baz"],
    float_array: List[float] = [],
    int_array: List[int] = [],
):
    """ Do nothing, UI/UX dev only.
    """
    pass