Skip to content

Commit f2755fe

Browse files
committed
feat: 为输入框添加默认文本并在主进程中处理下拉选择
1 parent 79302c0 commit f2755fe

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

playground/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<button id="btn2">按钮2</button>
4040
</div>
4141
<div>
42-
<input type="text" id="inputBox" placeholder="在此输入文本" />
42+
<input type="text" id="inputBox" placeholder="在此输入文本" value="默认文本" />
4343
<br />
4444
<textarea id="textArea" placeholder="在此输入多行文本"></textarea>
4545
<br />

playground/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ async function createWindow() {
3131
const textArea = ectrol.$('#textArea')
3232
const checkbox1 = ectrol.$('#checkbox1')
3333
const radio2 = ectrol.$('#radio2')
34+
const dropdown = ectrol.$('#dropdown')
3435

3536
await new Promise(resolve => setTimeout(resolve, 5000))
3637

@@ -45,6 +46,7 @@ async function createWindow() {
4546
await textArea.fill('This is a text area.\n多行文本测试。')
4647
await checkbox1.check()
4748
await radio2.check()
49+
await dropdown.selectOption('option2')
4850

4951
/** ------------------------------------------------------------------------------------------------- */
5052

@@ -54,6 +56,7 @@ async function createWindow() {
5456
const iframe_textArea = ectrol.$('iframe|>textarea#textArea')
5557
const iframe_checkbox1 = ectrol.$('iframe|>input#checkbox1')
5658
const iframe_radio2 = ectrol.$('iframe|>input#radio2')
59+
const iframe_dropdown = ectrol.$('iframe|>select#dropdown')
5760

5861
await new Promise(resolve => setTimeout(resolve, 3000))
5962
await iframe_btn1.click()
@@ -67,6 +70,7 @@ async function createWindow() {
6770
await iframe_textArea.fill('This is a text area.\n多行文本测试。')
6871
await iframe_checkbox1.check()
6972
await iframe_radio2.check()
73+
await iframe_dropdown.selectOption('option2')
7074
})
7175
}
7276

0 commit comments

Comments
 (0)