diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-16 19:37:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-17 00:37:01 +0000 |
commit | 4e77741d22778bd09b772fc53f1cbd64107e3d24 (patch) | |
tree | e8010d42ccba5341afd98177d3c1d69d856cbcbd /test/playwright | |
parent | 1e69210b53151f31140bb1fbdc9f3d71fa181630 (diff) |
Even more eslint rules (#696)
* capitalized-comments
* Turn rules on
* Add miscellaneous rules
* More rules
Diffstat (limited to 'test/playwright')
-rw-r--r-- | test/playwright/integration.spec.js | 4 | ||||
-rw-r--r-- | test/playwright/playwright-util.js | 2 | ||||
-rw-r--r-- | test/playwright/visual.spec.js | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/test/playwright/integration.spec.js b/test/playwright/integration.spec.js index 170714a1..06af3fd2 100644 --- a/test/playwright/integration.spec.js +++ b/test/playwright/integration.spec.js @@ -31,13 +31,13 @@ import { test.beforeEach(async ({context}) => { // Wait for the on-install welcome.html tab to load, which becomes the foreground tab const welcome = await context.waitForEvent('page'); - await welcome.close(); // close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang + await welcome.close(); // Close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang }); test('search clipboard', async ({page, extensionId}) => { await page.goto(`chrome-extension://${extensionId}/search.html`); await page.locator('#search-option-clipboard-monitor-container > label').click(); - await page.waitForTimeout(200); // race + await page.waitForTimeout(200); // Race await writeToClipboardFromPage(page, 'あ'); await expect(page.locator('#search-textbox')).toHaveValue('あ'); diff --git a/test/playwright/playwright-util.js b/test/playwright/playwright-util.js index b364c80b..b9a4831a 100644 --- a/test/playwright/playwright-util.js +++ b/test/playwright/playwright-util.js @@ -28,7 +28,7 @@ export const test = base.extend({ context: async ({}, use) => { const pathToExtension = path.join(root, 'ext'); const context = await chromium.launchPersistentContext('', { - // headless: false, + // Disabled: headless: false, args: [ '--headless=new', `--disable-extensions-except=${pathToExtension}`, diff --git a/test/playwright/visual.spec.js b/test/playwright/visual.spec.js index fc8bb8df..157cedc7 100644 --- a/test/playwright/visual.spec.js +++ b/test/playwright/visual.spec.js @@ -22,7 +22,7 @@ import {expect, root, test} from './playwright-util.js'; test.beforeEach(async ({context}) => { // Wait for the on-install welcome.html tab to load, which becomes the foreground tab const welcome = await context.waitForEvent('page'); - welcome.close(); // close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang + welcome.close(); // Close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang }); test('visual', async ({page, extensionId}) => { @@ -63,9 +63,9 @@ test('visual', async ({page, extensionId}) => { if (typeof popup_frame === 'undefined') { frame_attached = page.waitForEvent('frameattached'); } - await page.mouse.move(box.x + offset.x, box.y + offset.y, {steps: 10}); // hover over the test + await page.mouse.move(box.x + offset.x, box.y + offset.y, {steps: 10}); // Hover over the test if (typeof popup_frame === 'undefined') { - popup_frame = await frame_attached; // wait for popup to be attached + popup_frame = await frame_attached; // Wait for popup to be attached } try { // Some tests don't have a popup, so don't fail if it's not there @@ -75,11 +75,11 @@ test('visual', async ({page, extensionId}) => { console.log(test_name + ' has no popup'); } - await page.bringToFront(); // bring the page to the foreground so the screenshot doesn't hang; for some reason the frames result in page being in the background + await page.bringToFront(); // Bring the page to the foreground so the screenshot doesn't hang; for some reason the frames result in page being in the background await expect.soft(page).toHaveScreenshot(test_name + '.png'); - await page.mouse.click(0, 0); // click away so popup disappears - await (await /** @type {import('@playwright/test').Frame} */ (popup_frame).frameElement()).waitForElementState('hidden'); // wait for popup to disappear + await page.mouse.click(0, 0); // Click away so popup disappears + await (await /** @type {import('@playwright/test').Frame} */ (popup_frame).frameElement()).waitForElementState('hidden'); // Wait for popup to disappear }; // Test document 1 |