Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
39f85ca
refactor(tests): test-tabs-tab-bar-more-navigation-controller + scenario
LKuchno Apr 9, 2026
650f80a
Merge branch 'main' of github.com:software-mansion/react-native-scree…
LKuchno Apr 9, 2026
519b347
scenario extension
LKuchno Apr 9, 2026
eeb6b94
misspeling correct
LKuchno Apr 9, 2026
81bee95
scenario for iPad in full size app - no More tab- added
LKuchno Apr 9, 2026
e796a44
Merge branch 'main' of github.com:software-mansion/react-native-scree…
LKuchno Apr 13, 2026
2beb2b3
Merge branch 'main' of github.com:software-mansion/react-native-scree…
LKuchno Apr 14, 2026
1b5a8b7
update after cahnges in prop works
LKuchno Apr 14, 2026
e9e24f7
scenario first update
LKuchno Apr 14, 2026
ddb1501
scenario update and toast message
LKuchno Apr 14, 2026
0569ee9
start adding checks on event states in console log
LKuchno Apr 14, 2026
78597e7
update screnario description, and add checks on cosole log onMoreTabS…
LKuchno Apr 16, 2026
a05d6d8
Merge branch 'main' of github.com:software-mansion/react-native-scree…
LKuchno Apr 17, 2026
07298f5
change in OS section
LKuchno Apr 17, 2026
25087f6
final version of scenario
LKuchno Apr 20, 2026
4ee453c
Merge branch 'main' of github.com:software-mansion/react-native-scree…
LKuchno Apr 20, 2026
1c29f34
Update apps/src/tests/single-feature-tests/tabs/test-tabs-more-naviga…
LKuchno Apr 20, 2026
634c619
onTabSelected added to display toast on screen, scenario updated to d…
LKuchno Apr 20, 2026
78ead25
removing spaces
LKuchno Apr 20, 2026
f2d611a
step 7 for iphone and 11 for ipad was added to check repeated More ta…
LKuchno Apr 20, 2026
1a421c0
removed Round-trip navigation, fix formatting of More tab in expc
LKuchno Apr 20, 2026
6dc36e5
chore(test): E2E test-tabs-more-navigation-controller covering part o…
LKuchno Apr 20, 2026
393472f
Merge branch '@lkuchno/test-tabs-tab-bar-more-navigation-controller' …
LKuchno Apr 20, 2026
321cfdc
repeated More tab selection scenario added to e2e test, scenario upda…
LKuchno Apr 20, 2026
805c6b0
e2e section updated
LKuchno Apr 20, 2026
685664d
Merge branch 'main' of github.com:software-mansion/react-native-scree…
LKuchno Apr 21, 2026
f5d3e4f
e2e update to make scenarios independent, deleting lines connected wi…
LKuchno Apr 21, 2026
bccf000
changing describe to describeifiOS as this test is ios only
LKuchno Apr 21, 2026
1770b17
test name change
LKuchno Apr 23, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { device, expect, element, by } from 'detox';
import { describeIfiOS, selectSingleFeatureTestsScreen } from '../../e2e-utils';

describeIfiOS('Tab Bar More Navigation Controller', () => {
beforeEach(async () => {
await device.reloadReactNative();
await selectSingleFeatureTestsScreen(
'Tabs',
'test-tabs-more-navigation-controller',
);
await expect(element(by.label('1. onTabSelected: "First"'))).toBeVisible();
await element(by.label('1. onTabSelected: "First"')).tap();
});

it('screen should be displayed with 4 tabs and More tab visible', async () => {
await expect(
element(by.id('test-tabs-more-navigation-controller-view')),
).toBeVisible();
await expect(element(by.type('UITabBar'))).toBeVisible();
await expect(element(by.id('First'))).toBeVisible();
await expect(element(by.id('Second'))).toBeVisible();
await expect(element(by.id('Third'))).toBeVisible();
await expect(element(by.id('Fourth'))).toBeVisible();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();
await expect(element(by.label('More'))).toExist();
});

it('navigation using tab bar should work correctly', async () => {
await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).toBeVisible();
await element(by.label('1. onMoreTabSelected')).tap();
await expect(element(by.label('Fifth'))).toBeVisible();
await expect(element(by.label('Sixth'))).toBeVisible();

await element(by.label('Fifth')).tap();
await expect(element(by.id('Fifth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Fifth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.label('Sixth'))).not.toBeVisible();

await element(by.id('Third')).tap();
await expect(element(by.id('Third-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Third"')).tap();

await element(by.label('More')).atIndex(0).tap();
await expect(element(by.id('Fifth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Fifth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();

await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).toBeVisible();
await expect(element(by.label('Fifth'))).toBeVisible();
await expect(element(by.label('Sixth'))).toBeVisible();
await element(by.label('1. onMoreTabSelected')).tap();

await element(by.label('Sixth')).tap();
await expect(element(by.id('Sixth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Sixth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();
});

it('navigation using programmatic buttons should work correctly', async () => {
await element(by.label('Select Fourth')).tap();
await expect(element(by.id('Fourth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Fourth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();

await element(by.label('Select Fifth')).tap();
await expect(element(by.id('Fifth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Fifth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();

await element(by.label('Select First')).tap();
await expect(element(by.id('First-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "First"')).tap();

await element(by.label('Select Sixth')).tap();
await expect(element(by.id('Sixth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Sixth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();
});

it('repeated More tab selection', async () => {
await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).toBeVisible();
await element(by.label('1. onMoreTabSelected')).tap();
await expect(element(by.label('Fifth'))).toBeVisible();
await expect(element(by.label('Sixth'))).toBeVisible();
await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).not.toBeVisible();
await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).not.toBeVisible();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { device, expect, element, by } from 'detox';
import { describeIfiOS, selectSingleFeatureTestsScreen } from '../../e2e-utils';

describeIfiOS('Tab Bar More Navigation Controller', () => {
beforeEach(async () => {
await device.reloadReactNative();
await selectSingleFeatureTestsScreen(
'Tabs',
'test-tabs-more-navigation-controller',
);
await expect(element(by.label('1. onTabSelected: "First"'))).toBeVisible();
await element(by.label('1. onTabSelected: "First"')).tap();
});

it('screen should be displayed with 4 tabs and More tab visible', async () => {
await expect(
element(by.id('test-tabs-more-navigation-controller-view')),
).toBeVisible();
await expect(element(by.type('UITabBar'))).toBeVisible();
await expect(element(by.id('First'))).toBeVisible();
await expect(element(by.id('Second'))).toBeVisible();
await expect(element(by.id('Third'))).toBeVisible();
await expect(element(by.id('Fourth'))).toBeVisible();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();
await expect(element(by.label('More'))).toExist();
});

it('navigation using tab bar should work correctly', async () => {
await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).toBeVisible();
await element(by.label('1. onMoreTabSelected')).tap();
await expect(element(by.label('Fifth'))).toBeVisible();
await expect(element(by.label('Sixth'))).toBeVisible();

await element(by.label('Fifth')).tap();
await expect(element(by.id('Fifth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Fifth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.label('Sixth'))).not.toBeVisible();

await element(by.id('Third')).tap();
await expect(element(by.id('Third-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Third"')).tap();

await element(by.label('More')).atIndex(0).tap();
await expect(element(by.id('Fifth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Fifth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();

await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).toBeVisible();
await expect(element(by.label('Fifth'))).toBeVisible();
await expect(element(by.label('Sixth'))).toBeVisible();
await element(by.label('1. onMoreTabSelected')).tap();

await element(by.label('Sixth')).tap();
await expect(element(by.id('Sixth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Sixth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();
});

it('navigation using programmatic buttons should work correctly', async () => {
await element(by.label('Select Fourth')).tap();
await expect(element(by.id('Fourth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Fourth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();

await element(by.label('Select Fifth')).tap();
await expect(element(by.id('Fifth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Fifth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();

await element(by.label('Select First')).tap();
await expect(element(by.id('First-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "First"')).tap();

await element(by.label('Select Sixth')).tap();
await expect(element(by.id('Sixth-content-view'))).toBeVisible();
await element(by.label('1. onTabSelected: "Sixth"')).tap();
await expect(element(by.id('Fifth'))).not.toBeVisible();
await expect(element(by.id('Sixth'))).not.toBeVisible();
});

it('repeated More tab selection', async () => {
await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).toBeVisible();
await element(by.label('1. onMoreTabSelected')).tap();
await expect(element(by.label('Fifth'))).toBeVisible();
await expect(element(by.label('Sixth'))).toBeVisible();
await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).not.toBeVisible();
await element(by.label('More')).atIndex(0).tap();
await expect(element(by.label('1. onMoreTabSelected'))).not.toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { CenteredLayoutView } from '@apps/shared/CenteredLayoutView';
import { ToastProvider, useToast } from '@apps/shared/';
import { Colors } from '@apps/shared/styling';
import type { MoreTabSelectedEvent } from 'react-native-screens';
import type { MoreTabSelectedEvent, TabSelectedEvent } from 'react-native-screens';

const scenarioDescription: ScenarioDescription = {
name: 'More navigation controller',
Expand All @@ -24,7 +24,7 @@ function ContentView() {
const { routeKey } = useTabsNavigationContext();
return (
<CenteredLayoutView>
<Text style={{ fontWeight: 'bold', textAlign: 'center' }}>
<Text style={{ fontWeight: 'bold', textAlign: 'center' }} testID={`${routeKey}-content-view`}>
{routeKey}
</Text>
<TabsNavigationButtons />
Expand All @@ -36,7 +36,8 @@ function TabsNavigationButtons() {
const nav = useTabsNavigationContext();

return (
<View>
<View
testID='test-tabs-more-navigation-controller-view'>
<Button title="Select First" onPress={() => nav.selectTab('First')} />
<Button title="Select Second" onPress={() => nav.selectTab('Second')} />
<Button title="Select Third" onPress={() => nav.selectTab('Third')} />
Expand All @@ -51,32 +52,32 @@ const ROUTE_CONFIGS: TabRouteConfig[] = [
{
name: 'First',
Component: ContentView,
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'First' },
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'First', tabBarItemTestID: 'First' },
},
{
name: 'Second',
Component: ContentView,
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Second' },
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Second', tabBarItemTestID: 'Second' },
},
{
name: 'Third',
Component: ContentView,
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Third' },
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Third', tabBarItemTestID: 'Third' },
},
{
name: 'Fourth',
Component: ContentView,
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Fourth' },
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Fourth', tabBarItemTestID: 'Fourth' },
},
{
name: 'Fifth',
Component: ContentView,
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Fifth' },
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Fifth', tabBarItemTestID: 'Fifth' },
},
{
name: 'Sixth',
Component: ContentView,
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Sixth' },
options: { ...DEFAULT_TAB_ROUTE_OPTIONS, title: 'Sixth', tabBarItemTestID: 'Sixth' },
},
];

Expand Down Expand Up @@ -104,9 +105,15 @@ function AppContents() {
2,
)}`;
console.warn(message);
toast.push({ message, backgroundColor: Colors.GreenLight60 });
toast.push({ message: 'onMoreTabSelected', backgroundColor: Colors.GreenLight60 });
},
}}
onTabSelected={(event: NativeSyntheticEvent<TabSelectedEvent>) => {
toast.push({
backgroundColor: Colors.BlueLight100,
message: `onTabSelected: ${JSON.stringify(event.nativeEvent.selectedScreenKey)}`,
});
}}
/>
);
}
Expand Down
Loading
Loading