Skip to content

Commit

Permalink
sync tests to description.
Browse files Browse the repository at this point in the history
  • Loading branch information
issackjohn committed Jul 7, 2023
1 parent e978553 commit 16516a9
Showing 1 changed file with 9 additions and 186 deletions.
195 changes: 9 additions & 186 deletions resources/tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,7 @@ Suites.enable = function (names, tags) {

Suites.push({
name: "TodoMVC-JavaScript-ES5",
url: "todomvc/vanilla-examples/javascript-es5/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
(await page.waitForElement(".new-todo")).focus();
},
tests: [
new BenchmarkTestStep(`Adding${numberOfItemsToAdd}Items`, (page) => {
const newTodo = page.querySelector(".new-todo");
for (let i = 0; i < numberOfItemsToAdd; i++) {
newTodo.setValue(todos.en[i] ?? `${defaultTodoText.en} ${i}`);
newTodo.dispatchEvent("change");
newTodo.enter("keypress");
}
}),
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-JavaScript-ES5-Complex-DOM",
url: "todomvc/vanilla-examples/javascript-es5/complex/dist/index.html",
url: "todomvc/vanilla-examples/javascript-es5/standalone/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
(await page.waitForElement(".new-todo")).focus();
Expand Down Expand Up @@ -139,37 +110,7 @@ Suites.push({

Suites.push({
name: "TodoMVC-JavaScript-ES6-Complex-DOM",
url: "todomvc/vanilla-examples/javascript-es6/complex/dist/index.html",
tags: ["todomvc"],
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(todos.en[i] ?? `${defaultTodoText.en} ${i}`);
newTodo.dispatchEvent("change");
newTodo.enter("keypress");
}
}),
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-JavaScript-ES6-Webpack",
url: "todomvc/vanilla-examples/javascript-es6-webpack/dist/index.html",
url: "todomvc/vanilla-examples/javascript-es6-complex/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
const element = await page.waitForElement(".new-todo");
Expand Down Expand Up @@ -322,36 +263,7 @@ Suites.push({

Suites.push({
name: "TodoMVC-React-Redux",
url: "todomvc/architecture-examples/react-redux/dist/index.html",
tags: ["todomvc"],
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(todos.en[i] ?? `${defaultTodoText.en} ${i}`);
newTodo.enter("keydown");
}
}),
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-React-Redux-Complex-DOM",
url: "todomvc/architecture-examples/react-redux/complex/dist/index.html",
url: "todomvc/architecture-examples/react-redux/standalone/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
const element = await page.waitForElement(".new-todo");
Expand Down Expand Up @@ -380,38 +292,7 @@ Suites.push({

Suites.push({
name: "TodoMVC-Backbone",
url: "todomvc/architecture-examples/backbone/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
await page.waitForElement("#appIsReady");
const newTodo = page.querySelector(".new-todo");
newTodo.focus();
},
tests: [
new BenchmarkTestStep(`Adding${numberOfItemsToAdd}Items`, (page) => {
const newTodo = page.querySelector(".new-todo");
for (let i = 0; i < numberOfItemsToAdd; i++) {
newTodo.setValue(todos.en[i] ?? `${defaultTodoText.en} ${i}`);
newTodo.dispatchEvent("change");
newTodo.enter("keypress");
}
}),
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-Backbone-Complex-DOM",
url: "todomvc/architecture-examples/backbone/complex/dist/index.html",
url: "todomvc/architecture-examples/backbone/standalone/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
await page.waitForElement("#appIsReady");
Expand Down Expand Up @@ -472,7 +353,7 @@ Suites.push({

Suites.push({
name: "TodoMVC-Angular-Complex-DOM",
url: "todomvc/architecture-examples/angular/projects/complex/dist/index.html",
url: "todomvc/architecture-examples/angular-complex/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
const element = await page.waitForElement(".new-todo");
Expand Down Expand Up @@ -532,7 +413,7 @@ Suites.push({

Suites.push({
name: "TodoMVC-Vue-Complex-DOM",
url: "todomvc/architecture-examples/vue/complex/dist/index.html",
url: "todomvc/architecture-examples/vue-complex/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
const element = await page.waitForElement(".new-todo");
Expand Down Expand Up @@ -591,7 +472,7 @@ Suites.push({

Suites.push({
name: "TodoMVC-jQuery-Complex-DOM",
url: "todomvc/architecture-examples/jquery/complex/dist/index.html",
url: "todomvc/architecture-examples/jquery-complex/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
await page.waitForElement("#appIsReady");
Expand All @@ -618,67 +499,9 @@ Suites.push({
],
});

Suites.push({
name: "TodoMVC-Preact",
url: "todomvc/architecture-examples/preact/dist/index.html#/home",
tags: ["todomvc"],
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(todos.en[i] ?? `${defaultTodoText.en} ${i}`);
newTodo.enter("keydown");
}
}),
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-Preact-Complex-DOM",
url: "todomvc/architecture-examples/preact/complex/dist/index.html#/home",
tags: ["todomvc"],
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(todos.en[i] ?? `${defaultTodoText.en} ${i}`);
newTodo.enter("keydown");
}
}),
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-Svelte",
url: "todomvc/architecture-examples/svelte/dist/index.html",
url: "todomvc/architecture-examples/preact-complex/dist/index.html#/home",
tags: ["todomvc"],
async prepare(page) {
const element = await page.waitForElement(".new-todo");
Expand Down Expand Up @@ -707,7 +530,7 @@ Suites.push({

Suites.push({
name: "TodoMVC-Svelte-Complex-DOM",
url: "todomvc/architecture-examples/svelte/complex/dist/index.html",
url: "todomvc/architecture-examples/svelte-complex/dist/index.html",
tags: ["todomvc"],
async prepare(page) {
const element = await page.waitForElement(".new-todo");
Expand Down

0 comments on commit 16516a9

Please sign in to comment.