Skip to content

Commit

Permalink
Create README.md (use content from core repo)
Browse files Browse the repository at this point in the history
  • Loading branch information
geofranzi authored Nov 11, 2023
1 parent 18d7b5f commit 36c332c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Initial setup
It is recommended to install Playwright's official Visual Studio Code [extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) for a better testing experience and an interactive GUI.
## Shared functions
Create a `.env` file in the root folder of the project for your user credentials and host URL. `HOST`, `USER` and `PASSWORD` are the environment variables required to run shared functions.

Here's an example `.env` file contents:
```bash
export HOST="https://localhost:4173"
export ACCOUNT_USERNAME="user"
export ACCOUNT_PASSWORD="user"
```
### Using shared variables
Importing shared functions from `shared.ts`:
```typescript
import { login, host } from './shared';
```
\
Usage of shared functions in tests:
```typescript
test('Test', async ({ page }) => {
await login(page); // Login
await page.goto(`${host}/test/`); // Go to /test route
});
```
## Playwright Docs
You can check Playwright documentation [page](https://playwright.dev/docs/intro) for more details, guides and information.

0 comments on commit 36c332c

Please sign in to comment.