Skip to content

Commit f19afee

Browse files
committed
Testing gui test
1 parent b76f644 commit f19afee

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

tests/gui/move-between-pages.goml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,41 @@
33
go-to: |DOC_PATH| + "all-summary/index.html"
44

55
// default page is the first chapter
6-
assert-text: ("title", "Prefix 1 - all-summary")
6+
wait-for-text: ("title", "Prefix 1 - all-summary")
77

88
// Trying to move to the left beyond the prefix pages - nothing changes
99
press-key: 'ArrowLeft'
10-
assert-text: ("title", "Prefix 1 - all-summary")
10+
wait-for-text: ("title", "Prefix 1 - all-summary")
1111

1212
// Move left
1313
go-to: |DOC_PATH| + "all-summary/intro.html"
14-
assert-text: ("title", "Introduction - all-summary")
14+
wait-for-text: ("title", "Introduction - all-summary")
1515

1616
press-key: 'ArrowLeft'
17-
assert-text: ("title", "Prefix 2 - all-summary")
17+
wait-for-text: ("title", "Prefix 2 - all-summary")
1818

1919
press-key: 'ArrowLeft'
20-
assert-text: ("title", "Prefix 1 - all-summary")
20+
wait-for-text: ("title", "Prefix 1 - all-summary")
2121

2222
// Move right
2323
press-key: 'ArrowRight'
24-
assert-text: ("title", "Prefix 2 - all-summary")
24+
wait-for-text: ("title", "Prefix 2 - all-summary")
2525

2626
press-key: 'ArrowRight'
27-
assert-text: ("title", "Introduction - all-summary")
27+
wait-for-text: ("title", "Introduction - all-summary")
2828

2929
press-key: 'ArrowRight'
30-
assert-text: ("title", "P1 C1 - all-summary")
30+
wait-for-text: ("title", "P1 C1 - all-summary")
3131

3232
press-key: 'ArrowRight'
33-
assert-text: ("title", "P2 C1 - all-summary")
33+
wait-for-text: ("title", "P2 C1 - all-summary")
3434

3535
press-key: 'ArrowRight'
36-
assert-text: ("title", "Suffix 1 - all-summary")
36+
wait-for-text: ("title", "Suffix 1 - all-summary")
3737

3838
press-key: 'ArrowRight'
39-
assert-text: ("title", "Suffix 2 - all-summary")
39+
wait-for-text: ("title", "Suffix 2 - all-summary")
4040

4141
// Try to go beyond the last page
4242
press-key: 'ArrowRight'
43-
assert-text: ("title", "Suffix 2 - all-summary")
43+
wait-for-text: ("title", "Suffix 2 - all-summary")

tests/gui/sidebar-scroll.goml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ assert-property: (".sidebar-scrollbox", {"scrollTop": 0})
77

88
click: ".chapter a[href='chapter_2.html']"
99
assert-text: ("title", "Chapter 2 - sidebar-scroll")
10-
assert-property: (".sidebar-scrollbox", {"scrollTop": 0})
10+
wait-for-property: (".sidebar-scrollbox", {"scrollTop": 0})
1111

1212
click: ".chapter a[href='chapter_10.html']"
1313
assert-text: ("title", "Chapter 10 - sidebar-scroll")
14-
assert-property: (".sidebar-scrollbox", {"scrollTop": 0})
14+
wait-for-property: (".sidebar-scrollbox", {"scrollTop": 0})
1515

1616
// Check that heading nav of chapter 10 pushes 11 off the bottom.
1717
store-position: (".chapter a[href='chapter_11.html']", {"y": chapter_y})
@@ -21,7 +21,7 @@ assert: |chapter_y| > |windowHeight|
2121
// in position since there are only a few lines above.
2222
click: ".chapter a[href='chapter_11.html']"
2323
assert-text: ("title", "Chapter 11 - sidebar-scroll")
24-
assert-property: (".sidebar-scrollbox", {"scrollTop": 0})
24+
wait-for-property: (".sidebar-scrollbox", {"scrollTop": 0})
2525

2626
// Scroll down a little, and click on a chapter that can stay in place when
2727
// clicked.
@@ -30,11 +30,12 @@ store-property: (".sidebar-scrollbox", {"scrollTop": sidebarScrollTop})
3030
assert: |sidebarScrollTop| > 0
3131
click: ".chapter a[href='chapter_35.html']"
3232
assert-text: ("title", "Chapter 35 - sidebar-scroll")
33-
assert-property: (".sidebar-scrollbox", {"scrollTop": |sidebarScrollTop|})
33+
wait-for-property: (".sidebar-scrollbox", {"scrollTop": |sidebarScrollTop|})
3434

3535
// Go to the next chapter, and verify that it scrolls to the middle.
3636
press-key: "ArrowRight"
3737
assert-text: ("title", "Chapter 36 - sidebar-scroll")
38+
wait-for: ".chapter a.active"
3839
// The active link should be roughly in the middle of the screen.
3940
store-position: (".chapter a.active", {"y": active_y})
4041
// Approximate check just in case the browser has slight rendering differences.
@@ -45,7 +46,7 @@ assert: |active_y| < 450
4546
store-property: (".sidebar-scrollbox", {"scrollTop": sidebarScrollTop})
4647
click: ".chapter a[href='chapter_24.html']"
4748
assert-text: ("title", "Chapter 24 - sidebar-scroll")
48-
assert-property: (".sidebar-scrollbox", {"scrollTop": |sidebarScrollTop|})
49+
wait-for-property: (".sidebar-scrollbox", {"scrollTop": |sidebarScrollTop|})
4950

5051
// Go to the last chapter, and verify it is scrolled to the bottom.
5152
go-to: |DOC_PATH| + "sidebar-scroll/chapter_100.html"
@@ -57,9 +58,9 @@ assert: |scrollTop| >= |scrollHeight| - |clientHeight| - 1
5758
store-property: (".sidebar-scrollbox", {"scrollTop": sidebarScrollTop})
5859
click: ".chapter a[href='chapter_97.html']"
5960
assert-text: ("title", "Chapter 97 - sidebar-scroll")
60-
assert-property: (".sidebar-scrollbox", {"scrollTop": |sidebarScrollTop|})
61+
wait-for-property: (".sidebar-scrollbox", {"scrollTop": |sidebarScrollTop|})
6162

6263
store-property: (".sidebar-scrollbox", {"scrollTop": sidebarScrollTop})
6364
click: ".chapter a[href='chapter_76.html']"
6465
assert-text: ("title", "Chapter 76 - sidebar-scroll")
65-
assert-property: (".sidebar-scrollbox", {"scrollTop": |sidebarScrollTop|})
66+
wait-for-property: (".sidebar-scrollbox", {"scrollTop": |sidebarScrollTop|})

0 commit comments

Comments
 (0)