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

Is it possible to call a native method or package function directly without involving the UI? #4619

Open
chiragramimi opened this issue Oct 25, 2024 · 1 comment

Comments

@chiragramimi
Copy link

Description

sample code

import { PassioSDK } from '@passiolife/nutritionai-react-native-sdk-v3'
import { device } from 'detox'

describe('Example', () => {
  beforeAll(async () => {
    jest.setTimeout(300000) // Set timeout to 5 minutes for long-running tests
    await device.launchApp({
      permissions: {
        location: 'inuse',
        camera: 'YES',
        notifications: 'YES',
      },
    })
  })

  beforeEach(async () => {
    await device.reloadReactNative()
  })

  it('should tap on button by id and expect some text to be visible', async () => {
    const result = await PassioSDK.searchForFood('apple')
    expect(result).toBe('Hello from Native!') // Check if the returned value is correct
  }, 300000)
})

Your environment

Detox version: 20.27.3
React Native version: 0.74.3
Node version: 20
Device model: IOS 15 Pro
OS:
Test-runner (select one): jest

@noomorph
Copy link
Collaborator

Someone has to implement this one for the new React Native architecture: #4208

Unfortunately, a couple of people tried and did not succeed for various reasons, so it's still in the embarrassing limbo state. 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants