Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: add automated end-to-end testing using detox (#230)
* add detox to project * configure env * add README.md * fix test * add eslint-plugin-detox * switch to release * fix Ðbinary path to test release version Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
- Loading branch information
Showing
10 changed files
with
1,039 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"testRunner": "jest", | ||
"runnerConfig": "e2e/config.json", | ||
"configurations": { | ||
"ios": { | ||
"type": "ios.simulator", | ||
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/Chatwoot.app", | ||
"build": "xcodebuild -workspace ios/Chatwoot.xcworkspace -scheme Chatwoot -configuration Release -sdk iphonesimulator -derivedDataPath ios/build", | ||
"device": { | ||
"type": "iPhone 11" | ||
} | ||
}, | ||
"android": { | ||
"type": "android.emulator", | ||
"binaryPath": "SPECIFY_PATH_TO_YOUR_APP_BINARY", | ||
"device": { | ||
"avdName": "Pixel_2_API_29" | ||
} | ||
} | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"testEnvironment": "./environment", | ||
"testRunner": "jest-circus/runner", | ||
"testTimeout": 120000, | ||
"testRegex": "\\.e2e\\.js$", | ||
"reporters": ["detox/runners/jest/streamlineReporter"], | ||
"verbose": true | ||
} |
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,23 @@ | ||
const { | ||
DetoxCircusEnvironment, | ||
SpecReporter, | ||
WorkerAssignReporter, | ||
} = require('detox/runners/jest-circus'); | ||
|
||
class CustomDetoxEnvironment extends DetoxCircusEnvironment { | ||
constructor(config) { | ||
super(config); | ||
|
||
// Can be safely removed, if you are content with the default value (=300000ms) | ||
this.initTimeout = 300000; | ||
|
||
// This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level. | ||
// This is strictly optional. | ||
this.registerListeners({ | ||
SpecReporter, | ||
WorkerAssignReporter, | ||
}); | ||
} | ||
} | ||
|
||
module.exports = CustomDetoxEnvironment; |
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,11 @@ | ||
/* eslint-env detox/detox, jest */ | ||
|
||
describe('Example', () => { | ||
beforeEach(async () => { | ||
await device.reloadReactNative(); | ||
}); | ||
|
||
it('should have welcome screen', async () => { | ||
await expect(element(by.text('Connect'))).toBeVisible(); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -651,4 +651,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: 359eeed31941826235cdc4a3c6b998cb2e176764 | ||
|
||
COCOAPODS: 1.8.4 | ||
COCOAPODS: 1.9.3 |
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
Oops, something went wrong.