This commit is contained in:
Diego Mello 2023-02-16 10:29:14 -03:00
parent 2ef69a80db
commit 579af558f4
2 changed files with 4 additions and 14 deletions

View File

@ -1,5 +1,3 @@
import { exec } from 'child_process';
import { by, expect, element } from 'detox';
import data from '../data';
@ -157,12 +155,7 @@ async function searchRoom(room: string) {
await waitFor(element(by.id('rooms-list-view')))
.toBeVisible()
.withTimeout(30000);
await element(by.id('rooms-list-view-search')).tap();
await waitFor(element(by.id('rooms-list-view-search-input')))
.toExist()
.withTimeout(5000);
await expect(element(by.id('rooms-list-view-search-input'))).toExist();
await sleep(300);
await tapAndWaitFor(element(by.id('rooms-list-view-search')), element(by.id('rooms-list-view-search-input')), 5000);
await element(by.id('rooms-list-view-search-input')).typeText(room);
await sleep(300);
await waitFor(element(by.id(`rooms-list-view-item-${room}`)))
@ -170,7 +163,6 @@ async function searchRoom(room: string) {
.withTimeout(60000);
}
// eslint-disable-next-line no-undef
async function tryTapping(theElement: Detox.IndexableNativeElement, timeout: number, longtap = false) {
try {
if (longtap) {

View File

@ -9,7 +9,8 @@ import {
searchRoom,
logout,
platformTypes,
TTextMatcher
TTextMatcher,
tapAndWaitFor
} from '../../helpers/app';
import data from '../../data';
@ -261,10 +262,7 @@ describe('E2E Encryption', () => {
await waitFor(element(by.id('listheader-encryption')))
.toBeVisible()
.withTimeout(2000);
await element(by.id('listheader-encryption')).tap();
await waitFor(element(by.id('e2e-enter-your-password-view')))
.toBeVisible()
.withTimeout(2000);
await tapAndWaitFor(element(by.id('listheader-encryption')), element(by.id('e2e-enter-your-password-view')), 2000);
await element(by.id('e2e-enter-your-password-view-password')).typeText(newPassword);
await element(by.id('e2e-enter-your-password-view-confirm')).tap();
await waitFor(element(by.id('listheader-encryption')))