Fix e2e tests

This commit is contained in:
Paul Frazee
2023-02-09 16:53:19 -06:00
parent 3ad0f3cc4a
commit 6f98bf8aa5
3 changed files with 17 additions and 5 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ describe('Example', () => {
it('As Alice, I can login, and post a text', async () => {
await grantAccessToUserWithValidCredentials('alice')
await element(by.id('composePromptButton')).tap()
await element(by.id('composeFAB')).tap()
await device.takeScreenshot('1- opened composer')
await element(by.id('composerTextInput')).typeText(
'Greetings earthlings, I come in peace... and to run some tests.',
@@ -49,7 +49,7 @@ describe('Example', () => {
await device.takeScreenshot('2- entered text')
await element(by.id('composerPublishButton')).tap()
await device.takeScreenshot('3- opened general section')
await expect(element(by.id('composePromptButton'))).toBeVisible()
await expect(element(by.id('composeFAB'))).toBeVisible()
})
it('I can create a new account', async () => {
+10 -2
View File
@@ -14,10 +14,18 @@ import {useStores} from '../../../state'
type OnPress = ((event: GestureResponderEvent) => void) | undefined
export const FAB = observer(
({icon, onPress}: {icon: IconProp; onPress: OnPress}) => {
({
testID,
icon,
onPress,
}: {
testID: string
icon: IconProp
onPress: OnPress
}) => {
const store = useStores()
return (
<TouchableWithoutFeedback onPress={onPress}>
<TouchableWithoutFeedback testID={testID} onPress={onPress}>
<View
style={[
styles.outer,
+5 -1
View File
@@ -120,7 +120,11 @@ export const Home = observer(function Home({navIdx, visible}: ScreenParams) {
</LinearGradient>
</TouchableOpacity>
) : undefined}
<FAB icon="pen-nib" onPress={() => onPressCompose(false)} />
<FAB
testID="composeFAB"
icon="pen-nib"
onPress={() => onPressCompose(false)}
/>
</View>
)
})