Complete the code to launch the app before running tests in Detox.
beforeAll(async () => {
await device.[1]();
});The launchApp command starts the app fresh before tests run.
Complete the code to check if a button with testID 'loginBtn' is visible.
await expect(element(by.id('loginBtn'))).[1]();
toBeVisible() checks if the element is visible on screen.
Fix the error in the code to tap a button with label 'Submit'.
await element(by.[1]('Submit')).tap();
Use by.text() to find elements by their visible text label.
Fill both blanks to wait for an element with testID 'welcomeMsg' to appear.
await waitFor(element(by.[1]('welcomeMsg'))).[2]();
Use by.id to select by testID and toBeVisible() to wait until visible.
Fill all three blanks to type 'hello' into a text input with testID 'inputField' and then tap the submit button.
await element(by.[1]('inputField')).[2]('hello'); await element(by.[3]('submitBtn')).tap();
Select elements by id, use typeText to enter text, then tap the submit button.
