chore: optimize generate code (#63)

This commit is contained in:
Zhou xiao 2024-08-21 16:28:58 +08:00 committed by GitHub
parent bc85f7cd2d
commit 2d1b326007
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 169 deletions

View File

@ -20,73 +20,6 @@ exports[`extractor > basic 1`] = `
},
"content": "User Name: Stella",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "ID
Field 2
Field 3
Field 4
Field 5
30S
Kace Cervantes
Aylin Sawyer
Jefferson Kirby
Skyla Jefferson
70U
Florence Davenport
Dariel Acevedo
Ashlynn Delacruz
Memphis Leal
3AY
Crystal Newman
Anderson Brown
Charlotte Griffith
Franklin Everett
YPG
Kori Payne
Edward Blevins
Aila Gill
Matthias Reed
ZEN
Magnolia Duke
Kalel Glover
Alessia Barton
Cassius Peck",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "ID
Field 2
Field 3
Field 4
Field 5",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "ID
Field 2
Field 3
Field 4
Field 5",
},
{
"attributes": {
"nodeType": "TEXT Node",
@ -117,54 +50,6 @@ exports[`extractor > basic 1`] = `
},
"content": "Field 5",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "30S
Kace Cervantes
Aylin Sawyer
Jefferson Kirby
Skyla Jefferson
70U
Florence Davenport
Dariel Acevedo
Ashlynn Delacruz
Memphis Leal
3AY
Crystal Newman
Anderson Brown
Charlotte Griffith
Franklin Everett
YPG
Kori Payne
Edward Blevins
Aila Gill
Matthias Reed
ZEN
Magnolia Duke
Kalel Glover
Alessia Barton
Cassius Peck",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "30S
Kace Cervantes
Aylin Sawyer
Jefferson Kirby
Skyla Jefferson",
},
{
"attributes": {
"nodeType": "TEXT Node",
@ -195,16 +80,6 @@ exports[`extractor > basic 1`] = `
},
"content": "Skyla Jefferson",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "70U
Florence Davenport
Dariel Acevedo
Ashlynn Delacruz
Memphis Leal",
},
{
"attributes": {
"nodeType": "TEXT Node",
@ -235,16 +110,6 @@ exports[`extractor > basic 1`] = `
},
"content": "Memphis Leal",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "3AY
Crystal Newman
Anderson Brown
Charlotte Griffith
Franklin Everett",
},
{
"attributes": {
"nodeType": "TEXT Node",
@ -275,16 +140,6 @@ exports[`extractor > basic 1`] = `
},
"content": "Franklin Everett",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "YPG
Kori Payne
Edward Blevins
Aila Gill
Matthias Reed",
},
{
"attributes": {
"nodeType": "TEXT Node",
@ -315,16 +170,6 @@ exports[`extractor > basic 1`] = `
},
"content": "Matthias Reed",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "ZEN
Magnolia Duke
Kalel Glover
Alessia Barton
Cassius Peck",
},
{
"attributes": {
"nodeType": "TEXT Node",
@ -355,16 +200,6 @@ exports[`extractor > basic 1`] = `
},
"content": "Cassius Peck",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "Form
Name:
Click Me
Shape",
},
{
"attributes": {
"nodeType": "TEXT Node",
@ -373,11 +208,16 @@ exports[`extractor > basic 1`] = `
},
{
"attributes": {
"for": "name",
"nodeType": "TEXT Node",
},
"content": "Name:",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "",
},
{
"attributes": {
"id": "J_input",
@ -386,18 +226,36 @@ exports[`extractor > basic 1`] = `
},
"content": "Hello World This is Placeholder",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "",
},
{
"attributes": {
"nodeType": "BUTTON Node",
},
"content": "Click Me",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "Shape",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "",
},
{
"attributes": {
"nodeType": "INPUT Node",
@ -415,8 +273,12 @@ exports[`extractor > basic 1`] = `
},
{
"attributes": {
"class": ".gh-ar-hdn",
"for": "gh-ac",
"nodeType": "TEXT Node",
},
"content": "",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "输入搜索关键词",
@ -445,5 +307,11 @@ exports[`extractor > basic 1`] = `
},
"content": "搜索任何物品",
},
{
"attributes": {
"nodeType": "TEXT Node",
},
"content": "",
},
]
`;

View File

@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest';
import { launchPage } from '../ai/puppeteer/utils';
const pagePath = join(__dirname, './fixtures/extractor.html');
describe.skipIf(typeof process.env.CI !== 'undefined')(
describe(
'extractor',
() => {
it('basic', async () => {