Fix #2572 - New design for MyObservations - default mode, logged out,… (#2650)

* Fix #2572 - New design for MyObservations - default mode, logged out, no observations

* Fixed tests

* Update close onboarding part of e2e tests

* Update sign-in for e2e

* Update loadTranslations.js

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
This commit is contained in:
budowski
2025-02-07 10:09:54 +01:00
committed by GitHub
parent 1b49df2822
commit 6cbfcc5be7
13 changed files with 45 additions and 34 deletions

View File

@@ -7,7 +7,7 @@ import {
const VISIBILITY_TIMEOUT = 10_000;
export default async function closeOnboarding( ) {
const loginText = element( by.id( "log-in-to-iNaturalist-button.text" ) );
const loginText = element( by.id( "use-iNaturalist-intro-text" ) );
await waitFor( loginText ).toExist().withTimeout( VISIBILITY_TIMEOUT );
// If we can see MyObs, we don't need to close the onboarding
if ( loginText.visible ) {

View File

@@ -4,12 +4,19 @@ import {
import Config from "react-native-config-node";
export default async function signIn() {
const loginText = element( by.id( "log-in-to-iNaturalist-button.text" ) );
// 10000 timeout is for github actions, which was failing with a
// shorter timeout period
await waitFor( loginText ).toBeVisible().withTimeout( 10000 );
await expect( loginText ).toBeVisible();
await element( by.id( "log-in-to-iNaturalist-button.text" ) ).tap();
// Find the Menu item from tabs
const openDrawerMenuItem = element( by.id( "OPEN_DRAWER" ) );
await waitFor( openDrawerMenuItem ).toBeVisible().withTimeout( 10000 );
await expect( openDrawerMenuItem ).toBeVisible();
await element( by.id( "OPEN_DRAWER" ) ).tap();
// Tap the Log-In menu item
// TODO: consider this a temporary solution as it only checks for the drawer-top-banner
// which can be a login prompt or the logged in user's details. If the user is already
// logged in, this should fail instead.
const loginMenuItem = element( by.id( "drawer-top-banner" ) );
await waitFor( loginMenuItem ).toBeVisible().withTimeout( 10000 );
await expect( loginMenuItem ).toBeVisible();
await element( by.id( "drawer-top-banner" ) ).tap();
const usernameInput = element( by.id( "Login.email" ) );
await waitFor( usernameInput ).toBeVisible().withTimeout( 10000 );
await expect( usernameInput ).toBeVisible();

View File

@@ -15,7 +15,7 @@ describe( "Signed out user", () => {
it( "should start at My Observations with log in text", async () => {
await closeOnboarding( );
const loginText = element( by.id( "log-in-to-iNaturalist-button.text" ) );
const loginText = element( by.id( "use-iNaturalist-intro-text" ) );
await waitFor( loginText ).toBeVisible( ).withTimeout( 10000 );
await expect( loginText ).toBeVisible( );
} );