From 79f24afa03066e670c9c8e4d87d728ab639f0789 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Tue, 18 Apr 2023 19:21:24 +0200 Subject: [PATCH] docs: fix wpt plugin --- docs/documentation/sitespeed.io/webpagetest/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/documentation/sitespeed.io/webpagetest/index.md b/docs/documentation/sitespeed.io/webpagetest/index.md index 42b260c18..a593f0f91 100644 --- a/docs/documentation/sitespeed.io/webpagetest/index.md +++ b/docs/documentation/sitespeed.io/webpagetest/index.md @@ -42,7 +42,7 @@ If you need anything else adding your own CLI parameter will propagate to the We Example: So say that you want to change the user agent of your test. In the API you can do that with --useragent. Pass the same to sitespeed.io by prefixing webpagetest like so --webpagetest.useragent in the cli. ~~~bash -docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest --webpagetest.host my.wpt.host.com --webpagetest.useragent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36" https://www.sitespeed.io +docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest/index.js --webpagetest.host my.wpt.host.com --webpagetest.useragent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36" https://www.sitespeed.io ~~~ ## Default configurations @@ -86,7 +86,7 @@ navigate news.aol.com/world Then change your URL you want test (probably the last one) to \{\{\{URL\}\}\} and then all occurrences of \{\{\{URL\}\}\} will then be replaced with the current URL that should be tested. Now run sitespeed.io with the additional parameters: ~~~bash -docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest --webpagetest.file /sitespeed.io/wptScript.txt --webpagetest.host my.wpt.host.com http://example.org +docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest/index.js --webpagetest.file /sitespeed.io/wptScript.txt --webpagetest.host my.wpt.host.com http://example.org ~~~ It is also possible to pass the WebPageTest script as a string into the `--webpagetest.script` flag. You can use the `scriptToString()` method provided in [webpagetest-api](https://github.com/marcelduran/webpagetest-api/#module-1) to create a string from a JSON object. @@ -94,7 +94,7 @@ It is also possible to pass the WebPageTest script as a string into the `--webpa {% assign bashURLString = '{{{URL}}}}' %} ~~~bash -docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest --webpagetest.script "navigate \t www.aol.com \n navigate \t {{bashURLString}}" --webpagetest.host my.wpt.host.com http://example.org +docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest/index.js --webpagetest.script "navigate \t www.aol.com \n navigate \t {{bashURLString}}" --webpagetest.host my.wpt.host.com http://example.org ~~~ ### Custom metrics @@ -123,7 +123,7 @@ return viewport; You can then run sitespeed.io to pick up the new custom metrics: ~~~bash -docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest --webpagetest.custom /sitespeed.io/myScriptFile.txt --webpagetest.host my.wpt.host.com https://www.sitespeed.io +docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest/index.js --webpagetest.custom /sitespeed.io/myScriptFile.txt --webpagetest.host my.wpt.host.com https://www.sitespeed.io ~~~ ## Run WebPageTest without Browsertime @@ -131,5 +131,5 @@ docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include ve Sometimes you want to only collect data from WebPageTest and not from Browsertime. The best way to do that is to disable the Browsertime plugin with *--plugins.remove browsertime* ~~~bash -docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest --webpagetest.host my.wpt.host.com --plugins.remove browsertime https://www.sitespeed.io +docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %}-webpagetest --plugins.add /webpagetest/index.js --webpagetest.host my.wpt.host.com --plugins.remove browsertime https://www.sitespeed.io ~~~