Skip to content

Commit

Permalink
dynamic playwright baseurl #3036
Browse files Browse the repository at this point in the history
  • Loading branch information
emilschn committed Sep 17, 2024
1 parent 1b22e5b commit ba47f60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default defineConfig({
/* 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',
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:8080',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/front.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from '@playwright/test';

test('Histologe - Home', async ({ page }) => {
await page.goto('http://localhost:8080/');
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Sortez du mal-logement' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Aide' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Infos utiles' })).toBeVisible();
Expand All @@ -10,14 +10,14 @@ test('Histologe - Home', async ({ page }) => {
});

test('Histologe - Qui sommes-nous ?', async ({ page }) => {
await page.goto('http://localhost:8080/qui-sommes-nous');
await page.goto('/qui-sommes-nous');
await expect(page.getByRole('heading', { name: 'Qui sommes-nous ?' })).toBeVisible();
await expect(page.getByRole('heading', { name: 'Une solution reconnue' })).toBeVisible();
await expect(page.locator('div').filter({ hasText: 'Voir le fil d’Ariane Accueil' })).toBeVisible();
});

test('Histologe - Contact', async ({ page }) => {
await page.goto('http://localhost:8080/contact');
await page.goto('/contact');

await page.getByLabel('Adresse e-mail Renseignez l\'').click();
await page.getByLabel('Adresse e-mail Renseignez l\'').fill('[email protected]');
Expand Down

0 comments on commit ba47f60

Please sign in to comment.