Skip to content

can't find UI element using hasElementByAccessibilityId #6

@LayMuiToh

Description

@LayMuiToh

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);
     |                                                                      

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions