Rocket.Chat.ReactNative/e2e/tests/onboarding/06-roomslist.spec.js

52 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-05-23 13:39:18 +00:00
const {
device, expect, element, by, waitFor
} = require('detox');
const { login, navigateToLogin, logout, tapBack, sleep, searchRoom } = require('../../helpers/app');
const data = require('../../data');
2018-05-23 13:39:18 +00:00
describe('Rooms list screen', () => {
before(async() => {
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
await navigateToLogin();
await login(data.users.regular.username, data.users.regular.password)
});
describe('Render', () => {
2018-05-23 13:39:18 +00:00
it('should have rooms list screen', async() => {
await expect(element(by.id('rooms-list-view'))).toBeVisible();
2020-03-03 20:27:38 +00:00
});
2018-05-23 13:39:18 +00:00
2020-03-03 20:27:38 +00:00
it('should have room item', async() => {
await expect(element(by.id('rooms-list-view-item-general'))).toExist();
2018-05-23 13:39:18 +00:00
});
// Render - Header
describe('Header', () => {
2018-05-23 13:39:18 +00:00
it('should have create channel button', async() => {
await expect(element(by.id('rooms-list-view-create-channel'))).toBeVisible();
});
it('should have sidebar button', async() => {
await expect(element(by.id('rooms-list-view-sidebar'))).toBeVisible();
});
});
});
describe('Usage', () => {
2018-05-23 13:39:18 +00:00
it('should search room and navigate', async() => {
await searchRoom('rocket.cat');
2018-05-23 13:39:18 +00:00
await element(by.id('rooms-list-view-item-rocket.cat')).tap();
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(10000);
2020-03-03 20:27:38 +00:00
await waitFor(element(by.id('room-view-title-rocket.cat'))).toBeVisible().withTimeout(60000);
await tapBack();
2018-05-23 13:39:18 +00:00
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(2000);
await waitFor(element(by.id('rooms-list-view-item-rocket.cat'))).toExist().withTimeout(60000);
2018-05-23 13:39:18 +00:00
});
it('should logout', async() => {
await logout();
});
2018-05-23 13:39:18 +00:00
});
});