-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ac0d1e
commit ebbf0d0
Showing
10 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="/tests/reset.css" /> | ||
<link rel="stylesheet" href="/public/flows.css" /> | ||
</head> | ||
<body> | ||
<button class="start">Start flow</button> | ||
<div class="log"></div> | ||
|
||
<script type="module" src="./tracking.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test("Emits correct events", async ({ page }) => { | ||
await page.goto("/tracking/tracking.html"); | ||
await page.locator(".start").click(); | ||
await page.locator(".flows-continue").click(); | ||
await page.locator(".flows-back").click(); | ||
await page.locator(".flows-cancel").click(); | ||
await page.locator(".start").click(); | ||
await page.locator(".flows-continue").click(); | ||
await page.locator(".flows-finish").click(); | ||
await expect(page).toHaveScreenshot({ scale: "css" }); | ||
}); |
Binary file added
BIN
+190 KB
...s/tracking/tracking.spec.ts-snapshots/Emits-correct-events-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+210 KB
tests/tracking/tracking.spec.ts-snapshots/Emits-correct-events-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+120 KB
tests/tracking/tracking.spec.ts-snapshots/Emits-correct-events-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { init } from "../../dist"; | ||
|
||
void init({ | ||
flows: [ | ||
{ | ||
id: "flow", | ||
element: ".start", | ||
frequency: "every-time", | ||
steps: [ | ||
{ | ||
title: "Step 1", | ||
}, | ||
{ | ||
title: "Step 2", | ||
}, | ||
], | ||
}, | ||
], | ||
tracking: (e) => { | ||
const p = document.createElement("p"); | ||
p.classList.add("log-item"); | ||
p.innerText = JSON.stringify(e); | ||
document.querySelector(".log")?.appendChild(p); | ||
}, | ||
}); |