Bug 1856942: part 5) Factor async loading of a sheet out of `Loader::LoadSheet`....
[gecko.git] / testing / performance / perftest_facebook.js
blobbd607d6be474fe2033b2d40bbe5176936a755e47
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 async function test(context, commands) {
6   await commands.navigate("https://www.example.com");
7   await commands.wait.byTime(15000);
9   // Fill in:
10   let username = "some_user@mail.com";
11   let passworld = "topsecretpassword";
13   // We start by navigating to the login page.
14   await commands.navigate("https://www.facebook.com");
16   // When we fill in a input field/click on a link we wanna
17   // try/catch that if the HTML on the page changes in the feature
18   // sitespeed.io will automatically log the error in a user friendly
19   // way, and the error will be re-thrown so you can act on it.
20   await commands.wait.byTime(5000);
22   // Add text into an input field, finding the field by id
23   await commands.addText.bySelector(username, "input[name=email]");
24   await commands.wait.byTime(2000);
25   await commands.addText.bySelector(passworld, "input[name=pass]");
26   await commands.wait.byTime(2000);
28   // Start the measurement before we click on the
29   // submit button. Sitespeed.io will start the video recording
30   // and prepare everything.
31   // Find the sumbit button and click it and then wait
32   // for the pageCompleteCheck to finish
33   await commands.measure.start("pageload");
35   // There are two variants of the facebook login page:
36   try {
37     await commands.click.bySelectorAndWait("button[name=login]");
38   } catch (e) {
39     await commands.click.bySelectorAndWait("input[type=submit]");
40   }
42   // Stop and collect the measurement before the next page we want to measure
43   await commands.measure.stop();
46 module.exports = {
47   test,
48   owner: "Performance Team",
49   name: "Facebook",
50   description: "Measures time to log in to Facebook",