-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update rocketchat and add e2e test for deep linking
- Loading branch information
1 parent
8bc8a07
commit 96d4582
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const { | ||
device, element, by, waitFor | ||
} = require('detox'); | ||
const data = require('../../data'); | ||
const { navigateToLogin, login, mockMessage, tapBack, searchRoom } = require('../../helpers/app'); | ||
|
||
const testuser = data.users.regular | ||
const room = data.channels.detoxpublic.name; | ||
const mainRoom = data.groups.private.name; | ||
async function navigateToRoom(roomName) { | ||
await searchRoom(`${ roomName }`); | ||
await waitFor(element(by.id(`rooms-list-view-item-${ roomName }`))).toExist().withTimeout(60000); | ||
await element(by.id(`rooms-list-view-item-${ roomName }`)).tap(); | ||
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000); | ||
} | ||
|
||
describe('Deep linking authentication', () => { | ||
it('should be logged in server from URL', async() => { | ||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true }); | ||
await device.launchApp({ | ||
newInstance: true, | ||
url: 'https://go.rocket.chat/auth', | ||
sourceApp: 'com.apple.mobilesafari', | ||
permissions: { notifications: 'YES' } | ||
}); | ||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(60000); | ||
}); | ||
|
||
it('should be logged in from URL sent to room', async() => { | ||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true }); | ||
await navigateToLogin(); | ||
await login(testuser.username, testuser.password); | ||
await element(by.id('login-view-submit')).tap(); | ||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(60000); | ||
await navigateToRoom(); | ||
await mockMessage('https://go.rocket.chat/auth'); | ||
}); | ||
}); |