Skip to content

Commit

Permalink
add and update test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
issackjohn committed Sep 8, 2023
1 parent 0672c38 commit 68f74a2
Showing 1 changed file with 69 additions and 9 deletions.
78 changes: 69 additions & 9 deletions resources/tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 68f74a2

Please sign in to comment.