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

27 lines
1.1 KiB
TypeScript
Raw Normal View History

import { device, element, by } from 'detox';
2023-02-21 20:38:23 +00:00
import { navigateToRegister, expectValidRegisterOrRetry } from '../../helpers/app';
2023-01-25 19:03:02 +00:00
import data from '../../data';
describe('Create user screen', () => {
beforeAll(async () => {
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
await navigateToRegister();
});
describe('Usage', () => {
it('should register', async () => {
2023-02-22 17:46:16 +00:00
const user = data.randomUser();
await element(by.id('register-view-name')).replaceText(user.username);
2023-02-20 20:34:51 +00:00
await element(by.id('register-view-name')).tapReturnKey();
2023-02-22 17:46:16 +00:00
await element(by.id('register-view-username')).replaceText(user.username);
2023-02-20 20:34:51 +00:00
await element(by.id('register-view-username')).tapReturnKey();
2023-02-22 17:46:16 +00:00
await element(by.id('register-view-email')).replaceText(user.email);
2023-02-20 20:34:51 +00:00
await element(by.id('register-view-email')).tapReturnKey();
2023-02-22 17:46:16 +00:00
await element(by.id('register-view-password')).replaceText(user.password);
2023-02-21 13:01:53 +00:00
await element(by.id('register-view-password')).tapReturnKey();
2023-02-21 20:38:23 +00:00
await expectValidRegisterOrRetry(device.getPlatform());
2023-01-25 19:03:02 +00:00
});
});
});