react-native-e2etest icon indicating copy to clipboard operation
react-native-e2etest copied to clipboard

can't find UI element using hasElementByAccessibilityId

Open LayMuiToh opened this issue 6 years ago • 0 comments

import wd from 'wd'; import config from '../e2e-config';

const port = 4723; const driver = wd.promiseChainRemote('localhost', port); jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;

describe('Login Test', () => { // beforeAll(async () => await driver.init(config)); // afterAll(async () => await driver.quit()); beforeAll(async () => { await driver.init(config);

 });

it('find the user login fields', async() => { expect(await driver.hasElementByAccessibilityId('textUserName')).toBe(true); });

I got this when I run npm run test:e2e:ios

however this UI element is visible and I have attached a accessibilityLabel to it. what could have caused this failure?

jest --testMatch="/tests//*e2e.js"

FAIL tests/login.e2e.js (10.889s) Login Test ✕ find the user login fields (902ms)

● Login Test › find the user login fields

expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false

  18 |  
  19 |    it('find the user login fields', async() => {
> 20 |      expect(await driver.hasElementByAccessibilityId('textUserName')).toBe(true);
     |                                                                      

LayMuiToh avatar Oct 24 '18 05:10 LayMuiToh