This commit is contained in:
Diego Mello 2023-02-24 08:57:08 -03:00
parent 7e56950437
commit a32817202f
2 changed files with 13 additions and 6 deletions

View File

@ -114,16 +114,25 @@ async function mockMessage(message: string, isThread = false) {
}
async function mockRandomMessage(message: string, isThread = false) {
const matchMessage = async () => {
await waitFor(element(by[textMatcher](message)))
.toExist()
.withTimeout(60000);
await element(by[textMatcher](message)).atIndex(0).tap();
};
const deviceType = device.getPlatform();
const { textMatcher } = platformTypes[deviceType];
const input = isThread ? 'messagebox-input-thread' : 'messagebox-input';
await element(by.id(input)).replaceText(message);
await sleep(300);
await element(by.id('messagebox-send-message')).tap();
await waitFor(element(by[textMatcher](message)))
.toExist()
.withTimeout(60000);
await element(by[textMatcher](message)).atIndex(0).tap();
try {
await matchMessage();
} catch {
// TODO: Create a proper test for this elsewhere.
await dismissReviewNag();
await matchMessage();
}
return message;
}

View File

@ -156,8 +156,6 @@ describe('Threads', () => {
it('should navigate to thread from thread name', async () => {
const messageText = 'navthreadname';
await mockRandomMessage('dummymessagebetweenthethread');
// TODO: Create a proper test for this elsewhere.
await dismissReviewNag();
await element(by.id(`message-thread-button-${thread}`)).tap();
await waitFor(element(by.id('messagebox-input-thread')))
.toExist()