Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions test/helpers/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export type WidgetId =
| 'suggestions'
| 'calculator';

const DEFAULT_WIDGETS: WidgetId[] = ['price', 'blocks', 'news', 'facts', 'weather', 'suggestions', 'calculator'];

type WidgetMetadata = {
listItemId: string;
actionName: string;
Expand Down Expand Up @@ -61,8 +63,6 @@ const WIDGETS: Record<WidgetId, WidgetMetadata> = {
},
};

const DEFAULT_WIDGETS: WidgetId[] = ['price', 'blocks', 'suggestions'];

function widgetMetadata(widget: WidgetId): WidgetMetadata {
return WIDGETS[widget];
}
Expand Down Expand Up @@ -101,7 +101,7 @@ export async function scrollHomeToWidgets() {
export async function openWidgetsFeed() {
await scrollHomeToWidgets();
await tap('WidgetsAdd');
await tapIfDisplayed('WidgetsOnboarding-button');
await tapIfDisplayed('WidgetsOnboardingAddWidget');
}

export async function openWidgetPreview(widget: WidgetId) {
Expand All @@ -128,7 +128,6 @@ export async function openSavedWidgetPreview(widget: WidgetId) {
await scrollHomeToWidgets();
await tap('WidgetsEdit');
await tap(widgetActionId(widget, 'Edit'));
await elementById('WidgetSave').waitForDisplayed();
}

export async function expectWidgetPresent(
Expand Down
2 changes: 1 addition & 1 deletion test/specs/backup.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('@backup - Backup', () => {
await sleep(1000); // wait for the app to settle
await deleteAllDefaultWidgets();
await tap('WidgetsAdd');
await tap('WidgetsOnboarding-button');
await tap('WidgetsOnboardingAddWidget');
await tap('WidgetListItem-price');
await elementById('WidgetSave').waitForDisplayed();
await sleep(1000); // wait for the app to settle
Expand Down
11 changes: 6 additions & 5 deletions test/specs/widgets.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ describe('@widgets - Widgets', () => {
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');
Expand Down Expand Up @@ -103,7 +101,8 @@ describe('@widgets - Widgets', () => {

await scrollHomeToWidgets();
await expectWidgetPresent('price');
await expectWidgetPresent('suggestions');
await expectWidgetPresent('weather');
await expectWidgetPresent('calculator');
await expectWidgetPresent('blocks');

await openSettings();
Expand All @@ -114,7 +113,8 @@ describe('@widgets - Widgets', () => {

await scrollHomeToWidgets();
await expectWidgetPresent('price', false, { timeout: 5000 });
await expectWidgetPresent('suggestions', false, { timeout: 5000 });
await expectWidgetPresent('weather', false, { timeout: 5000 });
await expectWidgetPresent('calculator', false, { timeout: 5000 });
await expectWidgetPresent('blocks', false, { timeout: 5000 });

await openSettings();
Expand All @@ -125,7 +125,8 @@ describe('@widgets - Widgets', () => {

await scrollHomeToWidgets();
await expectWidgetPresent('price');
await expectWidgetPresent('suggestions');
await expectWidgetPresent('weather');
await expectWidgetPresent('calculator');
await expectWidgetPresent('blocks');
});
});