Skip to content

Commit 4ee8c19

Browse files
committed
updated tests to match backend sql script
1 parent 8a9df51 commit 4ee8c19

2 files changed

Lines changed: 9 additions & 22 deletions

File tree

client/tests/e2e/1-user-account/1.2-create-register.spec.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,8 @@ test.describe("1.1.2 User Accounts - CREATE Register", () => {
166166
await expect(anyValidationMessage.first()).toBeVisible();
167167
});
168168

169+
//createtests as username
169170
test("C Server error on register (simulated)", async ({ page }) => {
170-
await page.route("**/useraccount/register", async (route) => {
171-
const req = route.request();
172-
if (req.method() !== "POST") return route.fallback();
173-
174-
return route.fulfill({
175-
status: 500,
176-
body: JSON.stringify({ message: "Internal Server Error" }),
177-
headers: { "Content-Type": "application/json" },
178-
});
179-
});
180-
181171
const {
182172
institutionSelect,
183173
username,
@@ -191,19 +181,18 @@ test.describe("1.1.2 User Accounts - CREATE Register", () => {
191181
successAlert,
192182
errorAlert,
193183
} = await setupRegisterPage(page);
184+
const uname = "createtests";
194185

195186
await selectVuetifyOptionByName(page, institutionSelect, "ETH Zürich");
196187

197-
const uname = `playwright-error-${Date.now()}`;
198188
await username.fill(uname);
199-
await name.fill("Server");
200-
await surname.fill("Error");
201-
await email.fill(`error+${Date.now()}@example.com`);
189+
await name.fill("Andrei");
190+
await surname.fill("Mititelu");
191+
await email.fill(`${uname}@example.com`);
202192

203193
await selectVuetifyFirstOption(page, timezoneSelect);
204-
205-
await password.fill("ValidPass123!");
206-
await confirmPassword.fill("ValidPass123!");
194+
await password.fill("StrongPass123!");
195+
await confirmPassword.fill("StrongPass123!");
207196

208197
await submitButton.click();
209198

client/tests/e2e/1-user-account/2.1-read-login.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { test, expect, Page } from "@playwright/test";
22

3-
//TODO change to whatever we chose to add in DB script via FLYWAY
4-
const correctUser = "playwright";
5-
const correctPass = "playwright";
3+
const correctUser = "testmain";
4+
const correctPass = "testmain";
65
const wrongUser = "invalid@example.cdasdpef";
76
const wrongPass = "wrong-passworddddddddddddddd";
87

9-
// Setup method for page (this, unlike register test, does NOT use test id's)
108
async function setupLoginPage(page: Page) {
119
await page.addInitScript(() => {
1210
localStorage.clear();

0 commit comments

Comments
 (0)