feat: 新增开发规划

This commit is contained in:
duanshuwen
2026-04-14 07:36:40 +08:00
parent 66db6c462e
commit b3f07c4cfe
8 changed files with 1050 additions and 34 deletions

View File

@@ -54,6 +54,16 @@
"channel": "",
"createdAt": "2026-04-09T19:29:52.000Z",
"updatedAt": "2026-04-09T19:29:52.000Z"
},
{
"id": "script-1776072351629-vw8at",
"name": "test_truoa",
"description": "cs",
"filename": "test-truoa.mjs",
"enabled": true,
"channel": "https://trvoa-usa.inruan.com/",
"createdAt": "2026-04-13T09:25:51.629Z",
"updatedAt": "2026-04-13T09:32:00.457Z"
}
]
}

View File

@@ -0,0 +1,37 @@
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({
channel: 'chrome',
headless: false
});
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('https://trvoa-usa.inruan.com/login.html');
await page.getByRole('textbox', { name: '用户名:' }).click();
await page.getByRole('textbox', { name: '用户名:' }).fill('testir888');
await page.getByRole('textbox', { name: '密码:' }).click();
await page.getByRole('textbox', { name: '密码:' }).fill('testir888');
await page.getByText('登录').click();
await page.getByText('总计划模块').click();
await page.getByRole('link', { name: '创建总计划' }).click();
await page.locator('iframe').nth(1).contentFrame().locator('.textbox.textbox-invalid > .textbox-addon > .textbox-icon').first().click();
await page.locator('iframe').nth(1).contentFrame().getByText('trvoa1').click();
await page.locator('iframe').nth(1).contentFrame().locator('.tr-of-operator > td:nth-child(2) > .textbox.combo > .textbox-text').click();
await page.locator('iframe').nth(1).contentFrame().locator('.textbox.combo.textbox-focused > .textbox-addon > .textbox-icon').click();
await page.locator('iframe').nth(1).contentFrame().getByText('JOY').click();
await page.locator('iframe').nth(1).contentFrame().locator('.tr-of-manager > td:nth-child(2) > .textbox.combo > .textbox-addon > .textbox-icon').click();
await page.locator('iframe').nth(1).contentFrame().getByText('IT测试').click();
await page.locator('iframe').nth(1).contentFrame().getByRole('link', { name: '保存' }).nth(1).click();
await page.locator('iframe').nth(1).contentFrame().locator('.textbox.textbox-invalid > .textbox-addon > .textbox-icon').click();
await page.locator('iframe').nth(1).contentFrame().getByText('北京竹园2[bjzy]').click();
await page.locator('iframe').nth(1).contentFrame().getByRole('link', { name: '保存' }).nth(1).click();
await page.locator('iframe').nth(1).contentFrame().getByRole('link', { name: '确定' }).click();
// ---------------------
await context.close();
await browser.close();
})();