Skip to content

Commit

Permalink
enable to run e2e test against app running on local
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-ryuji committed Jan 31, 2024
1 parent 17dff95 commit 230eb2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ Show HTML test reports:
npm run test:e2e:report
```

Run the test against app running on local:

```sh
npm run dev

# in a different terminal
ENV=local npm run test:e2e
```

### Build

```sh
Expand Down
6 changes: 4 additions & 2 deletions e2e/production.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { test, expect } from '@playwright/test'
import { clickLinkAndVerify, getFirstLink, verifyOpeningNewPage } from './utils'

const baseUrl = 'https://steexp.com'
// const baseUrl = 'http://publicnet.local:3000' // for test on local
const baseUrl =
process.env.ENV === 'local'
? 'http://publicnet.local:3000'
: 'https://steexp.com'

test('top page', async ({ page }) => {
await page.goto(`${baseUrl}/`)
Expand Down

0 comments on commit 230eb2a

Please sign in to comment.