Skip to content
Open
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
6 changes: 6 additions & 0 deletions detox/test/e2e/06.device.test.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
describe('Device', () => {
it('reloadReactNative - should tap successfully', async () => {
await device.reloadReactNative();
await waitFor(element(by.text('Sanity'))).toBeVisible().withTimeout(2000);
await element(by.text('Sanity')).tap();
await element(by.text('Say Hello')).tap();
await expect(element(by.text('Hello!!!'))).toBeVisible();
});

it('relaunchApp - should tap successfully', async () => {
await device.relaunchApp();
await waitFor(element(by.text('Sanity'))).toBeVisible().withTimeout(2000);
await element(by.text('Sanity')).tap();
await element(by.text('Say Hello')).tap();
await expect(element(by.text('Hello!!!'))).toBeVisible();
});

it('relaunchApp({delete: true}) - should tap successfully', async () => {
await device.relaunchApp({delete: true});
await waitFor(element(by.text('Sanity'))).toBeVisible().withTimeout(2000);
await element(by.text('Sanity')).tap();
await element(by.text('Say Hello')).tap();
await expect(element(by.text('Hello!!!'))).toBeVisible();
Expand All @@ -24,6 +27,7 @@ describe('Device', () => {
await device.uninstallApp();
await device.installApp();
await device.relaunchApp();
await waitFor(element(by.text('Sanity'))).toBeVisible().withTimeout(2000);
await element(by.text('Sanity')).tap();
await element(by.text('Say Hello')).tap();
await expect(element(by.text('Hello!!!'))).toBeVisible();
Expand All @@ -32,6 +36,7 @@ describe('Device', () => {
it('resetAppState() + relaunch() - should tap successfully', async () => {
await device.resetAppState();
await device.relaunchApp();
await waitFor(element(by.text('Sanity'))).toBeVisible().withTimeout(2000);
await element(by.text('Sanity')).tap();
await element(by.text('Say Hello')).tap();
await expect(element(by.text('Hello!!!'))).toBeVisible();
Expand All @@ -48,6 +53,7 @@ describe('Device', () => {

it('launchApp({newInstance: true}) + sendToHome() + launchApp() - should bring up previous instance', async () => {
await device.launchApp({newInstance: true});
await waitFor(element(by.text('Sanity'))).toBeVisible().withTimeout(2000);
await element(by.text('Sanity')).tap();
await element(by.text('Say Hello')).tap();
await device.sendToHome();
Expand Down
1 change: 1 addition & 0 deletions detox/test/e2e/10.async-and-callbacks.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
describe('Async and Callbacks', () => {
beforeEach(async () => {
await device.reloadReactNative();
await waitFor(element(by.text('Sanity'))).toBeVisible().withTimeout(2000);
await element(by.text('Sanity')).tap();
});

Expand Down
4 changes: 3 additions & 1 deletion detox/test/e2e/13.permissions.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { RESULTS } = require('react-native-permissions');
const { isIOS18OrHigher } = require('./utils/deviceInfo');

const BASIC_PERMISSIONS_TO_CHECK = [
'userTracking',
Expand Down Expand Up @@ -183,7 +184,8 @@ describe(':ios: Permissions', () => {
await device.launchApp({ permissions, delete: true });
await element(by.text('Permissions')).tap();

await expect(faceid).toHaveText(RESULTS.BLOCKED);
// iOS 18+ changed behavior: FaceID permissions set to NO now return DENIED instead of BLOCKED
await expect(faceid).toHaveText(isIOS18OrHigher() ? RESULTS.DENIED : RESULTS.BLOCKED);
});
});
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified detox/test/e2e/assets/cross-origin-frame.clear-text.ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified detox/test/e2e/assets/elementScreenshot.horiz.ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified detox/test/e2e/assets/elementScreenshot.vert.ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified detox/test/e2e/assets/focus-on-input-webview.ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified detox/test/e2e/assets/move-cursor-to-end-webview.ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified detox/test/e2e/assets/scroll-to-view-webview.ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified detox/test/e2e/assets/select-all-text-in-webview.ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions detox/test/e2e/detox.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ const config = {
type: 'ios.simulator',
headless: Boolean(process.env.CI),
device: {
type: 'iPhone 16 Pro Max',
os: '18.5'
type: 'iPhone 17 Pro',
os: '26.1'
},
},

Expand Down
56 changes: 56 additions & 0 deletions detox/test/e2e/utils/deviceInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* Utility to get device OS version information
*/

let cachedIOSVersion = null;

/**
* Gets the iOS major version number
* @returns {Promise<number|null>} The iOS major version (e.g., 17, 18, 26) or null if not iOS
*/
async function getIOSMajorVersion() {
if (cachedIOSVersion !== null) {
return cachedIOSVersion;
}

try {
const { device: deviceHandle } = require('detox');
if (deviceHandle && deviceHandle.getPlatform && deviceHandle.getPlatform() !== 'ios') {
cachedIOSVersion = null;
return null;
}

if (deviceHandle && deviceHandle._device && deviceHandle._device.deviceConfig) {
const osVersion = deviceHandle._device.deviceConfig.device?.os;
if (osVersion) {
const majorVersion = parseInt(osVersion.split('.')[0], 10);
cachedIOSVersion = majorVersion;
return majorVersion;
}
}
} catch (e) {
console.warn('Could not determine iOS version, assuming iOS 18+');
}

cachedIOSVersion = 18;
return cachedIOSVersion;
}

/**
* Checks if iOS version is 18 or higher
* @returns {Promise<boolean>}
*/
async function isIOS18OrHigher() {
const majorVersion = await getIOSMajorVersion();
if (majorVersion === null) {
return false;
}
return majorVersion >= 18;
}

module.exports = {
getIOSMajorVersion,
isIOS18OrHigher,
};