|
6 | 6 | swipeFullScreen, |
7 | 7 | completeOnboarding, |
8 | 8 | deleteAllDefaultWidgets, |
| 9 | + doNavigationClose, |
9 | 10 | } from '../helpers/actions'; |
| 11 | +import { openSettings } from '../helpers/navigation'; |
10 | 12 | import { reinstallApp } from '../helpers/setup'; |
11 | 13 | import { ciIt } from '../helpers/suite'; |
12 | 14 |
|
@@ -108,4 +110,66 @@ describe('@widgets - Widgets', () => { |
108 | 110 | await elementByText('Yes, Delete').click(); |
109 | 111 | await elementById('WidgetsAdd').waitForDisplayed(); |
110 | 112 | }); |
| 113 | + |
| 114 | + ciIt('@widgets_2 - Widget settings: reset, show/hide, titles', async () => { |
| 115 | + await deleteAllDefaultWidgets(); |
| 116 | + |
| 117 | + // Reset widgets via Widget Settings |
| 118 | + await openSettings(); |
| 119 | + await tap('WidgetsSettings'); |
| 120 | + await tap('ResetWidgets'); |
| 121 | + await tap('DialogConfirm'); |
| 122 | + await sleep(1000); |
| 123 | + |
| 124 | + // Verify widgets are restored |
| 125 | + await swipeFullScreen('up'); |
| 126 | + await elementById('PriceWidget').waitForDisplayed(); |
| 127 | + await elementById('SuggestionsWidget').waitForDisplayed(); |
| 128 | + await elementById('BlocksWidget').waitForDisplayed(); |
| 129 | + |
| 130 | + // Toggle off "Show Widgets" |
| 131 | + await openSettings(); |
| 132 | + await tap('WidgetsSettings'); |
| 133 | + await tap('ShowWidgets'); |
| 134 | + await tap('NavigationBack'); |
| 135 | + await doNavigationClose(); |
| 136 | + |
| 137 | + // Verify widgets are hidden on home |
| 138 | + await swipeFullScreen('up'); |
| 139 | + await elementById('PriceWidget').waitForDisplayed({ |
| 140 | + reverse: true, |
| 141 | + timeout: 5000, |
| 142 | + }); |
| 143 | + await elementById('SuggestionsWidget').waitForDisplayed({ |
| 144 | + reverse: true, |
| 145 | + timeout: 5000, |
| 146 | + }); |
| 147 | + await elementById('BlocksWidget').waitForDisplayed({ |
| 148 | + reverse: true, |
| 149 | + timeout: 5000, |
| 150 | + }); |
| 151 | + |
| 152 | + // Toggle on "Show Widgets" + enable "Show Widget Titles" |
| 153 | + await openSettings(); |
| 154 | + await tap('WidgetsSettings'); |
| 155 | + await tap('ShowWidgets'); |
| 156 | + await tap('ShowWidgetTitles'); |
| 157 | + await tap('NavigationBack'); |
| 158 | + await doNavigationClose(); |
| 159 | + |
| 160 | + // Verify widgets visible with titles |
| 161 | + await swipeFullScreen('up'); |
| 162 | + await elementById('PriceWidget').waitForDisplayed(); |
| 163 | + await elementById('SuggestionsWidget').waitForDisplayed(); |
| 164 | + await elementById('BlocksWidget').waitForDisplayed(); |
| 165 | + await elementByText('Bitcoin Price').waitForDisplayed(); |
| 166 | + await elementByText('Bitcoin Blocks').waitForDisplayed(); |
| 167 | + |
| 168 | + // Cleanup: disable widget titles to restore defaults |
| 169 | + await openSettings(); |
| 170 | + await tap('WidgetsSettings'); |
| 171 | + await tap('ShowWidgetTitles'); |
| 172 | + await tap('NavigationBack'); |
| 173 | + await doNavigationClose(); |
| 174 | + }); |
111 | 175 | }); |
0 commit comments