How to use the detox.by.id 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.

github RocketChat / Rocket.Chat.ReactNative / e2e / 12-broadcast.spec.js View on Github external
await element(by.id('rooms-list-view-create-channel')).tap();
		await waitFor(element(by.id('new-message-view'))).toBeVisible().withTimeout(2000);
		await element(by.id('new-message-view-create-channel')).tap();
		await waitFor(element(by.id('select-users-view'))).toBeVisible().withTimeout(2000);
		await element(by.id(`select-users-view-item-${ data.alternateUser }`)).tap();
		await waitFor(element(by.id(`selected-user-${ data.alternateUser }`))).toBeVisible().withTimeout(5000);
		await element(by.id('selected-users-view-submit')).tap();
		await waitFor(element(by.id('create-channel-view'))).toBeVisible().withTimeout(5000);
		await element(by.id('create-channel-name')).replaceText(`broadcast${ data.random }`);
		await element(by.id('create-channel-broadcast')).tap();
		await element(by.id('create-channel-submit')).tap();
		await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(60000);
		await expect(element(by.id('room-view'))).toBeVisible();
		await waitFor(element(by.text(`broadcast${ data.random }`))).toExist().withTimeout(60000);
		await expect(element(by.text(`broadcast${ data.random }`))).toExist();
		await element(by.id('room-view-header-actions')).tap();
		await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000);
		await element(by.id('room-actions-info')).tap();
		await waitFor(element(by.id('room-info-view'))).toBeVisible().withTimeout(2000);
		await waitFor(element(by.id('room-info-view-broadcast'))).toBeVisible().withTimeout(2000);
		await expect(element(by.id('room-info-view-broadcast'))).toBeVisible();
		await tapBack();
		await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);
		await tapBack();
		await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(2000);
		// await tapBack();
		// await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(2000);
		// await waitFor(element(by.id(`rooms-list-view-item-broadcast${ data.random }`))).toExist().withTimeout(60000);
		// await expect(element(by.id(`rooms-list-view-item-broadcast${ data.random }`))).toExist();
	});
github RocketChat / Rocket.Chat.ReactNative / e2e / 12-broadcast.spec.js View on Github external
await waitFor(element(by.id('select-users-view'))).toBeVisible().withTimeout(2000);
		await element(by.id(`select-users-view-item-${ data.alternateUser }`)).tap();
		await waitFor(element(by.id(`selected-user-${ data.alternateUser }`))).toBeVisible().withTimeout(5000);
		await element(by.id('selected-users-view-submit')).tap();
		await waitFor(element(by.id('create-channel-view'))).toBeVisible().withTimeout(5000);
		await element(by.id('create-channel-name')).replaceText(`broadcast${ data.random }`);
		await element(by.id('create-channel-broadcast')).tap();
		await element(by.id('create-channel-submit')).tap();
		await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(60000);
		await expect(element(by.id('room-view'))).toBeVisible();
		await waitFor(element(by.text(`broadcast${ data.random }`))).toExist().withTimeout(60000);
		await expect(element(by.text(`broadcast${ data.random }`))).toExist();
		await element(by.id('room-view-header-actions')).tap();
		await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000);
		await element(by.id('room-actions-info')).tap();
		await waitFor(element(by.id('room-info-view'))).toBeVisible().withTimeout(2000);
		await waitFor(element(by.id('room-info-view-broadcast'))).toBeVisible().withTimeout(2000);
		await expect(element(by.id('room-info-view-broadcast'))).toBeVisible();
		await tapBack();
		await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);
		await tapBack();
		await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(2000);
		// await tapBack();
		// await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(2000);
		// await waitFor(element(by.id(`rooms-list-view-item-broadcast${ data.random }`))).toExist().withTimeout(60000);
		// await expect(element(by.id(`rooms-list-view-item-broadcast${ data.random }`))).toExist();
	});
github RocketChat / Rocket.Chat.ReactNative / e2e / 12-broadcast.spec.js View on Github external
it('should create broadcast room', async() => {
		await element(by.id('rooms-list-view-create-channel')).tap();
		await waitFor(element(by.id('new-message-view'))).toBeVisible().withTimeout(2000);
		await element(by.id('new-message-view-create-channel')).tap();
		await waitFor(element(by.id('select-users-view'))).toBeVisible().withTimeout(2000);
		await element(by.id(`select-users-view-item-${ data.alternateUser }`)).tap();
		await waitFor(element(by.id(`selected-user-${ data.alternateUser }`))).toBeVisible().withTimeout(5000);
		await element(by.id('selected-users-view-submit')).tap();
		await waitFor(element(by.id('create-channel-view'))).toBeVisible().withTimeout(5000);
		await element(by.id('create-channel-name')).replaceText(`broadcast${ data.random }`);
		await element(by.id('create-channel-broadcast')).tap();
		await element(by.id('create-channel-submit')).tap();
		await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(60000);
		await expect(element(by.id('room-view'))).toBeVisible();
		await waitFor(element(by.text(`broadcast${ data.random }`))).toExist().withTimeout(60000);
		await expect(element(by.text(`broadcast${ data.random }`))).toExist();
		await element(by.id('room-view-header-actions')).tap();
		await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000);
github RocketChat / Rocket.Chat.ReactNative / e2e / 14-joinpublicroom.spec.js View on Github external
it('should not have notifications', async() => {
				await expect(element(by.id('room-actions-notifications'))).toBeNotVisible();
			});
github RocketChat / Rocket.Chat.ReactNative / e2e / 09-roomactions.spec.js View on Github external
it('should show all users', async() => {
					await element(by.id('room-members-view-toggle-status')).tap();
					await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible().withTimeout(60000);
					await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible();
				});
github RocketChat / Rocket.Chat.ReactNative / e2e / 05-login.spec.js View on Github external
it('should have legal button', async() => {
			await expect(element(by.id('login-view-more'))).toBeVisible();
		});
github RocketChat / Rocket.Chat.ReactNative / e2e / 13-profile.spec.js View on Github external
it('should have email', async() => {
			await expect(element(by.id('profile-view-email'))).toExist();
		});
github RocketChat / Rocket.Chat.ReactNative / e2e / 09-roomactions.spec.js View on Github external
async function navigateToRoomActions(type) {
	let room;
	if (type === 'd') {
		room = 'rocket.cat';
	} else {
		room = `private${ data.random }`;
	}
	await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);
	await element(by.id('rooms-list-view-search')).replaceText(room);
	await sleep(2000);
    await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(60000);
    await element(by.id(`rooms-list-view-item-${ room }`)).tap();
	await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(2000);
	await element(by.id('room-view-header-actions')).tap();
	await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000);
}
github RocketChat / Rocket.Chat.ReactNative / e2e / 10-roominfo.spec.js View on Github external
async function navigateToRoomInfo(type) {
	let room;
	if (type === 'd') {
		room = 'rocket.cat';
	} else {
		room = `private${ data.random }`;
	}
	await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);
	await element(by.id('rooms-list-view-search')).replaceText(room);
    await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(60000);
    await element(by.id(`rooms-list-view-item-${ room }`)).tap();
	await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(2000);
	await element(by.id('room-view-header-actions')).tap();
	await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000);
	await element(by.id('room-actions-info')).tap();
	await waitFor(element(by.id('room-info-view'))).toBeVisible().withTimeout(2000);
}
github RocketChat / Rocket.Chat.ReactNative / e2e / 03-forgotpassword.spec.js View on Github external
before(async() => {
		await element(by.id('welcome-view-login')).tap();
    	await waitFor(element(by.id('login-view'))).toBeVisible().withTimeout(2000);
		await element(by.id('login-view-forgot-password')).tap();
		await waitFor(element(by.id('forgot-password-view'))).toBeVisible().withTimeout(2000);
	});