Skip to content

Commit 6c63960

Browse files
authored
Merge pull request #149 from synonymdev/feat/price-widget-v61
test: adjust price widget v61
2 parents 6be4e0c + 3e0c231 commit 6c63960

2 files changed

Lines changed: 16 additions & 19 deletions

File tree

test/helpers/navigation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export async function openSupport() {
2727
* Closes the drawer and navigates back to the Wallet home screen.
2828
*/
2929
export async function doNavigationClose() {
30+
await sleep(500);
3031
await tap('HeaderMenu');
3132
await tap('DrawerWallet');
3233
await sleep(500);

test/specs/widgets.e2e.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,19 @@ describe('@widgets - Widgets', () => {
3434
await tap('WidgetEdit');
3535
await elementById('WidgetEditPreview').waitForDisplayed();
3636
// Select BTC/EUR row
37-
await tap('WidgetEditField-BTC/EUR');
37+
await tap(driver.isAndroid ? 'BTC/EUR_setting_row' : 'WidgetEditField-BTC/EUR');
3838
await sleep(1000); // Wait for the UI to settle
3939

4040
// Scroll the edit view
4141
await swipeFullScreen('up');
4242
await swipeFullScreen('up');
4343
await sleep(500);
4444

45-
// Set timeframe and show source
46-
await tap('WidgetEditField-1W');
47-
await tap('WidgetEditField-showSource');
45+
// Set timeframe and, on iOS, keep testing the existing source toggle.
46+
await tap(driver.isAndroid ? '1W_setting_row' : 'WidgetEditField-1W');
47+
if (driver.isIOS) {
48+
await tap('WidgetEditField-showSource');
49+
}
4850
await sleep(1000); // Wait for the UI to settle
4951

5052
// Preview and save
@@ -66,7 +68,6 @@ describe('@widgets - Widgets', () => {
6668
// Assertions
6769
await elementById('PriceWidget').waitForDisplayed();
6870
await elementById('PriceWidgetRow-BTC/EUR').waitForDisplayed();
69-
await elementById('PriceWidgetSource').waitForDisplayed();
7071

7172
// --- Edit the Price widget back to defaults ---
7273
await tap('WidgetsEdit');
@@ -91,17 +92,12 @@ describe('@widgets - Widgets', () => {
9192
// After saving, widget should remain visible…
9293
await elementById('PriceWidget').waitForDisplayed();
9394

94-
// …but the BTC/EUR row and Source label should be gone
95+
// …but the BTC/EUR row should be gone
9596
await elementById('PriceWidgetRow-BTC/EUR').waitForDisplayed({
9697
reverse: true,
9798
timeout: 8000,
9899
interval: 250,
99100
});
100-
await elementById('PriceWidgetSource').waitForDisplayed({
101-
reverse: true,
102-
timeout: 8000,
103-
interval: 250,
104-
});
105101

106102
// Delete Price Widget
107103
await tap('WidgetsEdit');
@@ -162,14 +158,14 @@ describe('@widgets - Widgets', () => {
162158
await elementById('PriceWidget').waitForDisplayed();
163159
await elementById('SuggestionsWidget').waitForDisplayed();
164160
await elementById('BlocksWidget').waitForDisplayed();
165-
await elementByText('Bitcoin Price').waitForDisplayed();
161+
if (driver.isAndroid) {
162+
await elementByText('Bitcoin Price').waitForDisplayed({
163+
reverse: true,
164+
timeout: 5000,
165+
});
166+
} else {
167+
await elementByText('Bitcoin Price').waitForDisplayed();
168+
}
166169
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();
174170
});
175171
});

0 commit comments

Comments
 (0)