• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2    // See loading.py  or `crossbench loading --help` for more details.
3    // Usage:
4    //   crossbench loading --page-config=config.hjson
5  pages: {
6        // Example below will result in:
7        // A Scenario named = Google and will perfom the actions listed synchronisly
8        // Time suffixes accepted:
9        //   milliseconds: ["ms", "millis", "milliseconds"]
10        //   seconds:      ["s", "sec", "second", "seconds"]
11        //   minutes:      ["m", "min", "minute", "minutes"]
12        //   hours:        ["h", "hrs", "hour", "hours"]
13        //
14        // Supported Actions:
15        //  GET: {
16        //      action: "get",
17        //      url: URL,
18        //      duration: DURATION,
19        //      ready_state: [any, interactive, complete],
20        //      target: [self, _blank, _parent, _top],
21        //      timeout: DURATION,
22        //  }
23        //
24        //  CLICK: {
25        //      action: "click",
26        //      selector: [CSS_SELECTOR, XPATH_SELECTOR],
27        //      required: BOOL,
28        //      scroll_into_view: BOOL,
29        //      timeout: DURATION,
30        //  }
31        //
32        //  WAIT: {
33        //      action: "wait",
34        //      duration: DURATION,
35        //  }
36        //
37        //  SCROLL: {
38        //      action: "scroll",
39        //      direction: [up, down],
40        //      distance: NUMBER,
41        //      duration: DURATION,
42        //  }
43        //
44
45    "Google": [
46      {
47        "action": "get",
48        "url": "https://www.google.de/search?q=magic",
49        "duration": "2s"
50      },
51            // Click away the cookie banner:
52      {
53        "action": "click",
54        "required": false,
55        "selector": "xpath///button/div[contains(text(),'akzeptieren')]"
56      },
57      {
58        "action": "click",
59        "required": false,
60        "selector": "xpath///button/div[contains(text(),'Accept')]"
61      },
62      {
63        "action": "scroll",
64        "distance": 2000,
65        "duration": "3s"
66      }
67    ],
68
69    "Amazon": [
70      {
71        "action": "get",
72        "url": "https://www.amazon.com/s?k=v8"
73      },
74      {
75        "action": "wait",
76        "duration": "500ms"
77      },
78      {
79        "action": "scroll",
80        "distance": 2000,
81        "duration": "2s"
82      },
83      {
84        "action": "scroll",
85        "distance": -1000,
86        "duration": "1.5s"
87      }
88    ],
89
90    "Youtube": [
91      {
92        "action": "get",
93        "url": "https://www.youtube.com",
94        "timeout": "20s",
95        "ready-state": "interactive"
96      },
97            // Click away the cookie banner:
98      {
99        "action": "click",
100        "required": false,
101        "selector": "xpath///*/button[contains(@aria-label, 'akzeptieren')]"
102      },
103      {
104        "action": "click",
105        "required": false,
106        "selector": "xpath///*/button[contains(@aria-label, 'Accept')]"
107      },
108      {
109        "action": "scroll",
110        "duration": "1s"
111      }
112    ]
113  }
114}