@@ -28,64 +28,67 @@ class DemoTourTest : ShellTestBase() {
2828 // The first page load answers 1.5 s late (debug hook), so the loading skeleton reads on video.
2929 launch(MOCK_A , " tour" , extras = mapOf (" openbot.delay_first_load_ms" to " 1500" ))
3030 check(waitFor(" sign_in_button" , 20_000 ) != null , " demo: no Sign in button" )
31- pause(1_000 )
32- // Native sign-in, then the Custom Tab with the mock's page, followed by hand, each step held.
33- if (! check(signInThroughCustomTab(" tour" , shots = false , paceMs = 2_000 ), " demo: signing in did not reach the tabs" )) return
31+ pause(800 )
32+ // Native sign-in, the Custom Tab with the mock's page followed by hand, each step held.
33+ if (! check(signInThroughCustomTab(" tour" , shots = false , paceMs = 1_500 ), " demo: signing in did not reach the tabs" )) return
3434 check(waitPageText(" Start a conversation" , 30_000 ), " demo: Home did not render" )
35- pause(2_000 )
35+ pause(1_500 )
3636
3737 // The software keyboard: the bottom bar hides, the message box sits on the keyboard.
38- val box = waitComposerRect(10_000 )
39- if (box != null ) {
38+ waitComposerRect(10_000 )?.let { box ->
4039 tapComposer(box)
41- if (waitKeyboard(true , 8_000 )) {
42- pause(800 )
43- shell(" input text What%schanged%sin%scompetitor%spricing?" )
44- pause(2_000 )
40+ if (waitKeyboard(true , 6_000 )) {
41+ pause(500 )
42+ typeOnKeyboard(" what changed in pricing" )
43+ val typed = pageString(" document.activeElement ? (document.activeElement.innerText || document.activeElement.value || '') : ''" )
44+ note(" demo: the message box holds ${typed.length} characters after typing" )
45+ pause(1_200 )
46+ screenshot(" home-keyboard-typed" )
4547 device.pressBack()
4648 waitKeyboard(false , 4_000 )
4749 } else {
4850 note(" demo: the software keyboard did not show" )
4951 }
5052 }
51- pause(1_500 )
53+ pause(800 )
5254
53- // Conversations: scroll, open one, system Back.
55+ // Conversations: open one, system Back.
5456 tab(Tab .CONVERSATIONS )?.click()
55- check(waitPageText(" Competitor pricing notes" , 20_000 ), " demo: no conversations" )
57+ check(waitPageText(" Competitor pricing notes" , 15_000 ), " demo: no conversations" )
5658 pause(1_200 )
57- find(" openbot_webview" )?.swipe(Direction .UP , 0.6f )
58- pause(800 )
59- find(" openbot_webview" )?.swipe(Direction .DOWN , 0.6f )
60- pause(1_000 )
6159 tapWeb(" Competitor pricing notes" )
62- check(waitPageText(" What do our three closest competitors charge?" , 20_000 ) || waitPageText(" per-seat" , 2_000 ), " demo: the conversation did not open" )
63- pause(2_000 )
60+ check(waitPageText(" What do our three closest competitors charge?" , 15_000 ) || waitPageText(" per-seat" , 1_000 ), " demo: the conversation did not open" )
61+ pause(1_800 )
62+ if (keyboardShown()) screenshot(" conversation-keyboard-still" )
6463 dismissKeyboardIfUp()
65- pause(1_200 )
64+ pause(600 )
6665 device.pressBack()
6766 check(waitPageText(" Quarterly forecast" , 8_000 ), " demo: system Back did not return to the list" )
68- pause(1_500 )
67+ pause(1_200 )
6968
7069 // Bots: open one.
7170 tab(Tab .BOTS )?.click()
72- tapWeb(" Research Bot" , 20_000 )
73- pause(2_500 )
71+ check(waitPageText(" Research Bot" , 15_000 ), " demo: no Bots" )
72+ pause(800 )
73+ sleep(1_500 )
74+ screenshot(" bots-still" )
75+ tapWeb(" Research Bot" )
76+ pause(2_000 )
7477 dismissKeyboardIfUp()
7578
7679 // Home, the Account menu, Sign out: the native sign-in screen.
7780 tab(Tab .HOME )?.click()
81+ pause(1_200 )
82+ check(tapWeb(" Account" ), " demo: no Account button" )
83+ pause(1_200 )
84+ check(tapWeb(" Sign out" ), " demo: no Sign out in the Account menu" )
85+ check(waitFor(" sign_in_button" , 15_000 ) != null , " demo: Sign out did not return to the native sign-in" )
7886 pause(1_500 )
79- (device.findObject(By .desc(" Account" )) ? : waitWebObject(" Account" , 10_000 ))?.click()
80- pause(1_500 )
81- tapWeb(" Sign out" )
82- check(waitFor(" sign_in_button" , 20_000 ) != null , " demo: Sign out did not return to the native sign-in" )
83- pause(2_000 )
8487
8588 // The lock screen, then the connection comes back.
86- launch(MOCK_A , " tour-offline" , reset = false , extras = mapOf (" openbot.force_offline_seconds" to " 5 " ))
89+ launch(MOCK_A , " tour-offline" , reset = false , extras = mapOf (" openbot.force_offline_seconds" to " 4 " ))
8790 check(waitFor(" offline_lock" , 5_000 ) != null , " demo: no lock screen" )
88- check(waitGone(" offline_lock" , 15_000 ), " demo: the lock did not lift" )
89- pause(2_000 )
91+ check(waitGone(" offline_lock" , 12_000 ), " demo: the lock did not lift" )
92+ pause(1_500 )
9093 }
9194}
0 commit comments