Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix E2E tests #5980

Merged
merged 3 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions __e2e__/flows/composer-self-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ appId: xyz.blueskyweb.app
id: "openGalleryBtn"
- tapOn:
id: "labelsBtn"
- tapOn:
label: "Tap on porn"
point: 78%,67%
- tapOn: "Porn"
- tapOn:
label: "Tap on confirm"
point: 51%,92%
id: "confirmBtn"
- tapOn:
id: "composerPublishBtn"
- tapOn:
id: "e2eRefreshHome"
- assertVisible: "Adult Content"
- assertVisible: "Adult Content"
5 changes: 3 additions & 2 deletions __e2e__/flows/shared-prefs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ appId: xyz.blueskyweb.app
file: ../setupApp.yml
- tapOn:
id: "e2eSignInAlice"
- tapOn: "/sys/debug"
- tapOn:
id: "storybookBtn"
- tapOn:
id: "sharedPrefsTestOpenBtn"
- tapOn:
id: "setStringBtn"
- assertVisible: "Hello"
- tapOn:
id: "removeStringBtn"
- assertVisible: "null"
- assertVisible: "undefined"
- tapOn:
id: "setBoolBtn"
- assertVisible: "true"
Expand Down
3 changes: 2 additions & 1 deletion src/view/com/composer/labels/LabelsBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ function DialogInner({
onPress={() => control.close()}
color="primary"
size={isWeb ? 'small' : 'large'}
variant="solid">
variant="solid"
testID="confirmBtn">
<ButtonText>
<Trans>Done</Trans>
</ButtonText>
Expand Down
5 changes: 4 additions & 1 deletion src/view/com/home/HomeHeaderLayoutMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export function HomeHeaderLayoutMobile({
]}>
{IS_DEV && (
<>
<Link label="View storybook" to="/sys/debug">
<Link
label="View storybook"
to="/sys/debug"
testID="storybookBtn">
<ColorPalette size="md" />
</Link>
</>
Expand Down
13 changes: 0 additions & 13 deletions src/view/screens/Storybook/Dialogs.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react'
import {View} from 'react-native'
import {useNavigation} from '@react-navigation/native'

import {NavigationProp} from '#/lib/routes/types'
import {useDialogStateControlContext} from '#/state/dialogs'
import {atoms as a} from '#/alf'
import {Button, ButtonText} from '#/components/Button'
Expand All @@ -25,7 +23,6 @@ export function Dialogs() {
const [shouldRenderUnmountTest, setShouldRenderUnmountTest] =
React.useState(false)
const unmountTestInterval = React.useRef<number>()
const navigation = useNavigation<NavigationProp>()

const onUnmountTestStartPressWithClose = () => {
setShouldRenderUnmountTest(true)
Expand Down Expand Up @@ -152,16 +149,6 @@ export function Dialogs() {
<ButtonText>End Unmount Test</ButtonText>
</Button>

<Button
variant="solid"
color="primary"
size="small"
onPress={() => navigation.navigate('SharedPreferencesTester')}
label="two"
testID="sharedPrefsTestOpenBtn">
<ButtonText>Open Shared Prefs Tester</ButtonText>
</Button>

<Button
variant="solid"
color="primary"
Expand Down
13 changes: 13 additions & 0 deletions src/view/screens/Storybook/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'
import {ScrollView, View} from 'react-native'
import {useNavigation} from '@react-navigation/native'

import {NavigationProp} from '#/lib/routes/types'
import {isWeb} from '#/platform/detection'
import {useSetThemePrefs} from '#/state/shell'
import {CenteredView} from '#/view/com/util/Views'
Expand Down Expand Up @@ -39,6 +41,7 @@ function StorybookInner() {
const t = useTheme()
const {setColorMode, setDarkTheme} = useSetThemePrefs()
const [showContainedList, setShowContainedList] = React.useState(false)
const navigation = useNavigation<NavigationProp>()

return (
<CenteredView style={[t.atoms.bg]}>
Expand Down Expand Up @@ -86,6 +89,16 @@ function StorybookInner() {
</Button>
</View>

<Button
variant="solid"
color="primary"
size="small"
onPress={() => navigation.navigate('SharedPreferencesTester')}
label="two"
testID="sharedPrefsTestOpenBtn">
<ButtonText>Open Shared Prefs Tester</ButtonText>
</Button>

<Admonitions />

<ThemeProvider theme="light">
Expand Down
Loading