From f2edc4dc6a7a97d367b0349a5a6e005f2118cc8f Mon Sep 17 00:00:00 2001 From: Marc Date: Sun, 20 Nov 2022 14:01:48 -0800 Subject: [PATCH] added for loops for multiple tests --- source/assets/scripts/main.e2e.test.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/source/assets/scripts/main.e2e.test.js b/source/assets/scripts/main.e2e.test.js index 339e93d..85ac54f 100644 --- a/source/assets/scripts/main.e2e.test.js +++ b/source/assets/scripts/main.e2e.test.js @@ -40,11 +40,8 @@ describe("test App end to end", async () => { describe("test CRUD on simple inputs and default image", () => { describe("test create 10 new reviews", async () => { - for (var i=0; i < 10; i++) { - it("create 1 new review", async () => { - // Click the button to create a new review let create_btn = await page.$("#create-btn"); await create_btn.click(); @@ -103,15 +100,11 @@ describe("test App end to end", async () => { } await checkCorrectness(shadowRoot, "a", expected); }); - } - }); describe("test read 10 reviews after refresh", async () => { - for (var i=0; i < 10; i++) { - it("refresh page", async () => { // Reload the page await page.reload({ waitUntil: ["networkidle0", "domcontentloaded"] }); @@ -158,17 +151,12 @@ describe("test App end to end", async () => { } await checkCorrectness(shadowRoot, "a", expected); }); - } - }); describe("test update 10 reviews", async () => { - for (var i=0; i < 10; i++) { - it("update 1 review", async () => { - // Get the only review card and click it let review_card = await page.$("review-card"); await review_card.click(); @@ -231,15 +219,11 @@ describe("test App end to end", async () => { } await checkCorrectness(shadowRoot, "a", expected); }); - } - }); describe("test delete 10 reviews", async () => { - for (var i=0; i < 10; i++) { - it("delete 1 review", async () => { // Get the only review card and click it let review_card = await page.$("review-card"); @@ -260,10 +244,8 @@ describe("test App end to end", async () => { review_card = await page.$("#review-card"); assert.strictEqual(review_card, null); }); - } }); - }); after(async () => {