-
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.
- Loading branch information
Showing
5 changed files
with
80 additions
and
9 deletions.
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
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
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,63 @@ | ||
import { by, device, element, waitFor } from 'detox'; | ||
|
||
import { login, logout, navigateToLogin } from '../../helpers/app'; | ||
import { createRandomUser } from '../../helpers/data_setup'; | ||
|
||
describe('Change password required', () => { | ||
let user = { username: '', password: '' }; | ||
|
||
beforeAll(async () => { | ||
user = await createRandomUser({ requirePasswordChange: true }); | ||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true }); | ||
await navigateToLogin(); | ||
await login(user.username, user.password); | ||
}); | ||
|
||
describe('Usage', () => { | ||
it('should have required password info displayed', async () => { | ||
await waitFor(element(by.id(`change-password-required-button`))) | ||
.toExist() | ||
.withTimeout(5000); | ||
}); | ||
|
||
it('should logout correctly', async () => { | ||
await waitFor(element(by.id(`change-password-required-logout`))) | ||
.toExist() | ||
.withTimeout(5000); | ||
await element(by.id('change-password-required-logout')).tap(); | ||
await waitFor(element(by.id('new-server-view'))) | ||
.toExist() | ||
.withTimeout(10000); | ||
}); | ||
|
||
it('should change password correctly', async () => { | ||
await navigateToLogin(); | ||
await login(user.username, user.password); | ||
await waitFor(element(by.id(`change-password-required-button`))) | ||
.toExist() | ||
.withTimeout(5000); | ||
await element(by.id('change-password-required-button')).tap(); | ||
await waitFor(element(by.id(`action-sheet-content-with-input-and-submit`))) | ||
.toExist() | ||
.withTimeout(5000); | ||
await element(by.id('change-password-required-sheet-input-0')).replaceText('123456'); | ||
await element(by.id('change-password-required-sheet-input-1')).replaceText('123456'); | ||
await element(by.id('change-password-required-sheet-confirm')).tap(); | ||
await waitFor(element(by.id(`change-password-required-button`))) | ||
.not.toExist() | ||
.withTimeout(5000); | ||
await waitFor(element(by.id('rooms-list-view-item-general'))) | ||
.toExist() | ||
.withTimeout(10000); | ||
await logout(); | ||
}); | ||
|
||
it('should login correctly after password change', async () => { | ||
await navigateToLogin(); | ||
await login(user.username, '123456'); | ||
await waitFor(element(by.id('rooms-list-view-item-general'))) | ||
.toExist() | ||
.withTimeout(10000); | ||
}); | ||
}); | ||
}); |