I am trying to run an appium test as described here, https://blog.logrocket.com/testing-your-react-native-app-with-appium/
I am trying to run a test to confirm two buttons exists on the page.
However, I get an error - how can I get my basic test to work?
> [email protected] 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)
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);
});