-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathphantomas.node_cli.txt
163 lines (133 loc) · 8.74 KB
/
phantomas.node_cli.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
┏━━━━━━━━━━━━━━━┓
┃ PHANTOMAS ┃
┗━━━━━━━━━━━━━━━┛
phantomas URL #Command line 1.4.0
#Opens URL phantomjs|slimerjs and do some performance testing.
PHANTOMAS(URL[, OBJ], #Same as Node module. OBJ are options (without dash).
FUNC(ERROR, OBJ2, OBJ3)) #OBJ2:
# - url URL
# - metrics:
# - METRIC: NUM
# - offenders (more in-depth on some metrics):
# - METRIC STR_ARR (URL + explanatory message)
# - asserts OBJ (when using assert-METRIC=THRESHOLD, false otherwise):
# - rules OBJ:
# - METRIC: THRESHOLD ...
# - failedCount NUM
# - failedAsserts METRIC_STR_ARR
#OBJ3:
# - setMetric(METRIC_STR, VAL)
# - getMetric(METRIC_STR)
# - getMetrics() -> OBJ
# - getMetricsNames() -> METRIC_STR_ARR
# - addOffender(METRIC_STR, STR): add a failed asserts
# - getOffenders(METRIC_STR)
# - getAllOffenders() -> OBJ
# - setUrl(URL)
# - getUrl()
# - setAssert(METRIC_STR, VAL)
# - getAssertion(METRIC_STR)
# - getAsserts() -> OBJ
# - hasAssertion(METRIC_STR)
#Returns a PROMISE, with also PROCESS members stdout|err and pid
--reporter=FORMAT[:ARGS[:...]]#Same output as OBJ2 above.
#FORMAT:
# - csv: noheader, timestamp (add as first col), url (as first|second col): only OBJ2.metrics
# - json: pretty
# - tap: no-skip (don’t print skipped METRIC)
# - plain (déf): no-color
# - statsd
# - elasticsearch
--screenshot=FILE #Renders page
--film-strip #Renders page at regular interval.
#Use also --film-strip-dir=DIR (def: "./filmstrip") and --film-strip-prefix (def: "screenshot")
--har=FILE #HAR file
--page-source #Saves page source in --page-source-dir=DIR (def: "./html")
--assert-METRIC=VAL #Emits error if METRIC > VAL
--[skip-]modules=MODULE... #Select tests to perform
--include-dirs=DIR... #Custom modules
--engine=webkit|gecko #
--viewport=WIDTHxHEIGHT #Def: 1280x1024
--user-agent=STR #
--phone|tablet #Modifies viewport+user agent
--cookies="VAR=VAL;..." #
--cookies-file=FILE #
--auth-user|pass=STR #
--disable-js #
--no-externals #Block request to 3rd parties
--allow|block-domains=STR... #
--ignore-ssl-errors #
--wait-for-selector=CSS_SLCTOR#Only starts when CSS_SELECTOR is true
--post-load-delay=NUM #Waits NUM seconds before generating report.
--timeout=NUM #Def 15s
--runs NUM #Runs several times (only with --reporter=plain|json)
#OBJ2 becomes:
# - run OBJ2_ARR
# - stats:
# - METRIC: min, max, average, median, stddev
--silent|verbose #
--progress #
--log=FILE #
--colors #Force colors even when output is piped
--proxy=HOST:PORT #
--proxy-auth=USERNAME:PASSWORD#
--proxy-type="http|socks5|
none" #
LIST OF METRIC ==> #ms for time, bytes for size
[gzip|post|https]requests #Total number of HTTP [or only gzipped ones, POST or HTTPS] requests made
notFound #Number of HTTP 404 responses
timeToFirst|LastByte #Time it took to receive the first|last byte of the first response (that was not a redirect)
timeToFirstCss|Js|Image #Time it took to receive the last byte of the first CSS|JS|image
httpTrafficCompleted #Time it took to receive the last byte of the last HTTP response AJAX requests
ajaxRequests #Number of AJAX requests
contentLength #Size of the content of all responses (based on Content-Length header)
html|css|js|json|image|
webfont|base64|otherCount #Number of responses of that type
cacheHits|Misses|Passes #Number of cache hits|misses|passes
headers[Sent|Recv]Count|Size #Number|size of requests and responses headers
headersBiggerThanContent #Number of responses with headers part bigger than the response body
domains #Number of domains used to fetch the page
max|medianRequestsPerDomain #Max|median number of requests fetched from a single domain
cookiesSent|Recv #Length of cookies sent in HTTP requests|responses
domainsWithCookies #Number of domains with cookies set
documentCookiesLength|Count #Length|number of cookies of document.cookie
localStorageEntries #Number of entries in local storage
globalVariables[Falsy] #Number of JS globals variables [that cast to false]
bodyHTML|comments|
hiddenContent|whiteSpacesSize #The size of <body>, comments, display:none content, text nodes with whitespaces only
DOMelementsCount #Total number of HTML element nodes
DOMelementMaxDepth #Maximum level on nesting of HTML element node
iframesCount #Number of iframe nodes
nodesWithInlineCSS #Number of nodes with inline CSS styling (with style attribute)
imagesWithoutDimensions #Number of <img> nodes without both width and height attribute
DOMqueries[ById|ClassName|
TagName|QuerySelectorAll] #Number of document.getElement*() calls
DOMinserts #Number of DOM nodes inserts
DOMqueriesDuplicated #Number of duplicated DOM queries
eventsBound #Number of EventTarget.addEventListener calls
onDOMReadyTime #Time it took to fire onDOMready event
windowOnLoadTime #Time it took to fire window.load event
timeBackend #Time to the first byte compared to the total loading time (in %)
timeFrontend #Time to window on load compared to the total loading time (in %)
smallest|biggestResponse #The size of the smallest|biggest response (HTTP 200 only)
fastest|slowestResponse #The time to the last byte of the fastest|slowest response (HTTP 200 only)
smallest|biggestLatency #The time to the first byte of the fastest|slowest response (HTTP 200 only)
medianResponse|Latency #Median value of time to the lastfirst byte for all responses
assetsNotGzipped #Static assets that were not gzipped
assetsWithQueryString #Static assets requested with query string (e.g. ?foo) in URL
assetsWithCookies #Number of static assets requested from domains with cookie set
multipleRequests #Number of static assets that are requested more than once
cachingNotSpecified #Responses with no caching header sent (either Cache-Control or Expires)
cachingTooShort #Responses with too short (less than a week) caching time
cachingDisabled #Responses with caching disabled (max-age=0)
oldCachingHeaders #Responses with old, HTTP 1.0 caching headers (Expires and Pragma)
redirects #Number of HTTP redirects (either 301, 302 or 303)
redirectsTime #Time it took to send and receive redirects
consoleMessages #Number of calls to console.* functions
jsErrors #Number of JavaScript errors
documentWriteCalls #Number of calls to either document.write or document.writeln
evalCalls #Number of calls to eval (either direct or via setTimeout / setInterval)
windowAlerts|Confirms|Prompts #Number of calls to alert|confirm|prompt
statusCodesTrail #Comma-separated list of HTTP status codes that main request followed through
#(could contain a single element if the main request is a terminal one)
blockedRequests #3rd party requests blocked by --no-external or --block-domain