generated from noriapi/web-extension-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
17 changed files
with
1,238 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { type Locator, type Page } from "@playwright/test"; | ||
|
||
export class PopupPage { | ||
readonly message: Locator; | ||
readonly messageOwner: Locator; | ||
readonly messageOwnerHide: Locator; | ||
readonly messageOwnerShow: Locator; | ||
readonly messageOwnerNohighlight: Locator; | ||
|
||
constructor( | ||
public readonly page: Page, | ||
public readonly extensionId: string, | ||
) { | ||
this.message = this.page.getByRole("group", { name: "Message" }); | ||
this.messageOwner = this.message.getByRole("group", { name: "Owner" }); | ||
this.messageOwnerHide = this.messageOwner.getByRole("radio", { | ||
name: "Hide", | ||
}); | ||
this.messageOwnerShow = this.messageOwner.getByRole("radio", { | ||
name: "Show", | ||
}); | ||
this.messageOwnerNohighlight = this.messageOwner.getByRole("radio", { | ||
name: "No highlight", | ||
}); | ||
} | ||
|
||
async goto() { | ||
await this.page.goto(`chrome-extension://${this.extensionId}/popup.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,16 @@ | ||
import { expect, test } from "./fixtures"; | ||
import { PopupPage } from "./pages/popup"; | ||
|
||
test("should persist config", async ({ page, extensionId }) => { | ||
const popup = new PopupPage(page, extensionId); | ||
|
||
await popup.goto(); | ||
|
||
await expect(popup.messageOwnerHide).toBeChecked({ checked: false }); | ||
|
||
await popup.messageOwnerHide.click(); | ||
|
||
await popup.page.reload(); | ||
|
||
await expect(popup.messageOwnerHide).toBeChecked({ checked: true }); | ||
}); |
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 |
---|---|---|
|
@@ -28,15 +28,18 @@ | |
"lint:fix": "eslint --fix . && prettier --write src/**/*.{js,jsx,ts,tsx,html}", | ||
"submit": "env-cmd -f .env.submit --silent -- tsx scripts/submit.ts", | ||
"submit:firefox": "env-cmd -f .env.submit --silent -- tsx scripts/submit.ts -b firefox", | ||
"test": "vitest", | ||
"zip": "wxt zip", | ||
"zip:firefox": "wxt zip -b firefox" | ||
}, | ||
"dependencies": { | ||
"io-ts": "^2.2.21", | ||
"solid-js": "^1.8.8" | ||
}, | ||
"devDependencies": { | ||
"@commander-js/extra-typings": "^11.1.0", | ||
"@eslint/eslintrc": "^3.0.0", | ||
"@fast-check/vitest": "^0.0.9", | ||
"@playwright/test": "^1.40.1", | ||
"@types/node": "^20.10.6", | ||
"@types/webextension-polyfill": "^0.10.7", | ||
|
@@ -57,6 +60,7 @@ | |
"typescript-plugin-css-modules": "^5.0.2", | ||
"vite": "^5.0.11", | ||
"vite-plugin-solid": "^2.8.0", | ||
"vitest": "^1.1.1", | ||
"wxt": "^0.13.3" | ||
}, | ||
"packageManager": "[email protected]", | ||
|
Oops, something went wrong.