Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kristianka committed Jun 18, 2024
1 parent 8bbf955 commit a3604ef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/e2e/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { test, expect } from "@playwright/test";
const url = "http://localhost";

test.describe("Boxdb-app frontend", async () => {
const random = Math.floor(Math.random() * 1000);
// Go to the main page
test.beforeEach(async ({ page }) => {
await page.goto(url);
Expand All @@ -22,12 +21,12 @@ test.describe("Boxdb-app frontend", async () => {
await page.fill('input[id="width"]', "10");
await page.fill('input[id="height"]', "20");
await page.fill('input[id="depth"]', "30");
await page.fill('[data-testid="comment"]', `This is a test box ${random}`);
await page.fill('[data-testid="comment"]', `This is a test box 1`);
await page.click("[data-testid=submitBoxButton]");
});

test("Added box is displayed in the list", async ({ page }) => {
const boxLabel = `This is a test box ${random}`;
const boxLabel = `This is a test box 1`;
const boxLocator = page.locator(`text=${boxLabel}`);
await expect(boxLocator).toHaveCount(1);
});
Expand Down

0 comments on commit a3604ef

Please sign in to comment.