-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from WildCodeSchool/41_landing_testing
41 landing testing
- Loading branch information
Showing
11 changed files
with
8,793 additions
and
11,919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,68 @@ | ||
services: | ||
backend: | ||
build: ./backend | ||
volumes: | ||
- ./backend/src:/app/src | ||
env_file: | ||
- ./backend/.env | ||
healthcheck: | ||
test: 'curl --fail --request POST --header ''content-type: application/json'' --url ''http://localhost:4000/graphql'' --data ''{"query":"query { __typename }"}'' || exit 1' | ||
interval: 1s | ||
timeout: 2s | ||
retries: 100 | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
frontend: | ||
build: ./frontend | ||
volumes: | ||
- ./frontend/src:/app/src | ||
depends_on: | ||
backend: | ||
condition: service_healthy | ||
healthcheck: | ||
test: "curl --fail --request GET --url 'http://localhost:5173' || exit 1" | ||
interval: 1s | ||
timeout: 2s | ||
retries: 100 | ||
db: | ||
image: postgres | ||
healthcheck: | ||
test: [ "CMD-SHELL", "pg_isready -d postgres -U postgres" ] | ||
interval: 1s | ||
timeout: 2s | ||
retries: 100 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
volumes: | ||
- ./init.sql:/docker-entrypoint-initdb.d/init.sql | ||
- ./postgres-data/data:/var/lib/postgresql/data | ||
adminer: | ||
image: adminer | ||
ports: | ||
- "8080:8080" | ||
files: | ||
build: ./files | ||
volumes: | ||
- ./files/src:/app/src | ||
healthcheck: | ||
test: "curl --fail --request GET --url 'http://localhost:3000' || exit 1" | ||
interval: 1s | ||
timeout: 2s | ||
retries: 100 | ||
env_file: | ||
- ./files/.env | ||
apigateway: | ||
image: nginx | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf | ||
depends_on: | ||
backend: | ||
condition: service_healthy | ||
frontend: | ||
condition: service_healthy | ||
files: | ||
condition: service_healthy | ||
ports: | ||
- "7002:80" | ||
backend: | ||
build: ./backend | ||
volumes: | ||
- ./backend/src:/app/src | ||
env_file: | ||
- ./backend/.env | ||
healthcheck: | ||
test: 'curl --fail --request POST --header ''content-type: application/json'' --url ''http://localhost:4000/graphql'' --data ''{"query":"query { __typename }"}'' || exit 1' | ||
interval: 1s | ||
timeout: 2s | ||
retries: 100 | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
frontend: | ||
build: ./frontend | ||
volumes: | ||
- ./frontend/src:/app/src | ||
depends_on: | ||
backend: | ||
condition: service_healthy | ||
healthcheck: | ||
test: "curl --fail --request GET --url 'http://localhost:5173' || exit 1" | ||
interval: 1s | ||
timeout: 2s | ||
retries: 100 | ||
db: | ||
image: postgres | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -d postgres -U postgres"] | ||
interval: 1s | ||
timeout: 2s | ||
retries: 100 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
volumes: | ||
- ./init.sql:/docker-entrypoint-initdb.d/init.sql | ||
- ./postgres-data/data:/var/lib/postgresql/data | ||
adminer: | ||
image: adminer | ||
ports: | ||
- "8080:8080" | ||
files: | ||
build: ./files | ||
volumes: | ||
- ./files/src:/app/src | ||
- ./files/uploads:/app/uploads | ||
healthcheck: | ||
test: "curl --fail --request GET --url 'http://localhost:3000' || exit 1" | ||
interval: 1s | ||
timeout: 2s | ||
retries: 100 | ||
env_file: | ||
- ./files/.env | ||
apigateway: | ||
image: nginx | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf | ||
depends_on: | ||
backend: | ||
condition: service_healthy | ||
frontend: | ||
condition: service_healthy | ||
files: | ||
condition: service_healthy | ||
ports: | ||
- "7002:80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import path from "path"; | ||
import fs from "fs"; | ||
|
||
test("Landing page", async ({ page }) => { | ||
await page.goto("http://apigateway/"); | ||
await page.waitForLoadState("networkidle"); | ||
|
||
const emailInput = page.getByPlaceholder("Your email"); | ||
const emailToInput = await page.isVisible('text="Receivers emails"'); | ||
const titleInput = page.getByPlaceholder("Title"); | ||
const messageInput = page.getByPlaceholder("Message"); | ||
const uploadDragger = page.locator(".ant-upload-drag"); | ||
const transferButton = page.locator('button:has-text("Transfer")'); | ||
|
||
await expect(emailInput).toBeVisible(); | ||
await expect(emailToInput).toBe(true); | ||
await expect(titleInput).toBeVisible(); | ||
await expect(messageInput).toBeVisible(); | ||
await expect(uploadDragger).toBeVisible(); | ||
await expect(transferButton).toBeVisible(); | ||
|
||
await emailInput.fill("[email protected]"); | ||
await titleInput.fill("Ton document"); | ||
await messageInput.fill("Hello, voici ton document"); | ||
|
||
const filePath = path.dirname("/app/tests/testFile.txt"); | ||
console.log("Chemin du fichier", filePath); | ||
|
||
if (!fs.existsSync(filePath)) { | ||
console.error(`Le fichier n'existe pas: ${filePath}`); | ||
throw new Error(`Le fichier n'existe pas: ${filePath}`); | ||
} else { | ||
console.log(`Le fichier existe: ${filePath}`); | ||
} | ||
|
||
await transferButton.click(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fichier de test pour upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uploads/ |
Oops, something went wrong.