1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-09 00:36:41 +02:00

Fix markdown-shortcuts.test.ts for webkit (#5367)

* Fix test failure on webkit

* Increase Playwright timeout
This commit is contained in:
Joe Anderson
2023-03-16 23:20:41 +00:00
committed by GitHub
parent 4244a8d67c
commit a9c0e37472
3 changed files with 7 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ const retries = process.env.PLAYWRIGHT_RETRIES
const config: PlaywrightTestConfig = { const config: PlaywrightTestConfig = {
testDir: './playwright', testDir: './playwright',
/* Maximum time one test can run for. */ /* Maximum time one test can run for. */
timeout: 10 * 1000, timeout: 20 * 1000,
expect: { expect: {
/** /**
* Maximum time expect() should wait for the condition to be met. * Maximum time expect() should wait for the condition to be met.

View File

@@ -1,5 +1,7 @@
import { test, expect, Page } from '@playwright/test' import { test, expect, Page } from '@playwright/test'
test.setTimeout(60 * 1000)
test.describe('code highlighting', () => { test.describe('code highlighting', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
page.goto('http://localhost:3000/examples/code-highlighting') page.goto('http://localhost:3000/examples/code-highlighting')

View File

@@ -14,7 +14,7 @@ test.describe('On markdown-shortcuts example', () => {
).toContain('A wise quote.') ).toContain('A wise quote.')
}) })
test('can add list items', async ({ page }) => { test('can add list items', async ({ page }, testInfo) => {
expect( expect(
await page await page
.getByRole('textbox') .getByRole('textbox')
@@ -23,7 +23,9 @@ test.describe('On markdown-shortcuts example', () => {
).toBe(0) ).toBe(0)
await page.getByRole('textbox').click() await page.getByRole('textbox').click()
await page.getByRole('textbox').press('Home') await page
.getByRole('textbox')
.press(testInfo.project.name === 'webkit' ? 'Meta+ArrowLeft' : 'Home')
await page.getByRole('textbox').type('* 1st Item') await page.getByRole('textbox').type('* 1st Item')
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await page.getByRole('textbox').type('2nd Item') await page.getByRole('textbox').type('2nd Item')