Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
device.sendUserNotification(userNotificationTimeIntervalTrigger);
device.sendUserNotification(userNotificationPushTrigger);
// $ExpectError
device.setOrientation("normal");
device.setOrientation("portrait");
// $ExpectError
device.setLocation();
device.setLocation(32.04, 34.78);
device.setURLBlacklist(["https://flow.org", "https://flow.org"]);
device.enableSynchronization();
device.disableSynchronization();
device.resetContentAndSettings();
device.getPlatform();
// Matchers
// --------
by.id("flowType");
by.text("flowType is great!");
by.label("welcome");
// $ExpectError
by.label(123);
by.type("RCTImageView");
by.traits(["button"]);
// $ExpectError
by.traits("button");
// Actions on element
// ------------------
element(by.id("testElement")).tap();
it('should show/hide emoji keyboard', async () => {
if (device.getPlatform() === 'android') {
await element(by.id('messagebox-open-emoji')).tap();
await waitFor(element(by.id('messagebox-keyboard-emoji'))).toBeVisible().withTimeout(10000);
await expect(element(by.id('messagebox-keyboard-emoji'))).toBeVisible();
await expect(element(by.id('messagebox-close-emoji'))).toBeVisible();
await expect(element(by.id('messagebox-open-emoji'))).toBeNotVisible();
await element(by.id('messagebox-close-emoji')).tap();
await waitFor(element(by.id('messagebox-keyboard-emoji'))).toBeNotVisible().withTimeout(10000);
await expect(element(by.id('messagebox-keyboard-emoji'))).toBeNotVisible();
await expect(element(by.id('messagebox-close-emoji'))).toBeNotVisible();
await expect(element(by.id('messagebox-open-emoji'))).toBeVisible();
}
});
async function searchRoom(query = '') {
if (device.getPlatform() === 'android') {
await element(by.id('rooms-list-view-search')).tap();
await element(by.id('rooms-list-view-search-input')).replaceText(query);
} else {
await element(by.id('rooms-list-view-search')).replaceText(query);
}
}