-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance improvements for parsing templates (#534)
* Improve performance when parsing templates by caching the account details in the content script. * Improve template context parsing and add tests for it. * Make sure `from` is an object, and `to`, `cc`, `bcc` are arrays. * Improve playwright test speed and accuracy. * e2e tests for session authentication and account variable. * Improve Outlook.com detection.
- Loading branch information
Showing
31 changed files
with
756 additions
and
584 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
9 changes: 9 additions & 0 deletions
9
playwright/contenteditable-auth-session/contenteditable-auth-session.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,9 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<div style="width: 200px; height: 200px" contenteditable role="textbox"></div> | ||
</body> | ||
</html> |
31 changes: 31 additions & 0 deletions
31
playwright/contenteditable-auth-session/contenteditable-auth-session.spec.ts
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,31 @@ | ||
import {test, expect} from '../fixtures-auth-session.ts' | ||
|
||
test.describe('ContentEditable Session Authenticated', () => { | ||
test.beforeEach(async ({page}) => { | ||
await page.goto('/contenteditable-auth-session/contenteditable-auth-session.html') | ||
}) | ||
|
||
test.afterEach(async ({page}) => { | ||
await page.getByRole('textbox').clear() | ||
}) | ||
|
||
test('should insert template with keyboard shortcut', async ({page}) => { | ||
const textbox = page.getByRole('textbox') | ||
await textbox.fill('w') | ||
await textbox.press('Tab') | ||
await expect(textbox).toHaveText('Write emails faster.') | ||
}) | ||
|
||
test('should insert template from dialog', async ({page}) => { | ||
const textbox = page.getByRole('textbox') | ||
await textbox.press('Control+ ') | ||
const search = page.getByRole('searchbox') | ||
await expect(search).toBeVisible() | ||
await search.fill('create') | ||
const template = 'Create text templates and insert them with shortcuts.' | ||
const list = page.getByText(template) | ||
await list.waitFor() | ||
await search.press('Enter') | ||
await expect(textbox).toHaveText(template) | ||
}) | ||
}) |
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,24 @@ | ||
/* globals process */ | ||
import dotenv from 'dotenv' | ||
|
||
import {test} from './fixtures.ts' | ||
export {test, expect} from './fixtures.ts' | ||
|
||
dotenv.config() | ||
|
||
test.skip(({browserName}) => browserName === 'firefox', 'Auth testing not supported in Firefox.') | ||
|
||
test.beforeEach(async ({page, extensionId}) => { | ||
await page.goto(`https://app.briskine.com/`) | ||
await page.getByLabel('Email').fill(process.env.TEST_EMAIL || 'MISSING EMAIL') | ||
await page.getByLabel('Password').fill(process.env.TEST_PASSWORD || 'MISSING PASSWORD') | ||
await page.getByLabel('Password').press('Enter') | ||
// wait for templates to load | ||
const title = page.getByText('Write emails faster') | ||
await title.waitFor() | ||
|
||
await page.goto(`${extensionId}/popup/popup.html`) | ||
await page.getByRole('button').click() | ||
const premium = page.getByText('Go premium') | ||
await premium.waitFor() | ||
}) |
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
Oops, something went wrong.