【问题标题】:How to insert code in monaco editor using Playwright?如何使用 Playwright 在 monaco 编辑器中插入代码?
【发布时间】:2021-11-21 07:57:27
【问题描述】:

我是 Playwright 的新手,我正在尝试测试包含 monaco 编辑器的功能,但在 Playwright 文档和论坛中找不到任何相关内容。 p>

这是我的测试:

async ({ page }) => {
    const testPage= new TestPage(page);

    await testPage.navigateTo();
    //dosomething
    await page.waitForSelector(#monaco-editor-selector);
    //Paste a script in monaco editor
}

请帮忙!

【问题讨论】:

    标签: javascript typescript playwright playwright-test


    【解决方案1】:

    const { test,expect } = require('@playwright/test')

    test('登录', async({ page }) => {
    等待 page.goto('https://URL')
    等待期望(page).toHaveTitle('someTITLE')
    等待 page.click('selector'); //如果需要步骤
    await page.fill('#monaco-editor-selector', 'YOUR_CODE');
    })

    试试这个 - 也许有帮助

    【讨论】:

      猜你喜欢
      • 2017-04-11
      • 2019-05-14
      • 2017-11-30
      • 1970-01-01
      • 1970-01-01
      • 2020-06-06
      • 1970-01-01
      • 2018-01-15
      • 1970-01-01
      相关资源
      最近更新 更多