Skip to content

Commit c69d83a

Browse files
committed
test(ui): Add a very simple front page test
Login to the ORT Server UI as an admin, and assert that some elements from the front page are rendered. This works as a crude smoke test for the UI; if something totally breaks the UI, the front page won't even load, and the test will fail. Resolves #3789. Signed-off-by: Jyrki Keisala <jyrki.keisala@doubleopen.org>
1 parent 9f4a9e1 commit c69d83a

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

ui/tests/smoke-test.spec.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (C) 2025 The ORT Server Authors (See <https://github.com/eclipse-apoapsis/ort-server/blob/main/NOTICE>)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* SPDX-License-Identifier: Apache-2.0
17+
* License-Filename: LICENSE
18+
*/
19+
20+
import { expect, test } from '@playwright/test';
21+
22+
test('test', async ({ page }) => {
23+
await page.goto('/');
24+
await expect(
25+
page.getByRole('heading', { name: 'Sign in to your account' })
26+
).toBeVisible();
27+
await page.getByRole('textbox', { name: 'Username or email' }).click();
28+
await page.getByRole('textbox', { name: 'Username or email' }).fill('admin');
29+
await page.getByRole('textbox', { name: 'Username or email' }).press('Tab');
30+
await page.getByRole('textbox', { name: 'Password' }).fill('admin');
31+
await page.getByRole('button', { name: 'Sign In' }).click();
32+
await expect(
33+
page.getByText('Browse your organizations or create a new one')
34+
).toBeVisible();
35+
await expect(
36+
page.getByRole('link', { name: 'Add organization' })
37+
).toBeVisible();
38+
});

0 commit comments

Comments
 (0)