Skip to content

Commit

Permalink
fix(e2e): update Playwright config for local server and modify test case
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolongol committed Feb 5, 2025
1 parent 4ab11ec commit 0ab5a6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions apps/frontend-e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { nxE2EPreset } from '@nx/playwright/preset';
import { workspaceRoot } from '@nx/devkit';

// For CI, you may want to set BASE_URL to the deployed application.
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
const baseURL = process.env['BASE_URL'] || 'http://localhost:80';

/**
* Read environment variables from file.
Expand All @@ -24,8 +24,8 @@ export default defineConfig({
},
/* Run your local dev server before starting the tests */
webServer: {
command: 'npx nx run frontend:serve',
url: 'http://localhost:4200',
command: 'npx nx run @marcolongo.cloud/frontend:serve',
url: 'http://localhost:80',
reuseExistingServer: !process.env.CI,
cwd: workspaceRoot,
},
Expand Down
7 changes: 3 additions & 4 deletions apps/frontend-e2e/src/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
test('basic test', async ({ page }) => {
await page.goto('/');

// Expect h1 to contain a substring.
expect(await page.locator('h1').innerText()).toContain('Welcome');
const homeWorks = await page.$('text=home works!');
expect(homeWorks).toBeTruthy();
});

0 comments on commit 0ab5a6a

Please sign in to comment.