Skip to content
Extraits de code Groupes Projets
Valider 09a6d0ab rédigé par Brieuc Dubois's avatar Brieuc Dubois
Parcourir les fichiers

Proof of concept

parent e239f718
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!51E2e
...@@ -5,3 +5,10 @@ ...@@ -5,3 +5,10 @@
.ipynb_checkpoints/ .ipynb_checkpoints/
scripts/surveys/.creds scripts/surveys/.creds
# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
stages: stages:
- lint - lint
- test
- build - build
- deploy - deploy
lint_frontend: lint_frontend:
stage: lint stage: lint
except:
- feat/cd
image: node image: node
script: script:
- cd frontend - cd frontend
...@@ -15,12 +14,26 @@ lint_frontend: ...@@ -15,12 +14,26 @@ lint_frontend:
lint_backend: lint_backend:
stage: lint stage: lint
except:
- feat/cd
image: registry.gitlab.com/pipeline-components/black:latest image: registry.gitlab.com/pipeline-components/black:latest
script: script:
- black --check --verbose -- . - black --check --verbose -- .
playwright_tests:
stage: test
image: node:lts
before_script:
- npm install -g pnpm
- pnpm install
- pnpm exec playwright install --with-deps
script:
- pnpm exec playwright test
artifacts:
when: always
paths:
- playwright-report/
expire_in: 30 days
timeout: 60m
build: build:
stage: build stage: build
only: only:
...@@ -65,7 +78,6 @@ docker_deploy-dev: ...@@ -65,7 +78,6 @@ docker_deploy-dev:
stage: deploy stage: deploy
only: only:
- dev - dev
- feat/cd
image: alpine:latest image: alpine:latest
script: script:
- echo "/mnt/data/languagelab/repo/scripts/update.dev.sh" > /mnt/pipeline - echo "/mnt/data/languagelab/repo/scripts/update.dev.sh" > /mnt/pipeline
{
"devDependencies": {
"@playwright/test": "1.38.1",
"@types/node": "^24.0.0"
},
"scripts": {},
"dependencies": {
"playwright": "1.38.1"
}
}
Impossible d'afficher diff de source : il est trop volumineux. Options pour résoudre ce problème : voir le blob.
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? "dot" : "html",
use: {
baseURL: "http://127.0.0.1:5173",
trace: "on-first-retry",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
// {
// name: "firefox",
// use: { ...devices["Desktop Firefox"] },
// },
// {
// name: "webkit",
// use: { ...devices["Desktop Safari"] },
// },
//
// {
// name: "Mobile Chrome",
// use: { ...devices["Pixel 5"] },
// },
// {
// name: "Mobile Safari",
// use: { ...devices["iPhone 12"] },
// },
],
webServer: [
{
cwd: "../frontend",
command: "pnpm run dev",
url: "http://localhost:5173",
reuseExistingServer: !process.env.CI,
},
{
cwd: "../backend/app",
command: "sh backend.sh",
url: "http://localhost:8000/docs",
reuseExistingServer: !process.env.CI,
},
],
});
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
playwright:
specifier: 1.38.1
version: 1.38.1
devDependencies:
'@playwright/test':
specifier: 1.38.1
version: 1.38.1
'@types/node':
specifier: ^24.0.0
version: 24.0.0
packages:
'@playwright/test@1.38.1':
resolution: {integrity: sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==}
engines: {node: '>=16'}
deprecated: Please update to the latest version of Playwright to test up-to-date browsers.
hasBin: true
'@types/node@24.0.0':
resolution: {integrity: sha512-yZQa2zm87aRVcqDyH5+4Hv9KYgSdgwX1rFnGvpbzMaC7YAljmhBET93TPiTd3ObwTL+gSpIzPKg5BqVxdCvxKg==}
fsevents@2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
playwright-core@1.38.1:
resolution: {integrity: sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==}
engines: {node: '>=16'}
hasBin: true
playwright@1.38.1:
resolution: {integrity: sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==}
engines: {node: '>=16'}
hasBin: true
undici-types@7.8.0:
resolution: {integrity: sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==}
snapshots:
'@playwright/test@1.38.1':
dependencies:
playwright: 1.38.1
'@types/node@24.0.0':
dependencies:
undici-types: 7.8.0
fsevents@2.3.2:
optional: true
playwright-core@1.38.1: {}
playwright@1.38.1:
dependencies:
playwright-core: 1.38.1
optionalDependencies:
fsevents: 2.3.2
undici-types@7.8.0: {}
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
playwright-driver.browsers
];
shellHook = ''
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
export PLAYWRIGHT_BROWSERS_PATH="${pkgs.playwright-driver.browsers}"
export PLAYWRIGHT_NODEJS_PATH="${pkgs.nodejs}/bin/node"
export PLAYWRIGHT_DRIVER_PATH="${pkgs.playwright-driver}"
'';
}
import { test, expect } from "@playwright/test";
test("has login page", async ({ page }) => {
await page.goto("./login");
await expect(page).toHaveTitle(/LanguageLab/);
});
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter