I am new to write test cases using detox for React Native app. I already wrote few test cases and working as expected.
Is it possible to add condition in test case like using if-else.
I am new to write test cases using detox for React Native app. I already wrote few test cases and working as expected.
Is it possible to add condition in test case like using if-else.
You can do that using a try catch block. An example is:
try {
await expect(element(by.text(user))).toExist();
} catch (e) {
const userField = by.id(Account.LoginView.userNameInput);
await element(userField).tap();
await element(userField).replaceText(user);
}