Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(integration tests): added sample test that only enter a nickname…
… on first launch and click on 'Let's chat' then check if app loaded correctly
- Loading branch information
Showing
13 changed files
with
99 additions
and
14 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
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
25 changes: 25 additions & 0 deletions
25
client/react-native/common/integration/tests/AppLoading.js
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,25 @@ | ||
import { Platform } from 'react-native' | ||
|
||
export default function (spec) { | ||
spec.describe('App loading', function () { | ||
spec.it('works', async function () { | ||
const androidLoadingTimeout = 30000 | ||
const iosLoadingTimeout = 10000 | ||
const webLoadingTimeout = 2000 | ||
const loadingTimeout = () => { | ||
switch (Platform.OS) { | ||
case 'web': return webLoadingTimeout | ||
case 'android': return androidLoadingTimeout | ||
case 'ios': return iosLoadingTimeout | ||
default: return 0 | ||
} | ||
} | ||
|
||
console.info('Wait for app loaded - timeout ' + (loadingTimeout() / 1000) + ' sec') | ||
await spec.pause(loadingTimeout()) | ||
|
||
console.info('Check if empty conversation list loaded correctly') | ||
await spec.exists('ChatList.NewConvButton') | ||
}) | ||
}) | ||
} |
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,7 @@ | ||
export default function (spec) { | ||
spec.describe('Chat', function () { | ||
spec.it('works', async function () { | ||
console.warn('Chat test is empty') | ||
}) | ||
}) | ||
} |
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,7 @@ | ||
export default function (spec) { | ||
spec.describe('Contact', function () { | ||
spec.it('works', async function () { | ||
console.warn('Contact test is empty') | ||
}) | ||
}) | ||
} |
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,7 @@ | ||
export default function (spec) { | ||
spec.describe('DevTools', function () { | ||
spec.it('works', async function () { | ||
console.warn('DevTools is empty') | ||
}) | ||
}) | ||
} |
27 changes: 27 additions & 0 deletions
27
client/react-native/common/integration/tests/Onboarding.js
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,27 @@ | ||
export default function (spec) { | ||
spec.describe('Onboarding', function () { | ||
spec.it('works', async function () { | ||
let authScreenExists | ||
const nickname = process.env['NICKNAME'] || 'Berty' | ||
|
||
try { | ||
await spec.exists('Auth.TextInput') | ||
authScreenExists = true | ||
} catch (error) { | ||
authScreenExists = false | ||
} | ||
|
||
if (authScreenExists === true) { | ||
await spec.pause(2400) | ||
console.info('Fill text input with nickname "' + nickname + '"') | ||
await spec.fillIn('Auth.TextInput', nickname) | ||
|
||
await spec.pause(2400) | ||
console.info('Press validation button') | ||
await spec.press('Auth.Button') | ||
} else { | ||
console.log('Auth screen skipped') | ||
} | ||
}) | ||
}) | ||
} |
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