From 68f74a2ae18a5db91532161ed20bd97c5a27feba Mon Sep 17 00:00:00 2001 From: issack john Date: Thu, 13 Jul 2023 11:37:04 -0700 Subject: [PATCH] add and update test suites --- resources/tests.mjs | 78 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 9 deletions(-) diff --git a/resources/tests.mjs b/resources/tests.mjs index 3ea3ba174..0aac62c48 100644 --- a/resources/tests.mjs +++ b/resources/tests.mjs @@ -87,9 +87,9 @@ Suites.push({ }); Suites.push({ - name: "TodoMVC-JavaScript-ES6-Webpack", - url: "todomvc/vanilla-examples/javascript-es6-webpack/dist/index.html", - tags: ["todomvc"], + name: "TodoMVC-JavaScript-ES6-Webpack-Complex-DOM", + url: "todomvc/vanilla-examples/javascript-es6-webpack-complex/dist/index.html", + tags: ["todomvc", "complex"], async prepare(page) { const element = await page.waitForElement(".new-todo"); element.focus(); @@ -299,6 +299,36 @@ Suites.push({ ], }); +Suites.push({ + name: "TodoMVC-Angular-Complex-DOM", + url: "todomvc/architecture-examples/angular-complex/dist/index.html", + tags: ["todomvc", "complex"], + async prepare(page) { + const element = await page.waitForElement(".new-todo"); + element.focus(); + }, + tests: [ + new BenchmarkTestStep(`Adding${numberOfItemsToAdd}Items`, (page) => { + const newTodo = page.querySelector(".new-todo"); + for (let i = 0; i < numberOfItemsToAdd; i++) { + newTodo.setValue(getTodoText(defaultLanguage, i)); + newTodo.dispatchEvent("input"); + newTodo.enter("keyup"); + } + }), + new BenchmarkTestStep("CompletingAllItems", (page) => { + const checkboxes = page.querySelectorAll(".toggle"); + for (let i = 0; i < numberOfItemsToAdd; i++) + checkboxes[i].click(); + }), + new BenchmarkTestStep("DeletingAllItems", (page) => { + const deleteButtons = page.querySelectorAll(".destroy"); + for (let i = numberOfItemsToAdd - 1; i >= 0; i--) + deleteButtons[i].click(); + }), + ], +}); + Suites.push({ name: "TodoMVC-Vue", url: "todomvc/architecture-examples/vue/dist/index.html", @@ -329,6 +359,36 @@ Suites.push({ ], }); +Suites.push({ + name: "TodoMVC-Vue-Complex-DOM", + url: "todomvc/architecture-examples/vue-complex/dist/index.html", + tags: ["todomvc", "complex"], + async prepare(page) { + const element = await page.waitForElement(".new-todo"); + element.focus(); + }, + tests: [ + new BenchmarkTestStep(`Adding${numberOfItemsToAdd}Items`, (page) => { + const newTodo = page.querySelector(".new-todo"); + for (let i = 0; i < numberOfItemsToAdd; i++) { + newTodo.setValue(getTodoText(defaultLanguage, i)); + newTodo.dispatchEvent("input"); + newTodo.enter("keyup"); + } + }), + new BenchmarkTestStep("CompletingAllItems", (page) => { + const checkboxes = page.querySelectorAll(".toggle"); + for (let i = 0; i < numberOfItemsToAdd; i++) + checkboxes[i].click(); + }), + new BenchmarkTestStep("DeletingAllItems", (page) => { + const deleteButtons = page.querySelectorAll(".destroy"); + for (let i = numberOfItemsToAdd - 1; i >= 0; i--) + deleteButtons[i].click(); + }), + ], +}); + Suites.push({ name: "TodoMVC-jQuery", url: "todomvc/architecture-examples/jquery/dist/index.html", @@ -359,9 +419,9 @@ Suites.push({ }); Suites.push({ - name: "TodoMVC-Preact", - url: "todomvc/architecture-examples/preact/dist/index.html#/home", - tags: ["todomvc"], + name: "TodoMVC-Preact-Complex-DOM", + url: "todomvc/architecture-examples/preact-complex/dist/index.html#/home", + tags: ["todomvc", "complex"], async prepare(page) { const element = await page.waitForElement(".new-todo"); element.focus(); @@ -388,9 +448,9 @@ Suites.push({ }); Suites.push({ - name: "TodoMVC-Svelte", - url: "todomvc/architecture-examples/svelte/dist/index.html", - tags: ["todomvc"], + name: "TodoMVC-Svelte-Complex-DOM", + url: "todomvc/architecture-examples/svelte-complex/dist/index.html", + tags: ["todomvc", "complex"], async prepare(page) { const element = await page.waitForElement(".new-todo"); element.focus();