-
Notifications
You must be signed in to change notification settings - Fork 4
/
todo.matchers.js
32 lines (29 loc) · 1.03 KB
/
todo.matchers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* Access element by Detox matchers
* The full list of matchers is available here : https://github.com/wix/detox/blob/master/docs/APIRef.Matchers.md#bytypenativeviewtype
*/
const PageObjectModel = (element) => {
/* Simple ones */
const list = element(by.id('todoList'));
const touchableFifteenth = element(by.id('touchable-todo-15'));
const unknownComponent = element(by.id('unknownComponent'));
const newTodoItem = element(by.text('Stuff'));
const inputAdder = element(by.type('UITextField'));
const switchHideChecked = element(by.traits(['button']));
const getMarriedTodo = element(by.text('Do Get married'));
/* Advanced ones */
const textAdd = element(by.id('textAdd').withAncestor(by.id('touchableAdder')));
const touchableAdder = element(by.id('touchableAdder').withDescendant(by.id('textAdd')));
return {
list,
touchableFifteenth,
unknownComponent,
textAdd,
touchableAdder,
getMarriedTodo,
newTodoItem,
inputAdder,
switchHideChecked,
};
};
module.exports = PageObjectModel;