Skip to content

Commit 2b491b7

Browse files
authored
VLM integration via Ollama added (#369)
* VLM integration via Ollama added
1 parent 2184988 commit 2b491b7

41 files changed

Lines changed: 1050 additions & 262 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/playwright.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,22 @@ on:
77

88
jobs:
99
test:
10-
timeout-minutes: 5
10+
timeout-minutes: 10
1111
runs-on: ubuntu-latest
12-
container:
13-
image: mcr.microsoft.com/playwright:v1.38.0-focal
1412
steps:
1513
- uses: actions/checkout@v3
1614

1715
- uses: actions/setup-node@v3
1816
with:
19-
node-version: 18
17+
node-version: 20
2018

2119
- name: Install dependencies
2220
run: npm ci
2321

2422
- name: Run Playwright tests
25-
run: npx playwright test
23+
run: npm run test:pw:docker
2624
env:
27-
VRT_APIURL: "https://visual-regression-tracker.com:4200"
28-
VRT_PROJECT: "VRT"
29-
VRT_ENABLESOFTASSERT: false
30-
VRT_APIKEY: ${{ secrets.VRT_API_KEY }}
31-
VRT_BRANCHNAME: ${{ github.head_ref || github.ref_name }}
32-
VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}"
25+
CI: true
3326

3427
- uses: actions/upload-artifact@v4
3528
if: always()

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Node.js environment
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: 16
19+
node-version: 20
2020

2121
- name: Install npm dependencies
2222
run: npm ci

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org/

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### STAGE 1: Build ###
22
# This image is around 50 megabytes
3-
FROM node:18-alpine3.18 AS builder
3+
FROM node:20-alpine AS builder
44

55
# Create app directory
66
WORKDIR /app

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@
1111

1212
The testing related `.spec.tsx` files are used with Playwright for browser tests, and the `.test.tsx` files with Jest for unit tests.
1313

14+
## Running Tests
15+
16+
### Unit Tests (Jest)
17+
Run Jest unit tests:
18+
```bash
19+
npm run test
20+
```
21+
22+
### Integration Tests (Playwright)
23+
24+
#### Local Testing
25+
Run Playwright tests locally (requires local dev server):
26+
```bash
27+
npm run test:pw:local
28+
```
29+
1430
## Local HTTPS config
1531

1632
- Generate keys [here](https://www.selfsignedcertificate.com/)

env.sh

100644100755
File mode changed.

integration_tests/fixtures/index.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { test as base } from "@playwright/test";
2-
import { PlaywrightVisualRegressionTracker } from "@visual-regression-tracker/agent-playwright";
32
import { LoginPage, ProfilePage, ProjectListPage, ProjectPage } from "pages";
43
import { RegisterPage } from "pages/RegisterPage";
54
import { TestVariationDetailsPage } from "pages/TestVariationDetailsPage";
65
import { TestVariationListPage } from "pages/TestVariationListPage";
76
import { UserListPage } from "pages/UserListPage";
87

98
type Fixtures = {
10-
vrt: PlaywrightVisualRegressionTracker;
119
loginPage: LoginPage;
1210
registerPage: RegisterPage;
1311
openProjectPage: (
@@ -28,13 +26,6 @@ type Fixtures = {
2826
};
2927

3028
export const test = base.extend<Fixtures>({
31-
vrt: async ({ browserName }, use) => {
32-
const vrt = new PlaywrightVisualRegressionTracker(browserName);
33-
34-
await vrt.start();
35-
await use(vrt);
36-
await vrt.stop();
37-
},
3829
loginPage: [
3930
async ({ page }, use) => {
4031
await page.goto("/");

integration_tests/test/login.spec.ts

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

4-
test("renders", async ({ page, vrt }) => {
5-
await vrt.trackPage(page, "Login page");
4+
test("renders", async ({ page }) => {
5+
await expect(page).toHaveScreenshot("login-page.png");
66
});
77

88
test("can login", async ({ loginPage }) => {
15.6 KB
Loading

integration_tests/test/profile.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { expect } from "@playwright/test";
12
import { test } from "fixtures";
23
import { TEST_PROJECT } from "~client/_test/test.data.helper";
34
import { mockGetProjects } from "utils/mocks";
@@ -9,6 +10,6 @@ test.beforeEach(async ({ page }) => {
910
});
1011

1112
// eslint-disable-next-line @typescript-eslint/no-unused-vars
12-
test("renders", async ({ profilePage, page, vrt }) => {
13-
await vrt.trackPage(page, "Profile page");
13+
test("renders", async ({ profilePage, page }) => {
14+
await expect(page).toHaveScreenshot("profile-page.png");
1415
});

0 commit comments

Comments
 (0)