Room Actions

This commit is contained in:
Diego Mello 2023-02-17 09:21:42 -03:00
parent bf73aed144
commit b4b9192ba0
3 changed files with 12 additions and 12 deletions

View File

@ -128,6 +128,7 @@ async function pinMessage(message: string) {
const { textMatcher } = platformTypes[deviceType]; const { textMatcher } = platformTypes[deviceType];
const messageLabel = `${data.random}${message}`; const messageLabel = `${data.random}${message}`;
await waitFor(element(by[textMatcher](messageLabel)).atIndex(0)).toExist(); await waitFor(element(by[textMatcher](messageLabel)).atIndex(0)).toExist();
await element(by[textMatcher](messageLabel)).atIndex(0).tap();
await element(by[textMatcher](messageLabel)).atIndex(0).longPress(); await element(by[textMatcher](messageLabel)).atIndex(0).longPress();
await expect(element(by.id('action-sheet'))).toExist(); await expect(element(by.id('action-sheet'))).toExist();
await expect(element(by.id('action-sheet-handle'))).toBeVisible(); await expect(element(by.id('action-sheet-handle'))).toBeVisible();
@ -190,8 +191,8 @@ async function tryTapping(
} }
async function tapAndWaitFor( async function tapAndWaitFor(
elementToTap: Detox.IndexableNativeElement, elementToTap: Detox.IndexableNativeElement | Detox.NativeElement,
elementToWaitFor: Detox.IndexableNativeElement, elementToWaitFor: Detox.IndexableNativeElement | Detox.NativeElement,
timeout: number timeout: number
) { ) {
try { try {

View File

@ -2,7 +2,7 @@
module.exports = { module.exports = {
rootDir: '..', rootDir: '..',
testSequencer: '<rootDir>/e2e/testSequencer.js', testSequencer: '<rootDir>/e2e/testSequencer.js',
testMatch: ['<rootDir>/e2e/tests/onboarding/*.spec.ts', '<rootDir>/e2e/tests/assorted/*.spec.ts'], testMatch: ['<rootDir>/e2e/tests/**/*.spec.ts'],
testTimeout: 120000, testTimeout: 120000,
maxWorkers: 1, maxWorkers: 1,
globalSetup: '<rootDir>/e2e/globalSetup.ts', globalSetup: '<rootDir>/e2e/globalSetup.ts',

View File

@ -11,7 +11,8 @@ import {
starMessage, starMessage,
pinMessage, pinMessage,
platformTypes, platformTypes,
TTextMatcher TTextMatcher,
tapAndWaitFor
} from '../../helpers/app'; } from '../../helpers/app';
const { sendMessage } = require('../../helpers/data_setup'); const { sendMessage } = require('../../helpers/data_setup');
@ -396,10 +397,7 @@ describe('Room actions screen', () => {
await waitFor(element(by.id('room-actions-members'))) await waitFor(element(by.id('room-actions-members')))
.toExist() .toExist()
.withTimeout(2000); .withTimeout(2000);
await element(by.id('room-actions-members')).tap(); await tapAndWaitFor(element(by.id('room-actions-members')), element(by.id('room-members-view')), 2000);
await waitFor(element(by.id('room-members-view')))
.toExist()
.withTimeout(2000);
}); });
const openActionSheet = async (username: string) => { const openActionSheet = async (username: string) => {
@ -591,10 +589,11 @@ describe('Room actions screen', () => {
await waitFor(element(by[textMatcher]('Message ignored. Tap to display it.')).atIndex(0)) await waitFor(element(by[textMatcher]('Message ignored. Tap to display it.')).atIndex(0))
.toExist() .toExist()
.withTimeout(60000); .withTimeout(60000);
await element(by[textMatcher]('Message ignored. Tap to display it.')).atIndex(0).tap(); await tapAndWaitFor(
await waitFor(element(by[textMatcher](message)).atIndex(0)) element(by[textMatcher]('Message ignored. Tap to display it.')).atIndex(0),
.toExist() element(by[textMatcher](message)).atIndex(0),
.withTimeout(60000); 2000
);
await element(by[textMatcher](message)).atIndex(0).tap(); await element(by[textMatcher](message)).atIndex(0).tap();
}); });