Rocket.Chat.ReactNative/e2e/tests/onboarding/04-createuser.spec.ts

27 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-03-07 12:28:51 +00:00
import { device, element, by } from 'detox';
2023-03-07 12:28:51 +00:00
import { navigateToRegister, expectValidRegisterOrRetry } from '../../helpers/app';
import data from '../../data';
describe('Create user screen', () => {
2023-03-07 12:28:51 +00:00
beforeAll(async () => {
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
await navigateToRegister();
});
describe('Usage', () => {
it('should register', async () => {
2023-03-07 12:28:51 +00:00
const user = data.randomUser();
await element(by.id('register-view-name')).replaceText(user.username);
await element(by.id('register-view-name')).tapReturnKey();
await element(by.id('register-view-username')).replaceText(user.username);
await element(by.id('register-view-username')).tapReturnKey();
await element(by.id('register-view-email')).replaceText(user.email);
await element(by.id('register-view-email')).tapReturnKey();
await element(by.id('register-view-password')).replaceText(user.password);
await element(by.id('register-view-password')).tapReturnKey();
await expectValidRegisterOrRetry(device.getPlatform());
});
});
});