Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .llms-snapshots/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6842,18 +6842,22 @@ That being said, integrating authentication is easier in Playwright given that a

## Authentication

If your application require authentication, we recommend using the Playwright plugin for Internet Identity maintained by the DFINITY foundation:
If your application require authentication, we recommend using our Playwright plugin for sign-in in development:

👉 [github.com/dfinity/internet-identity-playwright](https://github.com/dfinity/internet-identity-playwright)
👉 [github.com/junobuild/emulator-playwright](https://github.com/junobuild/emulator-playwright)

It handles the full login flow programmatically, allowing your tests to sign in without user interaction.
It handles the full login flow programmatically, allowing your tests to sign in without user interaction. Under the hood, it uses the `dev` option of the `signIn` function:

```
import { signIn } from "@junobuild/core";await signIn({ dev: {} });
```

### Example usage

After installing the plugin, you can write a test like this:

```
import { testWithII } from "@dfinity/internet-identity-playwright";testWithII("should sign-in with a new user", async ({ page, iiPage }) => { await page.goto("/"); await iiPage.signInWithNewIdentity();});
import { initSatelliteSuite } from "@junobuild/emulator-playwright";import { test } from "@playwright/test";const getPages = initSatelliteSuite();test("...", async () => { const { satelliteId, cliPage } = getPages();});
```

---
Expand Down
21 changes: 14 additions & 7 deletions docs/guides/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,30 @@ That being said, integrating authentication is easier in Playwright given that a

## Authentication

If your application require authentication, we recommend using the Playwright plugin for Internet Identity maintained by the DFINITY foundation:
If your application require authentication, we recommend using our Playwright plugin for sign-in in development:

👉 [github.com/dfinity/internet-identity-playwright](https://github.com/dfinity/internet-identity-playwright)
👉 [github.com/junobuild/emulator-playwright](https://github.com/junobuild/emulator-playwright)

It handles the full login flow programmatically, allowing your tests to sign in without user interaction.
It handles the full login flow programmatically, allowing your tests to sign in without user interaction. Under the hood, it uses the `dev` option of the `signIn` function:

```typescript
import { signIn } from "@junobuild/core";

await signIn({ dev: {} });
```

### Example usage

After installing the plugin, you can write a test like this:

```typescript
import { testWithII } from "@dfinity/internet-identity-playwright";
import { initSatelliteSuite } from "@junobuild/emulator-playwright";
import { test } from "@playwright/test";

testWithII("should sign-in with a new user", async ({ page, iiPage }) => {
await page.goto("/");
const getPages = initSatelliteSuite();

await iiPage.signInWithNewIdentity();
test("...", async () => {
const { satelliteId, cliPage } = getPages();
});
```

Expand Down