mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
* 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:
@@ -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 ) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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( );
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user