2023-03-07 12:28:51 +00:00
|
|
|
import { device, element, by } from 'detox';
|
2022-09-12 14:51:33 +00:00
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
import { navigateToRegister, expectValidRegisterOrRetry } from '../../helpers/app';
|
2022-09-12 14:51:33 +00:00
|
|
|
import data from '../../data';
|
2018-11-14 21:42:03 +00:00
|
|
|
|
|
|
|
describe('Create user screen', () => {
|
2023-03-07 12:28:51 +00:00
|
|
|
beforeAll(async () => {
|
2021-06-11 18:23:43 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
2018-11-14 21:42:03 +00:00
|
|
|
await navigateToRegister();
|
|
|
|
});
|
|
|
|
describe('Usage', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
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());
|
2018-11-14 21:42:03 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|