feat: 根目录文档、脚本、gitignore
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import io, sys
|
||||
from playwright.sync_api import sync_playwright
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||||
BASE = 'http://localhost:8088'
|
||||
with sync_playwright() as p:
|
||||
b = p.chromium.launch(channel='chrome', headless=True)
|
||||
page = b.new_page(viewport={'width': 1600, 'height': 1000})
|
||||
page.goto(BASE, wait_until='domcontentloaded'); page.wait_for_timeout(2500)
|
||||
page.locator('input[placeholder="用户名"]').fill('admin')
|
||||
page.locator('input[placeholder="密码"]').fill('123456')
|
||||
page.locator('text="登录"').first.click(); page.wait_for_timeout(8000)
|
||||
page.goto(f'{BASE}/#/worktime/count', wait_until='domcontentloaded'); page.wait_for_timeout(8000)
|
||||
page.locator('.el-tabs__item:has-text("月报"):visible').first.click(); page.wait_for_timeout(5000)
|
||||
sels = page.locator('.el-select:visible')
|
||||
for i in range(sels.count()):
|
||||
try:
|
||||
print(i, repr(sels.nth(i).locator('input').first.input_value()))
|
||||
except Exception as e:
|
||||
print(i, 'err')
|
||||
# 点第二个(产品集)
|
||||
sels.nth(1).click(); page.wait_for_timeout(2000)
|
||||
opts = page.locator('.el-select-dropdown:visible li')
|
||||
print('options:', opts.count())
|
||||
for i in range(min(opts.count(), 15)):
|
||||
print(' -', opts.nth(i).inner_text()[:40])
|
||||
b.close()
|
||||
print('done')
|
||||
Reference in New Issue
Block a user