| { |
| // See loading.py or `crossbench loading --help` for more details. |
| // Usage: |
| // crossbench loading --page-config=config.hjson |
| "pages": { |
| // Example below will result in: |
| // A Scenario named = Google and will perform the actions listed synchronously |
| // Time suffixes accepted: |
| // milliseconds: ["ms", "millis", "milliseconds"] |
| // seconds: ["s", "sec", "second", "seconds"] |
| // minutes: ["m", "min", "minute", "minutes"] |
| // hours: ["h", "hrs", "hour", "hours"] |
| // |
| // Supported Actions: |
| // GET: { |
| // action: "get", |
| // url: URL, |
| // duration: DURATION, |
| // ready_state: [any, interactive, complete], |
| // target: [self, _blank, _parent, _top], |
| // timeout: DURATION, |
| // } |
| // |
| // CLICK: { |
| // action: "click", |
| // position: POSITION, |
| // timeout: DURATION, |
| // verify: [CSS_SELECTOR, XPATH_SELECTOR], |
| // } |
| // |
| // POSITION: { |
| // x: NUMBER, |
| // y: NUMBER, |
| // } | { |
| // selector: [CSS_SELECTOR, XPATH_SELECTOR], |
| // scroll_into_view: BOOL = false, |
| // required: BOOL = true, |
| // wait: BOOL = false, |
| // } | [ |
| // CSS_SELECTOR, XPATH_SELECTOR |
| // ] |
| // |
| // WAIT: { |
| // action: "wait", |
| // duration: DURATION, |
| // } |
| // |
| // SCROLL: { |
| // action: "scroll", |
| // direction: [up, down], |
| // distance: NUMBER, |
| // duration: DURATION, |
| // } |
| // |
| |
| "Google": [ |
| { |
| "action": "get" |
| "url": "https://www.google.de/search?q=magic" |
| "duration": "2s" |
| } |
| // Click away the cookie banner: |
| { |
| "action": "click" |
| "position": { |
| "required": false |
| "selector": "xpath///button/div[contains(text(),'akzeptieren')]" |
| } |
| } |
| { |
| "action": "click" |
| "position": { |
| "required": false |
| "selector": "xpath///button/div[contains(text(),'Accept')]" |
| } |
| } |
| { |
| "action": "scroll" |
| "distance": 2000 |
| "duration": "3s" |
| } |
| ] |
| "Amazon": [ |
| { |
| "action": "get" |
| "url": "https://www.amazon.com/s?k=v8" |
| } |
| { |
| "action": "wait" |
| "duration": "500ms" |
| } |
| { |
| "action": "scroll" |
| "distance": 2000 |
| "duration": "2s" |
| } |
| { |
| "action": "scroll" |
| "distance": -1000 |
| "duration": "1.5s" |
| } |
| ] |
| "Youtube": [ |
| { |
| "action": "get" |
| "url": "https://www.youtube.com" |
| "timeout": "20s" |
| "ready-state": "interactive" |
| } |
| // Click away the cookie banner: |
| { |
| "action": "click" |
| "position": { |
| "required": false |
| "selector": "xpath///*/button[contains(@aria-label, 'akzeptieren')]" |
| } |
| } |
| { |
| "action": "click" |
| "position": { |
| "required": false |
| "selector": "xpath///*/button[contains(@aria-label, 'Accept')]" |
| } |
| } |
| { |
| "action": "scroll" |
| "duration": "1s" |
| } |
| ] |
| } |
| } |