📄 selectanote.java
字号:
package com.example.android.notepad;import static com.googlecode.autoandroid.positron.PositronAPI.Key.DOWN;import static com.googlecode.autoandroid.positron.PositronAPI.Key.UP;import static java.lang.String.format;import static org.junit.Assert.assertEquals;import static org.junit.Assert.assertTrue;import org.junit.Before;import org.junit.Test;import com.googlecode.autoandroid.positron.junit4.TestCase;public class SelectANote extends TestCase { @Before public void setUp() { sql("note_pad.db", "DELETE FROM notes;"); sql("note_pad.db", "INSERT INTO notes VALUES (1, 'Get some milk', 'Get some milk', 0, 0);"); sql("note_pad.db", "INSERT INTO notes VALUES (2, 'Nap in the hammock', 'Nap in the hammock', 0, 0);"); sql("note_pad.db", "INSERT INTO notes VALUES (3, 'Walk the allegator.', 'Walk the allegator.', 0, 0);"); startActivity("com.example.android.notepad", "com.example.android.notepad.NotesList"); pause(); } @Test public void shouldChangeSelectionWithTheArrowKeys() { press(DOWN, DOWN, DOWN, UP); int selectedItemPosition = intAt("selectedItemPosition"); assertEquals("Nap in the hammock", stringAt(format("listView.%d.text", selectedItemPosition))); } @Test public void shouldSelectByTouchingAnEntry() { touch("listView.1"); assertTrue(waitFor("class.simpleName", "NoteEditor", 500)); assertEquals("Nap in the hammock", stringAt("#note.text")); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -