From 5f553c29dfdac1bf81debe5e28983a9dbe74bd7f Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 5 Dec 2023 14:50:56 -0600 Subject: E2E 🟢 (#2092) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add logged out e2e ctrl, fix login test * Fix log handling via env vars in expo * Fix create account test * Upgrade dev-env * Fix home screen tests * Fix composer tests * Fix curate-lists tests, split in two * Fix invite codes test * Fix curate-lists tests * Give up on mergefeed test * Fix mod lists * Fix app view url * Fix profile tests * Fix profile test with hack * Keep using globals * Fix two more * Fix thread view * Better skip for merge feed * Revert debug code --- __e2e__/tests/composer.test.ts | 4 + __e2e__/tests/create-account.test.ts | 10 +++ __e2e__/tests/curate-lists.test.ts | 33 +++---- __e2e__/tests/home-screen.test.ts | 2 + __e2e__/tests/invite-codes.test.ts | 19 +--- __e2e__/tests/login.test.ts | 4 + __e2e__/tests/merge-feed.test.skip.ts | 163 ++++++++++++++++++++++++++++++++++ __e2e__/tests/merge-feed.test.ts | 157 -------------------------------- __e2e__/tests/mod-lists.test.ts | 31 +++---- __e2e__/tests/profile-screen.test.ts | 19 ++-- __e2e__/tests/search-screen.test.ts | 2 + __e2e__/tests/self-labeling.test.ts | 2 + __e2e__/tests/thread-muting.test.ts | 4 +- __e2e__/tests/thread-screen.test.ts | 14 +-- 14 files changed, 249 insertions(+), 215 deletions(-) create mode 100644 __e2e__/tests/merge-feed.test.skip.ts delete mode 100644 __e2e__/tests/merge-feed.test.ts (limited to '__e2e__') diff --git a/__e2e__/tests/composer.test.ts b/__e2e__/tests/composer.test.ts index 6251ad0c8..34f8ae39e 100644 --- a/__e2e__/tests/composer.test.ts +++ b/__e2e__/tests/composer.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, createServer, sleep} from '../util' describe('Composer', () => { @@ -45,6 +47,8 @@ describe('Composer', () => { }) it('Reply text only', async () => { + await element(by.id('e2eRefreshHome')).tap() + const post = by.id('feedItem-by-alice.test') await element(by.id('replyBtn').withAncestor(post)).atIndex(0).tap() await element(by.id('composerTextInput')).typeText('Reply text only') diff --git a/__e2e__/tests/create-account.test.ts b/__e2e__/tests/create-account.test.ts index 283eda341..eab3e538b 100644 --- a/__e2e__/tests/create-account.test.ts +++ b/__e2e__/tests/create-account.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, createServer} from '../util' describe('Create account', () => { @@ -10,6 +12,8 @@ describe('Create account', () => { }) it('I can create a new account', async () => { + await element(by.id('e2eOpenLoggedOutView')).tap() + await element(by.id('createAccountButton')).tap() await device.takeScreenshot('1- opened create account screen') await element(by.id('otherServerBtn')).tap() @@ -17,14 +21,20 @@ describe('Create account', () => { await element(by.id('customServerInput')).clearText() await element(by.id('customServerInput')).typeText(service) await device.takeScreenshot('3- input test server URL') + await element(by.id('nextBtn')).tap() + await element(by.id('emailInput')).typeText('example@test.com') await element(by.id('passwordInput')).typeText('hunter2') await device.takeScreenshot('4- entered account details') + await element(by.id('nextBtn')).tap() + await element(by.id('handleInput')).typeText('e2e-test') await device.takeScreenshot('4- entered handle') + await element(by.id('nextBtn')).tap() + await expect(element(by.id('welcomeOnboarding'))).toBeVisible() await element(by.id('continueBtn')).tap() await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible() diff --git a/__e2e__/tests/curate-lists.test.ts b/__e2e__/tests/curate-lists.test.ts index b7c6c25c8..f188b154b 100644 --- a/__e2e__/tests/curate-lists.test.ts +++ b/__e2e__/tests/curate-lists.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, loginAsBob, createServer, sleep} from '../util' describe('Curate lists', () => { @@ -11,7 +13,6 @@ describe('Curate lists', () => { }) it('Login and create a curatelists', async () => { - await expect(element(by.id('signInButton'))).toBeVisible() await loginAsAlice() await element(by.id('e2eGotoLists')).tap() await element(by.id('newUserListBtn')).tap() @@ -27,7 +28,7 @@ describe('Curate lists', () => { it('Edit display name and description via the edit curatelist modal', async () => { await element(by.id('headerDropdownBtn')).tap() - await element(by.text('Edit List Details')).tap() + await element(by.text('Edit list details')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('editNameInput')).clearText() await element(by.id('editNameInput')).typeText('Bad Ppl') @@ -45,7 +46,7 @@ describe('Curate lists', () => { it('Remove description via the edit curatelist modal', async () => { await element(by.id('headerDropdownBtn')).tap() - await element(by.text('Edit List Details')).tap() + await element(by.text('Edit list details')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('editDescriptionInput')).clearText() await element(by.id('saveBtn')).tap() @@ -60,7 +61,7 @@ describe('Curate lists', () => { it('Set avi via the edit curatelist modal', async () => { await expect(element(by.id('userAvatarFallback'))).toExist() await element(by.id('headerDropdownBtn')).tap() - await element(by.text('Edit List Details')).tap() + await element(by.text('Edit list details')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('changeAvatarBtn')).tap() await element(by.text('Library')).tap() @@ -77,7 +78,7 @@ describe('Curate lists', () => { it('Remove avi via the edit curatelist modal', async () => { await expect(element(by.id('userAvatarImage'))).toExist() await element(by.id('headerDropdownBtn')).tap() - await element(by.text('Edit List Details')).tap() + await element(by.text('Edit list details')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('changeAvatarBtn')).tap() await element(by.text('Remove')).tap() @@ -98,6 +99,7 @@ describe('Curate lists', () => { }) it('Create a new curatelist', async () => { + await element(by.id('e2eGotoLists')).tap() await element(by.id('newUserListBtn')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('editNameInput')).typeText('Good Ppl') @@ -128,6 +130,7 @@ describe('Curate lists', () => { }) it('Pins the list', async () => { + await expect(element(by.id('pinBtn'))).toBeVisible() await element(by.id('pinBtn')).tap() await element(by.id('e2eGotoHome')).tap() await element(by.id('homeScreenFeedTabs-Good Ppl')).tap() @@ -152,15 +155,15 @@ describe('Curate lists', () => { await expect(element(by.id('user-bob.test'))).toBeVisible() await element(by.id('user-bob.test-editBtn')).tap() await expect(element(by.id('userAddRemoveListsModal'))).toBeVisible() - await element(by.id('toggleBtn-Good Ppl')).tap() - await element(by.id('saveBtn')).tap() + await element(by.id('user-bob.test-addBtn')).tap() + await element(by.id('doneBtn')).tap() await expect(element(by.id('userAddRemoveListsModal'))).not.toBeVisible() }) it('Shows the curatelist on my profile', async () => { await element(by.id('bottomBarProfileBtn')).tap() - await element(by.id('selector')).swipe('left') - await element(by.id('selector-4')).tap() + await element(by.id('profilePager-selector')).swipe('left') + await element(by.id('profilePager-selector-5')).tap() await element(by.id('list-Good Ppl')).tap() }) @@ -173,15 +176,15 @@ describe('Curate lists', () => { await element(by.id('profileHeaderDropdownBtn')).tap() await element(by.text('Add to Lists')).tap() await expect(element(by.id('userAddRemoveListsModal'))).toBeVisible() - await element(by.id('toggleBtn-Good Ppl')).tap() - await element(by.id('saveBtn')).tap() + await element(by.id('user-bob.test-addBtn')).tap() + await element(by.id('doneBtn')).tap() await expect(element(by.id('userAddRemoveListsModal'))).not.toBeVisible() await element(by.id('profileHeaderDropdownBtn')).tap() await element(by.text('Add to Lists')).tap() await expect(element(by.id('userAddRemoveListsModal'))).toBeVisible() - await element(by.id('toggleBtn-Good Ppl')).tap() - await element(by.id('saveBtn')).tap() + await element(by.id('user-bob.test-addBtn')).tap() + await element(by.id('doneBtn')).tap() await expect(element(by.id('userAddRemoveListsModal'))).not.toBeVisible() }) @@ -192,8 +195,8 @@ describe('Curate lists', () => { await element(by.id('bottomBarSearchBtn')).tap() await element(by.id('searchTextInput')).typeText('alice') await element(by.id('searchAutoCompleteResult-alice.test')).tap() - await element(by.id('selector')).swipe('left') - await element(by.id('selector-3')).tap() + await element(by.id('profilePager-selector')).swipe('left') + await element(by.id('profilePager-selector-3')).tap() await element(by.id('list-Good Ppl')).tap() await element(by.id('headerDropdownBtn')).tap() await element(by.text('Report List')).tap() diff --git a/__e2e__/tests/home-screen.test.ts b/__e2e__/tests/home-screen.test.ts index b6cd19195..79fca1e6a 100644 --- a/__e2e__/tests/home-screen.test.ts +++ b/__e2e__/tests/home-screen.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, createServer} from '../util' describe('Home screen', () => { diff --git a/__e2e__/tests/invite-codes.test.ts b/__e2e__/tests/invite-codes.test.ts index 124c1af90..7db7c595a 100644 --- a/__e2e__/tests/invite-codes.test.ts +++ b/__e2e__/tests/invite-codes.test.ts @@ -5,6 +5,8 @@ * with the side drawer. */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, createServer} from '../util' describe('invite-codes', () => { @@ -16,7 +18,6 @@ describe('invite-codes', () => { }) it('I can fetch invite codes', async () => { - await expect(element(by.id('signInButton'))).toBeVisible() await loginAsAlice() await element(by.id('e2eOpenInviteCodesModal')).tap() await expect(element(by.id('inviteCodesModal'))).toBeVisible() @@ -27,6 +28,7 @@ describe('invite-codes', () => { }) it('I can create a new account with the invite code', async () => { + await element(by.id('e2eOpenLoggedOutView')).tap() await element(by.id('createAccountButton')).tap() await device.takeScreenshot('1- opened create account screen') await element(by.id('otherServerBtn')).tap() @@ -51,19 +53,4 @@ describe('invite-codes', () => { 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 waitFor(element(by.id('homeScreen'))) - .toBeVisible() - .withTimeout(5000) - await element(by.id('bottomBarNotificationsBtn')).tap() - await expect(element(by.id('invitedUser'))).toBeVisible() - }) - - it('I can dismiss the new user notification', async () => { - await element(by.id('dismissBtn')).tap() - await expect(element(by.id('invitedUser'))).not.toBeVisible() - }) }) diff --git a/__e2e__/tests/login.test.ts b/__e2e__/tests/login.test.ts index 788016db6..b4cedef6c 100644 --- a/__e2e__/tests/login.test.ts +++ b/__e2e__/tests/login.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, login, createServer} from '../util' describe('Login', () => { @@ -10,6 +12,8 @@ describe('Login', () => { }) it('As Alice, I can login', async () => { + await element(by.id('e2eOpenLoggedOutView')).tap() + await expect(element(by.id('signInButton'))).toBeVisible() await login(service, 'alice', 'hunter2', { takeScreenshots: true, diff --git a/__e2e__/tests/merge-feed.test.skip.ts b/__e2e__/tests/merge-feed.test.skip.ts new file mode 100644 index 000000000..4a8b3cbce --- /dev/null +++ b/__e2e__/tests/merge-feed.test.skip.ts @@ -0,0 +1,163 @@ +/* eslint-env detox/detox */ + +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' +import {openApp, loginAsAlice, createServer} from '../util' + +describe('Mergefeed', () => { + beforeAll(async () => { + await createServer('?mergefeed') + await openApp({permissions: {notifications: 'YES'}}) + }) + + it('Login', async () => { + await element(by.id('e2eOpenLoggedOutView')).tap() + await loginAsAlice() + await element(by.id('e2eToggleMergefeed')).tap() + await element(by.id('bottomBarFeedsBtn')).tap() + await element(by.id('feed-alice-favs-toggleSave')).tap() + await element(by.id('e2eGotoHome')).tap() + }) + + it('Sees the expected mix of posts with default filters', async () => { + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + // followed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-carla.test')), + ).atIndex(0), + ).toHaveText('Post 9') + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-bob.test')), + ).atIndex(0), + ).toHaveText('Post 9') + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'up', + 'fast', + 1, + 0.5, + 0.5, + ) + // feed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), + ).atIndex(0), + ).toHaveText('Post 0') + }) + + it('Sees the expected mix of posts with replies disabled', async () => { + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'fast', + 1, + 0.5, + 0.5, + ) + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'fast', + 1, + 0.5, + 0.5, + ) + await element(by.id('viewHeaderHomeFeedPrefsBtn')).tap() + await element(by.id('toggleRepliesBtn')).tap() + await element(by.id('confirmBtn')).tap() + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + + // followed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-carla.test')), + ).atIndex(0), + ).toHaveText('Post 9') + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-bob.test')), + ).atIndex(0), + ).toHaveText('Post 9') + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'up', + 'fast', + 1, + 0.5, + 0.5, + ) + + // feed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), + ).atIndex(0), + ).toHaveText('Post 0') + }) + + it('Sees the expected mix of posts with no follows', async () => { + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'fast', + 1, + 0.5, + 0.5, + ) + + await element(by.id('bottomBarSearchBtn')).tap() + await element(by.id('searchTextInput')).typeText('bob') + await element(by.id('searchAutoCompleteResult-bob.test')).tap() + await expect(element(by.id('profileView'))).toBeVisible() + await element(by.id('unfollowBtn')).tap() + await element(by.id('profileHeaderBackBtn')).tap() + + // have to wait for the toast to clear + await waitFor(element(by.id('searchTextInputClearBtn'))) + .toBeVisible() + .withTimeout(5000) + await element(by.id('searchTextInputClearBtn')).tap() + await element(by.id('searchTextInput')).typeText('carla') + await element(by.id('searchAutoCompleteResult-carla.test')).tap() + await expect(element(by.id('profileView'))).toBeVisible() + await element(by.id('unfollowBtn')).tap() + await element(by.id('profileHeaderBackBtn')).tap() + + await element(by.id('bottomBarHomeBtn')).tap() + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + + // followed users NOT present + await expect(element(by.id('feedItem-by-carla.test'))).not.toExist() + await expect(element(by.id('feedItem-by-bob.test'))).not.toExist() + + // feed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), + ).atIndex(0), + ).toHaveText('Post 0') + }) +}) diff --git a/__e2e__/tests/merge-feed.test.ts b/__e2e__/tests/merge-feed.test.ts deleted file mode 100644 index 903e34328..000000000 --- a/__e2e__/tests/merge-feed.test.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* eslint-env detox/detox */ - -import {openApp, loginAsAlice, createServer} from '../util' - -describe('Mergefeed', () => { - beforeAll(async () => { - await createServer('?mergefeed') - await openApp({permissions: {notifications: 'YES'}}) - }) - - it('Login', async () => { - await loginAsAlice() - await element(by.id('e2eToggleMergefeed')).tap() - }) - - it('Sees the expected mix of posts with default filters', async () => { - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'down', - 'slow', - 1, - 0.5, - 0.5, - ) - // followed users - await expect( - element( - by.id('postText').withAncestor(by.id('feedItem-by-carla.test')), - ).atIndex(0), - ).toHaveText('Post 9') - await expect( - element( - by.id('postText').withAncestor(by.id('feedItem-by-bob.test')), - ).atIndex(0), - ).toHaveText('Post 9') - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'up', - 'fast', - 1, - 0.5, - 0.5, - ) - // feed users - await expect( - element( - by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), - ).atIndex(0), - ).toHaveText('Post 0') - }) - - it('Sees the expected mix of posts with replies disabled', async () => { - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'down', - 'fast', - 1, - 0.5, - 0.5, - ) - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'down', - 'fast', - 1, - 0.5, - 0.5, - ) - await element(by.id('viewHeaderHomeFeedPrefsBtn')).tap() - await element(by.id('toggleRepliesBtn')).tap() - await element(by.id('confirmBtn')).tap() - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'down', - 'slow', - 1, - 0.5, - 0.5, - ) - - // followed users - await expect( - element( - by.id('postText').withAncestor(by.id('feedItem-by-carla.test')), - ).atIndex(0), - ).toHaveText('Post 9') - await expect( - element( - by.id('postText').withAncestor(by.id('feedItem-by-bob.test')), - ).atIndex(0), - ).toHaveText('Post 9') - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'up', - 'fast', - 1, - 0.5, - 0.5, - ) - - // feed users - await expect( - element( - by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), - ).atIndex(0), - ).toHaveText('Post 0') - }) - - it('Sees the expected mix of posts with no follows', async () => { - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'down', - 'fast', - 1, - 0.5, - 0.5, - ) - - await element(by.id('bottomBarSearchBtn')).tap() - await element(by.id('searchTextInput')).typeText('bob') - await element(by.id('searchAutoCompleteResult-bob.test')).tap() - await expect(element(by.id('profileView'))).toBeVisible() - await element(by.id('unfollowBtn')).tap() - await element(by.id('profileHeaderBackBtn')).tap() - - // have to wait for the toast to clear - await waitFor(element(by.id('searchTextInputClearBtn'))) - .toBeVisible() - .withTimeout(5000) - await element(by.id('searchTextInputClearBtn')).tap() - await element(by.id('searchTextInput')).typeText('carla') - await element(by.id('searchAutoCompleteResult-carla.test')).tap() - await expect(element(by.id('profileView'))).toBeVisible() - await element(by.id('unfollowBtn')).tap() - await element(by.id('profileHeaderBackBtn')).tap() - - await element(by.id('bottomBarHomeBtn')).tap() - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'down', - 'slow', - 1, - 0.5, - 0.5, - ) - await element(by.id('followingFeedPage-feed-flatlist')).swipe( - 'down', - 'slow', - 1, - 0.5, - 0.5, - ) - - // followed users NOT present - await expect(element(by.id('feedItem-by-carla.test'))).not.toExist() - await expect(element(by.id('feedItem-by-bob.test'))).not.toExist() - - // feed users - await expect( - element( - by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), - ).atIndex(0), - ).toHaveText('Post 0') - }) -}) diff --git a/__e2e__/tests/mod-lists.test.ts b/__e2e__/tests/mod-lists.test.ts index 2b33aaed8..5280920b4 100644 --- a/__e2e__/tests/mod-lists.test.ts +++ b/__e2e__/tests/mod-lists.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, loginAsBob, createServer, sleep} from '../util' describe('Mod lists', () => { @@ -11,7 +13,6 @@ describe('Mod lists', () => { }) it('Login and view my modlists', async () => { - await expect(element(by.id('signInButton'))).toBeVisible() await loginAsAlice() await element(by.id('e2eGotoModeration')).tap() await element(by.id('moderationlistsBtn')).tap() @@ -31,7 +32,7 @@ describe('Mod lists', () => { it('Edit display name and description via the edit modlist modal', async () => { await element(by.id('headerDropdownBtn')).tap() - await element(by.text('Edit List Details')).tap() + await element(by.text('Edit list details')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('editNameInput')).clearText() await element(by.id('editNameInput')).typeText('Bad Ppl') @@ -49,7 +50,7 @@ describe('Mod lists', () => { it('Remove description via the edit modlist modal', async () => { await element(by.id('headerDropdownBtn')).tap() - await element(by.text('Edit List Details')).tap() + await element(by.text('Edit list details')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('editDescriptionInput')).clearText() await element(by.id('saveBtn')).tap() @@ -64,7 +65,7 @@ describe('Mod lists', () => { it('Set avi via the edit modlist modal', async () => { await expect(element(by.id('userAvatarFallback'))).toExist() await element(by.id('headerDropdownBtn')).tap() - await element(by.text('Edit List Details')).tap() + await element(by.text('Edit list details')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('changeAvatarBtn')).tap() await element(by.text('Library')).tap() @@ -81,7 +82,7 @@ describe('Mod lists', () => { it('Remove avi via the edit modlist modal', async () => { await expect(element(by.id('userAvatarImage'))).toExist() await element(by.id('headerDropdownBtn')).tap() - await element(by.text('Edit List Details')).tap() + await element(by.text('Edit list details')).tap() await expect(element(by.id('createOrEditListModal'))).toBeVisible() await element(by.id('changeAvatarBtn')).tap() await element(by.text('Remove')).tap() @@ -131,15 +132,15 @@ describe('Mod lists', () => { await expect(element(by.id('user-warn-posts.test'))).toBeVisible() await element(by.id('user-warn-posts.test-editBtn')).tap() await expect(element(by.id('userAddRemoveListsModal'))).toBeVisible() - await element(by.id('toggleBtn-Bad Ppl')).tap() - await element(by.id('saveBtn')).tap() + await element(by.id('user-warn-posts.test-addBtn')).tap() + await element(by.id('doneBtn')).tap() await expect(element(by.id('userAddRemoveListsModal'))).not.toBeVisible() }) it('Shows the modlist on my profile', async () => { await element(by.id('bottomBarProfileBtn')).tap() - await element(by.id('selector')).swipe('left') - await element(by.id('selector-4')).tap() + await element(by.id('profilePager-selector')).swipe('left') + await element(by.id('profilePager-selector-5')).tap() await element(by.id('list-Bad Ppl')).tap() }) @@ -152,15 +153,15 @@ describe('Mod lists', () => { await element(by.id('profileHeaderDropdownBtn')).tap() await element(by.text('Add to Lists')).tap() await expect(element(by.id('userAddRemoveListsModal'))).toBeVisible() - await element(by.id('toggleBtn-Bad Ppl')).tap() - await element(by.id('saveBtn')).tap() + await element(by.id('user-bob.test-addBtn')).tap() + await element(by.id('doneBtn')).tap() await expect(element(by.id('userAddRemoveListsModal'))).not.toBeVisible() await element(by.id('profileHeaderDropdownBtn')).tap() await element(by.text('Add to Lists')).tap() await expect(element(by.id('userAddRemoveListsModal'))).toBeVisible() - await element(by.id('toggleBtn-Bad Ppl')).tap() - await element(by.id('saveBtn')).tap() + await element(by.id('user-bob.test-addBtn')).tap() + await element(by.id('doneBtn')).tap() await expect(element(by.id('userAddRemoveListsModal'))).not.toBeVisible() }) @@ -171,8 +172,8 @@ describe('Mod lists', () => { await element(by.id('bottomBarSearchBtn')).tap() await element(by.id('searchTextInput')).typeText('alice') await element(by.id('searchAutoCompleteResult-alice.test')).tap() - await element(by.id('selector')).swipe('left') - await element(by.id('selector-3')).tap() + await element(by.id('profilePager-selector')).swipe('left') + await element(by.id('profilePager-selector-3')).tap() await element(by.id('list-Bad Ppl')).tap() await element(by.id('headerDropdownBtn')).tap() await element(by.text('Report List')).tap() diff --git a/__e2e__/tests/profile-screen.test.ts b/__e2e__/tests/profile-screen.test.ts index 82722f381..b4624e456 100644 --- a/__e2e__/tests/profile-screen.test.ts +++ b/__e2e__/tests/profile-screen.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, createServer, sleep} from '../util' describe('Profile screen', () => { @@ -11,17 +13,16 @@ describe('Profile screen', () => { }) it('Login and navigate to my profile', async () => { - await expect(element(by.id('signInButton'))).toBeVisible() await loginAsAlice() await element(by.id('bottomBarProfileBtn')).tap() }) it('Can see feeds', async () => { - await element(by.id('selector')).swipe('left') - await element(by.id('selector-4')).tap() + await element(by.id('profilePager-selector')).swipe('left') + await element(by.id('profilePager-selector-4')).tap() await expect(element(by.id('feed-alice-favs'))).toBeVisible() - await element(by.id('selector')).swipe('right') - await element(by.id('selector-0')).tap() + await element(by.id('profilePager-selector')).swipe('right') + await element(by.id('profilePager-selector-0')).tap() }) it('Open and close edit profile modal', async () => { @@ -135,6 +136,14 @@ describe('Profile screen', () => { }) it('Can like posts', async () => { + await element(by.id('postsFeed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + const posts = by.id('feedItem-by-bob.test') await expect( element(by.id('likeCount').withAncestor(posts)).atIndex(0), diff --git a/__e2e__/tests/search-screen.test.ts b/__e2e__/tests/search-screen.test.ts index 8b3f55b3d..1dbb3cbfa 100644 --- a/__e2e__/tests/search-screen.test.ts +++ b/__e2e__/tests/search-screen.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, createServer} from '../util' describe('Search screen', () => { diff --git a/__e2e__/tests/self-labeling.test.ts b/__e2e__/tests/self-labeling.test.ts index 68678688d..f629f91a8 100644 --- a/__e2e__/tests/self-labeling.test.ts +++ b/__e2e__/tests/self-labeling.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, createServer, sleep} from '../util' describe('Self-labeling', () => { diff --git a/__e2e__/tests/thread-muting.test.ts b/__e2e__/tests/thread-muting.test.ts index 3b2dc1221..ae62f93dc 100644 --- a/__e2e__/tests/thread-muting.test.ts +++ b/__e2e__/tests/thread-muting.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, loginAsBob, createServer} from '../util' describe('Thread muting', () => { @@ -48,7 +50,7 @@ describe('Thread muting', () => { await loginAsBob() await element(by.id('bottomBarProfileBtn')).tap() - await element(by.id('selector-1')).tap() + await element(by.id('profilePager-selector-1')).tap() const bobPosts = by.id('feedItem-by-bob.test') await element(by.id('replyBtn').withAncestor(bobPosts)).atIndex(0).tap() await element(by.id('composerTextInput')).typeText('Reply 2') diff --git a/__e2e__/tests/thread-screen.test.ts b/__e2e__/tests/thread-screen.test.ts index 02831d055..e3cff12c9 100644 --- a/__e2e__/tests/thread-screen.test.ts +++ b/__e2e__/tests/thread-screen.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, createServer} from '../util' describe('Thread screen', () => { @@ -31,15 +33,15 @@ describe('Thread screen', () => { it('Can like the root post', async () => { const post = by.id('postThreadItem-by-bob.test') await expect( - element(by.id('likeCount').withAncestor(post)).atIndex(0), + element(by.id('likeCount-expanded').withAncestor(post)).atIndex(0), ).not.toExist() await element(by.id('likeBtn').withAncestor(post)).atIndex(0).tap() await expect( - element(by.id('likeCount').withAncestor(post)).atIndex(0), + element(by.id('likeCount-expanded').withAncestor(post)).atIndex(0), ).toHaveText('1 like') await element(by.id('likeBtn').withAncestor(post)).atIndex(0).tap() await expect( - element(by.id('likeCount').withAncestor(post)).atIndex(0), + element(by.id('likeCount-expanded').withAncestor(post)).atIndex(0), ).not.toExist() }) @@ -61,21 +63,21 @@ describe('Thread screen', () => { it('Can repost the root post', async () => { const post = by.id('postThreadItem-by-bob.test') await expect( - element(by.id('repostCount').withAncestor(post)).atIndex(0), + element(by.id('repostCount-expanded').withAncestor(post)).atIndex(0), ).not.toExist() await element(by.id('repostBtn').withAncestor(post)).atIndex(0).tap() await expect(element(by.id('repostModal'))).toBeVisible() await element(by.id('repostBtn').withAncestor(by.id('repostModal'))).tap() await expect(element(by.id('repostModal'))).not.toBeVisible() await expect( - element(by.id('repostCount').withAncestor(post)).atIndex(0), + element(by.id('repostCount-expanded').withAncestor(post)).atIndex(0), ).toHaveText('1 repost') await element(by.id('repostBtn').withAncestor(post)).atIndex(0).tap() await expect(element(by.id('repostModal'))).toBeVisible() await element(by.id('repostBtn').withAncestor(by.id('repostModal'))).tap() await expect(element(by.id('repostModal'))).not.toBeVisible() await expect( - element(by.id('repostCount').withAncestor(post)).atIndex(0), + element(by.id('repostCount-expanded').withAncestor(post)).atIndex(0), ).not.toExist() }) -- cgit 1.4.1