From 3d2f4874d6ab9ed46bee271988f7fe8a0eb4e97c Mon Sep 17 00:00:00 2001 From: Lingyun Cai Date: Tue, 19 Nov 2024 15:05:13 +0800 Subject: [PATCH] Tweak NewsSite test step scenarios --- resources/tests.mjs | 96 ++++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 36 deletions(-) diff --git a/resources/tests.mjs b/resources/tests.mjs index 66eabae11..648efbbf4 100644 --- a/resources/tests.mjs +++ b/resources/tests.mjs @@ -862,32 +862,44 @@ Suites.push({ }, tests: [ new BenchmarkTestStep("NavigateToUS", (page) => { - for (let i = 0; i < 25; i++) { - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - } + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-navlist-opinion-link").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); page.querySelector("#navbar-navlist-us-link").click(); page.layout(); }), new BenchmarkTestStep("NavigateToWorld", (page) => { - for (let i = 0; i < 25; i++) { - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - } + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-navlist-opinion-link").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); page.querySelector("#navbar-navlist-world-link").click(); page.layout(); }), new BenchmarkTestStep("NavigateToPolitics", (page) => { - for (let i = 0; i < 25; i++) { - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - } + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-navlist-opinion-link").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); page.querySelector("#navbar-navlist-politics-link").click(); page.layout(); }), @@ -903,32 +915,44 @@ Suites.push({ }, tests: [ new BenchmarkTestStep("NavigateToUS", (page) => { - for (let i = 0; i < 25; i++) { - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - } + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-navlist-opinion-link").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); page.querySelector("#navbar-navlist-us-link").click(); page.layout(); }), new BenchmarkTestStep("NavigateToWorld", (page) => { - for (let i = 0; i < 25; i++) { - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - } + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-navlist-opinion-link").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); page.querySelector("#navbar-navlist-world-link").click(); page.layout(); }), new BenchmarkTestStep("NavigateToPolitics", (page) => { - for (let i = 0; i < 25; i++) { - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - page.querySelector("#navbar-dropdown-toggle").click(); - page.layout(); - } + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-navlist-opinion-link").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); + page.querySelector("#navbar-dropdown-toggle").click(); + page.layout(); page.querySelector("#navbar-navlist-politics-link").click(); page.layout(); }),