clean up e2e tests

This commit is contained in:
Simon Larsen 2023-05-16 12:19:59 +01:00
parent 193508c0c7
commit fb3153cf2e
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
2 changed files with 6 additions and 9 deletions

View File

@ -1,4 +1,4 @@
import { test, expect, ElementHandle, Page } from '@playwright/test';
import { test, expect, Page } from '@playwright/test';
import BASE_URL from '../../Utils/BaseURL';
@ -6,11 +6,8 @@ test.beforeEach(async ({ page }: { page: Page }) => {
await page.goto(BASE_URL);
});
test('sign up button', async ({ page }: { page: Page }) => {
const signUpButton: ElementHandle<Element> | null = await page.$(
"[data-testid='Sign-up']"
);
if (signUpButton) {
await signUpButton.click();
await expect(page).toHaveURL(/.*accounts\/register/);
}
await page.getByTestId("Sign-up").click();
await expect(page).toHaveURL(BASE_URL+"/accounts/register");
});

View File

@ -1,4 +1,4 @@
const BASE_URL: string =
process.env['BASE_URL' as keyof typeof process.env] || 'http://localhost/';
process.env['BASE_URL' as keyof typeof process.env] || 'http://localhost';
export default BASE_URL;