File: scrape-examples-layout.goml

package info (click to toggle)
rustc 1.70.0%2Bdfsg1-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 722,120 kB
  • sloc: xml: 147,962; javascript: 10,210; sh: 8,590; python: 8,220; ansic: 5,901; cpp: 4,635; makefile: 4,001; asm: 2,856
file content (49 lines) | stat: -rw-r--r-- 1,623 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
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
// Check that the line number column has the correct layout.
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"

// Check that it's not zero.
assert-property-false: (
    ".more-scraped-examples .scraped-example .code-wrapper .src-line-numbers",
    {"clientWidth": "0"}
)

// Check that examples with very long lines have the same width as ones that don't.
store-property: (
    clientWidth,
    ".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers",
    "clientWidth"
)

assert-property: (
    ".more-scraped-examples .scraped-example:nth-child(3) .code-wrapper .src-line-numbers",
    {"clientWidth": |clientWidth|}
)

assert-property: (
    ".more-scraped-examples .scraped-example:nth-child(4) .code-wrapper .src-line-numbers",
    {"clientWidth": |clientWidth|}
)

assert-property: (
    ".more-scraped-examples .scraped-example:nth-child(5) .code-wrapper .src-line-numbers",
    {"clientWidth": |clientWidth|}
)

assert-property: (
    ".more-scraped-examples .scraped-example:nth-child(6) .code-wrapper .src-line-numbers",
    {"clientWidth": |clientWidth|}
)

// Check that for both mobile and desktop sizes, the buttons in scraped examples are displayed
// correctly.

store-value: (offset_y, 4)

// First with desktop
assert-position: (".scraped-example .code-wrapper", {"y": 253})
assert-position: (".scraped-example .code-wrapper .prev", {"y": 253 + |offset_y|})

// Then with mobile
set-window-size: (600, 600)
assert-position: (".scraped-example .code-wrapper", {"y": 308})
assert-position: (".scraped-example .code-wrapper .prev", {"y": 308 + |offset_y|})