Fix some tests

This commit is contained in:
Diego Mello 2023-02-28 16:46:18 -03:00
parent 185d65aafc
commit feeec793eb
2 changed files with 12 additions and 12 deletions

View File

@ -69,7 +69,7 @@ describe('Room', () => {
await waitForLoading(); await waitForLoading();
await waitFor(element(by[textMatcher]('1')).atIndex(0)) await waitFor(element(by[textMatcher]('1')).atIndex(0))
.toExist() .toExist()
.withTimeout(10000); .withTimeout(30000);
await expect(element(by[textMatcher]('2'))).toExist(); await expect(element(by[textMatcher]('2'))).toExist();
}); });
@ -97,7 +97,7 @@ describe('Room', () => {
.withTimeout(5000); .withTimeout(5000);
await waitFor(element(by[textMatcher]('300'))) await waitFor(element(by[textMatcher]('300')))
.toExist() .toExist()
.withTimeout(5000); .withTimeout(30000);
let found = false; let found = false;
while (!found) { while (!found) {
try { try {

View File

@ -288,35 +288,35 @@ describe('Team', () => {
it('should add users to the team', async () => { it('should add users to the team', async () => {
await element(by.id('room-actions-members')).tap(); await element(by.id('room-actions-members')).tap();
await waitFor(element(by.id('room-members-view'))) await waitFor(element(by.id('room-members-view')))
.toExist() .toBeVisible()
.withTimeout(2000); .withTimeout(2000);
await waitFor(element(by.id('room-actions-add-user'))) await waitFor(element(by.id('room-actions-add-user')))
.toExist() .toBeVisible()
.withTimeout(10000); .withTimeout(10000);
await element(by.id('room-actions-add-user')).tap(); await element(by.id('room-actions-add-user')).tap();
const rocketCat = 'rocket.cat'; const rocketCat = 'rocket.cat';
await element(by.id('select-users-view-search')).replaceText('rocket.cat'); await element(by.id('select-users-view-search')).replaceText('rocket.cat');
await waitFor(element(by.id(`select-users-view-item-${rocketCat}`))) await waitFor(element(by.id(`select-users-view-item-${rocketCat}`)))
.toExist() .toBeVisible()
.withTimeout(10000); .withTimeout(10000);
await element(by.id(`select-users-view-item-${rocketCat}`)).tap(); await element(by.id(`select-users-view-item-${rocketCat}`)).tap();
await waitFor(element(by.id(`selected-user-${rocketCat}`))) await waitFor(element(by.id(`selected-user-${rocketCat}`)))
.toExist() .toBeVisible()
.withTimeout(5000); .withTimeout(5000);
await waitFor(element(by.id('select-users-view-search'))) await waitFor(element(by.id('select-users-view-search')))
.toExist() .toBeVisible()
.withTimeout(4000); .withTimeout(4000);
await element(by.id('select-users-view-search')).tap(); await element(by.id('select-users-view-search')).tap();
await element(by.id('select-users-view-search')).replaceText(otherUser.username); await element(by.id('select-users-view-search')).replaceText(otherUser.username);
await waitFor(element(by.id(`select-users-view-item-${otherUser.username}`))) await waitFor(element(by.id(`select-users-view-item-${otherUser.username}`)))
.toExist() .toBeVisible()
.withTimeout(10000); .withTimeout(10000);
await element(by.id(`select-users-view-item-${otherUser.username}`)).tap(); await element(by.id(`select-users-view-item-${otherUser.username}`)).tap();
await waitFor(element(by.id(`selected-user-${otherUser.username}`))) await waitFor(element(by.id(`selected-user-${otherUser.username}`)))
.toExist() .toBeVisible()
.withTimeout(5000); .withTimeout(5000);
await element(by.id('selected-users-view-submit')).tap(); await element(by.id('selected-users-view-submit')).tap();
@ -324,16 +324,16 @@ describe('Team', () => {
await tapBack(); await tapBack();
await sleep(300); await sleep(300);
await waitFor(element(by.id('room-actions-members'))) await waitFor(element(by.id('room-actions-members')))
.toExist() .toBeVisible()
.withTimeout(10000); .withTimeout(10000);
await element(by.id('room-actions-members')).tap(); await element(by.id('room-actions-members')).tap();
await element(by.id('room-members-view-filter')).tap(); await element(by.id('room-members-view-filter')).tap();
await waitFor(element(by.id('room-members-view-toggle-status-all'))) await waitFor(element(by.id('room-members-view-toggle-status-all')))
.toExist() .toBeVisible()
.withTimeout(2000); .withTimeout(2000);
await element(by.id('room-members-view-toggle-status-all')).tap(); await element(by.id('room-members-view-toggle-status-all')).tap();
await waitFor(element(by.id(`room-members-view-item-${otherUser.username}`))) await waitFor(element(by.id(`room-members-view-item-${otherUser.username}`)))
.toExist() .toBeVisible()
.withTimeout(60000); .withTimeout(60000);
await backToActions(); await backToActions();
}); });