Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
Appium basic test - ReferenceError: beforeAll is not defined

I am trying to run an appium test as described here, https://blog.logrocket.com/testing-your-react-native-app-with-appium/

However, I get an error - how can I get my basic test to work?

> webdriverio-sample-appium-tests@1.0.0 test /Users/user/apps/myracnative/appium
> mocha test/basic


ReferenceError: beforeAll is not defined
    at Object.<anonymous> (/Users/user/apps/myracnative/appium/test/basic/index.js:16:1)

Test:

index.js

const wd = require("wd");
const jasmine = require("jasmine");
jasmine.DEFAULT_TIMEOUT_INTERVAL = 600000;
const PORT = 4723;

const config = {
    platformName: "iOS",
    platformVersion: "14.4",
    deviceName: "iPhone 11",
    app: "../../../apps/myracnative.ipa",
    automationName: "XCUITest", // UiAutomator2, Espresso, or UiAutomator1 for Android
};

const driver = wd.promiseChainRemote("localhost", PORT);

beforeAll(async () => {
    await driver.init(config);
});

test("Test Accessibilty Id", async () => {
    expect(
        await driver.hasElementByAccessibilityId("Create account")
    ).toBe(true);
    expect(await driver.hasElementByAccessibilityId("Log in")).toBe(true);
});

Here is a link to my test repo:

https://bitbucket.org/mharrisRAC/appium-example/src/master/

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!