-
Notifications
You must be signed in to change notification settings - Fork 0
/
simulate_user_flow.txt
33 lines (24 loc) · 1.09 KB
/
simulate_user_flow.txt
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
// Script used to simulate user flow on webpagetest.org
// Index -> Settings -> Login -> Index -> Search "Buxtehude" -> Add -> Buxtehude -> 2nd Card
// setup: wait until service worker is activated, if on page with app shell
logData 0
waitFor (navigator.serviceWorker.controller?.state === 'activated')
navigate %URL%
waitFor
logData 1
setEventName Home
navigate %URL%
setEventName Settings
execAndWait document.querySelector('.nav-link[href="/settings"]').click()
setEventName Login
execAndWait document.querySelector('form[action="/login"]').requestSubmit()
setEventName ReturnHome
execAndWait document.querySelector('.nav-link[href="/"]').click()
setEventName Search
execAndWait (document.querySelector('[name="location"]').value='Buxtehude') && document.querySelector('[name="location"]').dispatchEvent(new Event('input'))
setEventName Add
execAndWait document.querySelector('form[action="/locations"]').requestSubmit()
setEventName Detail
execAndWait document.querySelector('a.city-name').click()
setEventName Sighting
execAndWait document.querySelector('form.sighting:not(:first-child)').requestSubmit()