$
This commit is contained in:
parent
002dce7084
commit
0c860ac593
21
README.md
21
README.md
@ -1,9 +1,3 @@
|
||||
# Projet BUT 3
|
||||
|
||||
## Acces en ligne
|
||||
|
||||
(ici)[https://www.google.com]
|
||||
|
||||
## Demarrer en local
|
||||
|
||||
### Cloner le projet git
|
||||
@ -16,21 +10,18 @@
|
||||
### Installation des dependences
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
npm install
|
||||
```
|
||||
|
||||
### Demarrer le front-end
|
||||
|
||||
Alors ici il y a un petit soucis que j'arrive pas a localiser, quand le front se demarre, une requete /authenticated doit etre faite.
|
||||
Quand le projet se demarre et que je tente d'acceder au site, la requete ne s'envoie pas. M'obligeant donc a refresh la page puis me diriger vers /login manuellement.
|
||||
|
||||
```bash
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
### Test
|
||||
|
||||
```
|
||||
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Membre
|
||||
|
||||
Bilal Boudjemline
|
||||
Bilal Boudjemline (solo)
|
||||
|
1256
package-lock.json
generated
1256
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -8,10 +8,6 @@
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
||||
"test": "vitest",
|
||||
"test-e2e": "npx playwright test",
|
||||
"show-e2e": "npx playwright show-report",
|
||||
"ui-test": "npx playwright test --ui",
|
||||
"preview": "vite preview",
|
||||
"format": "prettier --write 'src/**/*.{js,jsx}'",
|
||||
"prepare": "husky install"
|
||||
@ -29,8 +25,6 @@
|
||||
"sass": "^1.72.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.42.1",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/node": "^20.11.9",
|
||||
"@types/react": "^18.2.43",
|
||||
"@types/react-dom": "^18.2.17",
|
||||
|
@ -1,50 +0,0 @@
|
||||
// @ts-check
|
||||
import { defineConfig, devices } from "@playwright/test";
|
||||
|
||||
/**
|
||||
* Read environment variables from file.
|
||||
* https://github.com/motdotla/dotenv
|
||||
*/
|
||||
// require('dotenv').config();
|
||||
|
||||
/**
|
||||
* @see https://playwright.dev/docs/test-configuration
|
||||
*/
|
||||
export default defineConfig({
|
||||
testDir: "./tests",
|
||||
/* Run tests in files in parallel */
|
||||
fullyParallel: true,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
forbidOnly: !!process.env.CI,
|
||||
/* Retry on CI only */
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: "html",
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
baseURL: "http://127.0.0.1:3000",
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: "on-first-retry",
|
||||
},
|
||||
|
||||
outputDir: "./tests/traces",
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
projects: [
|
||||
{
|
||||
name: "chromium",
|
||||
use: { ...devices["Desktop Chrome"] },
|
||||
},
|
||||
],
|
||||
|
||||
//Run your local dev server before starting the tests /
|
||||
webServer: {
|
||||
command: "npm run dev",
|
||||
url: "http://127.0.0.1:3000",
|
||||
reuseExistingServer: !process.env.CI,
|
||||
},
|
||||
});
|
706
pnpm-lock.yaml
generated
706
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
||||
import { MagnifyingGlass } from "react-loader-spinner";
|
||||
import "./LoaderSpace.scss";
|
||||
import React from "react";
|
||||
|
||||
export default function LoaderSpace({ isVisible, isCenterLoader }) {
|
||||
return (
|
||||
|
@ -35,8 +35,10 @@ export const AuthenticationProvider = ({ children }) => {
|
||||
const login = async (email, password) => {
|
||||
try {
|
||||
const user = await loginApi(email, password);
|
||||
if (typeof user !== "string") {
|
||||
setAuthState({ user });
|
||||
redirect();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Erreur lors de la connexion :", error);
|
||||
setAuthState({ user: undefined });
|
||||
|
@ -20,6 +20,7 @@ export const Home = () => {
|
||||
|
||||
getState().then((res) => {
|
||||
try {
|
||||
console.log(res);
|
||||
setIsLoad(false);
|
||||
setDataset(res);
|
||||
setupRoomsStats(res.rooms);
|
||||
|
@ -31,7 +31,7 @@ export default function Rooms() {
|
||||
|
||||
createRoom(name).then((res) => {
|
||||
setIsErr(false);
|
||||
const values = [...rooms];
|
||||
let values = rooms ? [...rooms] : [];
|
||||
values.push(res);
|
||||
setRooms(values);
|
||||
alert(`Creation de la piece ${name} reussite !`);
|
||||
|
@ -1,32 +0,0 @@
|
||||
// @ts-check
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test("Test de connexion", async ({ page }) => {
|
||||
const account = "Bilouuuuuuu94!@@";
|
||||
|
||||
await page.goto("/login");
|
||||
await page.waitForURL("/login");
|
||||
|
||||
await page
|
||||
.locator(
|
||||
"#layout-container > main > div > form > input[type=text]:nth-child(1)",
|
||||
)
|
||||
.fill(account);
|
||||
await page
|
||||
.locator(
|
||||
"#layout-container > main > div > form > input[type=password]:nth-child(2)",
|
||||
)
|
||||
.fill(account);
|
||||
await page.locator("#layout-container > main > div > form > button").click({
|
||||
button: "left",
|
||||
});
|
||||
|
||||
await page.waitForURL("/");
|
||||
|
||||
expect(await page.title()).toBe("Accueil");
|
||||
expect(await page.locator("#title").innerText()).toBe(`Bonjour ${account} !`);
|
||||
|
||||
test.setTimeout(10000);
|
||||
|
||||
await page.waitForURL("/");
|
||||
});
|
@ -1,33 +0,0 @@
|
||||
// @ts-check
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test("Test de connexion", async ({ page }) => {
|
||||
const account = "Eheheh9400$$!@@";
|
||||
|
||||
await page.goto("/register");
|
||||
await page.waitForURL("/register");
|
||||
|
||||
await page
|
||||
.locator(
|
||||
"#layout-container > main > div > form > input[type=text]:nth-child(1)",
|
||||
)
|
||||
.fill(account);
|
||||
await page
|
||||
.locator(
|
||||
"#layout-container > main > div > form > input[type=password]:nth-child(2)",
|
||||
)
|
||||
.fill(account);
|
||||
await page
|
||||
.locator(
|
||||
"#layout-container > main > div > form > input[type=password]:nth-child(3)",
|
||||
)
|
||||
.fill(account);
|
||||
await page
|
||||
.locator("#layout-container > main > div > form > button")
|
||||
.click({ button: "left" });
|
||||
|
||||
await page.waitForURL("/");
|
||||
|
||||
expect(await page.title()).toBe("Accueil");
|
||||
expect(await page.locator("#title").innerText()).toBe(`Bonjour ${account} !`);
|
||||
});
|
Binary file not shown.
Binary file not shown.
@ -1,9 +0,0 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react-swc";
|
||||
|
||||
export default defineConfig({
|
||||
server: {
|
||||
port: 3001,
|
||||
},
|
||||
plugins: [react()],
|
||||
});
|
Loading…
Reference in New Issue
Block a user