From 150fe421d6b694fefd89c0374d0f29051940cc17 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 22 Sep 2023 17:49:41 -0700 Subject: [PATCH] Fixes to tests (#1518) --- __e2e__/tests/create-account.test.ts | 2 ++ ...e-codes.test-skip.ts => invite-codes.test.ts} | 16 +++++++++------- __e2e__/tests/profile-screen.test.ts | 2 +- src/view/com/testing/TestCtrls.e2e.tsx | 12 ++++++++++++ 4 files changed, 24 insertions(+), 8 deletions(-) rename __e2e__/tests/{invite-codes.test-skip.ts => invite-codes.test.ts} (84%) diff --git a/__e2e__/tests/create-account.test.ts b/__e2e__/tests/create-account.test.ts index f6ab0a49..283eda34 100644 --- a/__e2e__/tests/create-account.test.ts +++ b/__e2e__/tests/create-account.test.ts @@ -29,6 +29,8 @@ describe('Create account', () => { await element(by.id('continueBtn')).tap() await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible() await element(by.id('continueBtn')).tap() + await expect(element(by.id('recommendedFollowsOnboarding'))).toBeVisible() + await element(by.id('continueBtn')).tap() await expect(element(by.id('homeScreen'))).toBeVisible() }) }) diff --git a/__e2e__/tests/invite-codes.test-skip.ts b/__e2e__/tests/invite-codes.test.ts similarity index 84% rename from __e2e__/tests/invite-codes.test-skip.ts rename to __e2e__/tests/invite-codes.test.ts index f5d2bafb..124c1af9 100644 --- a/__e2e__/tests/invite-codes.test-skip.ts +++ b/__e2e__/tests/invite-codes.test.ts @@ -18,16 +18,12 @@ describe('invite-codes', () => { it('I can fetch invite codes', async () => { await expect(element(by.id('signInButton'))).toBeVisible() await loginAsAlice() - await element(by.id('viewHeaderDrawerBtn')).tap() - await expect(element(by.id('drawer'))).toBeVisible() - await element(by.id('menuItemInviteCodes')).tap() + await element(by.id('e2eOpenInviteCodesModal')).tap() await expect(element(by.id('inviteCodesModal'))).toBeVisible() const attrs = await element(by.id('inviteCode-0-code')).getAttributes() inviteCode = attrs.text await element(by.id('closeBtn')).tap() - await element(by.id('viewHeaderDrawerBtn')).tap() - await element(by.id('menuItemButton-Settings')).tap() - await element(by.id('signOutBtn')).tap() + await element(by.id('e2eSignOut')).tap() }) it('I can create a new account with the invite code', async () => { @@ -51,12 +47,18 @@ describe('invite-codes', () => { await element(by.id('continueBtn')).tap() await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible() await element(by.id('continueBtn')).tap() + await expect(element(by.id('recommendedFollowsOnboarding'))).toBeVisible() + await element(by.id('continueBtn')).tap() await expect(element(by.id('homeScreen'))).toBeVisible() }) it('I get a notification for the new user', async () => { + await element(by.id('e2eSignOut')).tap() await loginAsAlice() - await element(by.id('menuItemButton-Notifications')).tap() + await waitFor(element(by.id('homeScreen'))) + .toBeVisible() + .withTimeout(5000) + await element(by.id('bottomBarNotificationsBtn')).tap() await expect(element(by.id('invitedUser'))).toBeVisible() }) diff --git a/__e2e__/tests/profile-screen.test.ts b/__e2e__/tests/profile-screen.test.ts index 101aaf61..82722f38 100644 --- a/__e2e__/tests/profile-screen.test.ts +++ b/__e2e__/tests/profile-screen.test.ts @@ -19,7 +19,7 @@ describe('Profile screen', () => { it('Can see feeds', async () => { await element(by.id('selector')).swipe('left') await element(by.id('selector-4')).tap() - await expect(element(by.id('feed-alices feed'))).toBeVisible() + await expect(element(by.id('feed-alice-favs'))).toBeVisible() await element(by.id('selector')).swipe('right') await element(by.id('selector-0')).tap() }) diff --git a/src/view/com/testing/TestCtrls.e2e.tsx b/src/view/com/testing/TestCtrls.e2e.tsx index 019c7a50..3f2b2fd0 100644 --- a/src/view/com/testing/TestCtrls.e2e.tsx +++ b/src/view/com/testing/TestCtrls.e2e.tsx @@ -41,6 +41,12 @@ export function TestCtrls() { accessibilityRole="button" style={BTN} /> + store.session.logout()} + accessibilityRole="button" + style={BTN} + /> navigate('Home')} @@ -71,6 +77,12 @@ export function TestCtrls() { accessibilityRole="button" style={BTN} /> + store.shell.openModal({name: 'invite-codes'})} + accessibilityRole="button" + style={BTN} + /> ) }