Fixes to tests (#1518)

zio/stable
Paul Frazee 2023-09-22 17:49:41 -07:00 committed by GitHub
parent 41b53ca37b
commit 150fe421d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 8 deletions

View File

@ -29,6 +29,8 @@ describe('Create account', () => {
await element(by.id('continueBtn')).tap() await element(by.id('continueBtn')).tap()
await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible() await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible()
await element(by.id('continueBtn')).tap() 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() await expect(element(by.id('homeScreen'))).toBeVisible()
}) })
}) })

View File

@ -18,16 +18,12 @@ describe('invite-codes', () => {
it('I can fetch invite codes', async () => { it('I can fetch invite codes', async () => {
await expect(element(by.id('signInButton'))).toBeVisible() await expect(element(by.id('signInButton'))).toBeVisible()
await loginAsAlice() await loginAsAlice()
await element(by.id('viewHeaderDrawerBtn')).tap() await element(by.id('e2eOpenInviteCodesModal')).tap()
await expect(element(by.id('drawer'))).toBeVisible()
await element(by.id('menuItemInviteCodes')).tap()
await expect(element(by.id('inviteCodesModal'))).toBeVisible() await expect(element(by.id('inviteCodesModal'))).toBeVisible()
const attrs = await element(by.id('inviteCode-0-code')).getAttributes() const attrs = await element(by.id('inviteCode-0-code')).getAttributes()
inviteCode = attrs.text inviteCode = attrs.text
await element(by.id('closeBtn')).tap() await element(by.id('closeBtn')).tap()
await element(by.id('viewHeaderDrawerBtn')).tap() await element(by.id('e2eSignOut')).tap()
await element(by.id('menuItemButton-Settings')).tap()
await element(by.id('signOutBtn')).tap()
}) })
it('I can create a new account with the invite code', async () => { 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 element(by.id('continueBtn')).tap()
await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible() await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible()
await element(by.id('continueBtn')).tap() 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() await expect(element(by.id('homeScreen'))).toBeVisible()
}) })
it('I get a notification for the new user', async () => { it('I get a notification for the new user', async () => {
await element(by.id('e2eSignOut')).tap()
await loginAsAlice() 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() await expect(element(by.id('invitedUser'))).toBeVisible()
}) })

View File

@ -19,7 +19,7 @@ describe('Profile screen', () => {
it('Can see feeds', async () => { it('Can see feeds', async () => {
await element(by.id('selector')).swipe('left') await element(by.id('selector')).swipe('left')
await element(by.id('selector-4')).tap() 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')).swipe('right')
await element(by.id('selector-0')).tap() await element(by.id('selector-0')).tap()
}) })

View File

@ -41,6 +41,12 @@ export function TestCtrls() {
accessibilityRole="button" accessibilityRole="button"
style={BTN} style={BTN}
/> />
<Pressable
testID="e2eSignOut"
onPress={() => store.session.logout()}
accessibilityRole="button"
style={BTN}
/>
<Pressable <Pressable
testID="e2eGotoHome" testID="e2eGotoHome"
onPress={() => navigate('Home')} onPress={() => navigate('Home')}
@ -71,6 +77,12 @@ export function TestCtrls() {
accessibilityRole="button" accessibilityRole="button"
style={BTN} style={BTN}
/> />
<Pressable
testID="e2eOpenInviteCodesModal"
onPress={() => store.shell.openModal({name: 'invite-codes'})}
accessibilityRole="button"
style={BTN}
/>
</View> </View>
) )
} }