-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwidgets.e2e.ts
More file actions
145 lines (124 loc) · 3.92 KB
/
Copy pathwidgets.e2e.ts
File metadata and controls
145 lines (124 loc) · 3.92 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import {
elementById,
elementByText,
sleep,
tap,
swipeFullScreen,
completeOnboarding,
doNavigationClose,
} from '../helpers/actions';
import { openSettings } from '../helpers/navigation';
import { reinstallApp } from '../helpers/setup';
import { ciIt } from '../helpers/suite';
import {
addWidget,
deleteAllDefaultWidgets,
deleteWidget,
expectWidgetPresent,
expectWidgetSavedInEditList,
openSavedWidgetPreview,
openWidgetPreview,
openWidgetSettings,
scrollHomeToWidgets,
type WidgetId,
} from '../helpers/widgets';
describe('@widgets - Widgets', () => {
beforeEach(async () => {
await reinstallApp();
await completeOnboarding();
});
ciIt('@widgets_1 - Can add/edit/remove the price widget', async () => {
await deleteAllDefaultWidgets();
await openWidgetPreview('price');
await elementByText('Default').waitForDisplayed();
await openWidgetSettings('price');
await tap('BTC/EUR_setting_row');
await sleep(1000);
await swipeFullScreen('up');
await swipeFullScreen('up');
await sleep(500);
await tap('1W_setting_row');
await sleep(1000);
await tap('WidgetEditPreview');
await sleep(500);
await tap('WidgetSave');
try {
await expectWidgetPresent('price');
} catch {
await tap('WidgetSave');
}
await expectWidgetPresent('price');
await scrollHomeToWidgets();
await elementById('PriceWidgetRow-BTC/EUR').waitForDisplayed();
await openSavedWidgetPreview('price');
await elementByText('Custom').waitForDisplayed();
await openWidgetSettings('price');
await tap('WidgetEditReset');
await sleep(1000);
await tap('WidgetEditPreview');
await elementById('WidgetSave').waitForDisplayed();
await sleep(1000);
await tap('WidgetSave');
await sleep(1000);
await expectWidgetPresent('price');
await elementById('PriceWidgetRow-BTC/EUR').waitForDisplayed({
reverse: true,
timeout: 8000,
interval: 250,
});
await deleteWidget('price');
});
ciIt('@widgets_2 - Can add/remove redesigned content widgets', async () => {
const contentWidgets: WidgetId[] = ['blocks', 'news', 'facts', 'weather', 'calculator'];
await deleteAllDefaultWidgets();
for (const widget of contentWidgets) {
await addWidget(widget);
await expectWidgetSavedInEditList(widget);
await deleteWidget(widget);
}
});
ciIt('@widgets_3 - Widget settings: reset, show/hide, titles', async () => {
await deleteAllDefaultWidgets();
await openSettings();
await tap('WidgetsSettings');
await tap('ResetWidgets');
await tap('DialogConfirm');
await sleep(1000);
await scrollHomeToWidgets();
await expectWidgetPresent('price');
await expectWidgetPresent('suggestions');
await expectWidgetPresent('blocks');
await openSettings();
await tap('WidgetsSettings');
await tap('ShowWidgets');
await tap('NavigationBack');
await doNavigationClose();
await scrollHomeToWidgets();
await expectWidgetPresent('price', false, { timeout: 5000 });
await expectWidgetPresent('suggestions', false, { timeout: 5000 });
await expectWidgetPresent('blocks', false, { timeout: 5000 });
await openSettings();
await tap('WidgetsSettings');
await tap('ShowWidgets');
await tap('ShowWidgetTitles');
await tap('NavigationBack');
await doNavigationClose();
await scrollHomeToWidgets();
await expectWidgetPresent('price');
await expectWidgetPresent('suggestions');
await expectWidgetPresent('blocks');
if (driver.isAndroid) {
await elementByText('Bitcoin Price').waitForDisplayed({
reverse: true,
timeout: 5000,
});
await elementByText('Bitcoin Blocks').waitForDisplayed({
reverse: true,
timeout: 5000,
});
} else {
await elementByText('Bitcoin Price').waitForDisplayed();
await elementByText('Bitcoin Blocks').waitForDisplayed();
}
});
});