How to use the detox.device.getPlatform function in detox

To help you get started, we’ve selected a few detox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / detox_v7.x.x / test_detox_v7.x.x.js View on Github external
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();
github RocketChat / Rocket.Chat.ReactNative / e2e / 08-room.spec.js View on Github external
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();
				}
			});
github RocketChat / Rocket.Chat.ReactNative / e2e / helpers / rooms.js View on Github external
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);
    }
}