-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add integration(e2e) test (#424)
* init detox e2e test * Add first e2e test * add android configurations * fix detox rn-camera problem * add CI integration * update ci settings * update xcode version * use legacy build in CI * prettier xcode output * update with android * revert back to origin CI test * add E2E test in readme * Update .travis.yml * update detox guide * renaming * update readme * Update README.md Co-Authored-By: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> * Update .travis.yml * Update README.md * fix binary path problem * remove before each reloading * rephrase
- Loading branch information
1 parent
66428c9
commit 0ba9966
Showing
15 changed files
with
629 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
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
24 changes: 24 additions & 0 deletions
24
android/app/src/androidTest/java/io/parity/signer/DetoxTest.java
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,24 @@ | ||
package io.parity.signer; | ||
|
||
import com.wix.detox.Detox; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import androidx.test.filters.LargeTest; | ||
import androidx.test.rule.ActivityTestRule; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@LargeTest | ||
public class DetoxTest { | ||
|
||
@Rule | ||
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false); | ||
|
||
@Test | ||
public void runDetoxTests() { | ||
Detox.runTests(mActivityRule); | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"setupFilesAfterEnv": ["./init.js"], | ||
"testEnvironment": "node", | ||
"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,11 @@ | ||
import testIDs from "./testIDs"; | ||
|
||
describe('Load test', () => { | ||
it('should have account list screen', async () => { | ||
await expect(element(by.id(testIDs.TacScreen.tacView))).toBeVisible(); | ||
await element(by.id(testIDs.TacScreen.agreePrivacyButton)).tap(); | ||
await element(by.id(testIDs.TacScreen.agreeTacButton)).tap(); | ||
await element(by.id(testIDs.TacScreen.nextButton)).tap(); | ||
await expect(element(by.id(testIDs.AccountListScreen.accountList))).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const detox = require('detox'); | ||
const config = require('../package.json').detox; | ||
const adapter = require('detox/runners/jest/adapter'); | ||
const specReporter = require('detox/runners/jest/specReporter'); | ||
|
||
// Set the default timeout | ||
jest.setTimeout(120000); | ||
jasmine.getEnv().addReporter(adapter); | ||
|
||
// This takes care of generating status logs on a per-spec basis. By default, jest only reports at file-level. | ||
// This is strictly optional. | ||
jasmine.getEnv().addReporter(specReporter); | ||
|
||
beforeAll(async () => { | ||
await detox.init(config); | ||
}); | ||
|
||
beforeEach(async () => { | ||
await adapter.beforeEach(); | ||
}); | ||
|
||
afterAll(async () => { | ||
await adapter.afterAll(); | ||
await detox.cleanup(); | ||
}); |
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,13 @@ | ||
const testIDs = { | ||
TacScreen: { | ||
tacView: 'tac_view', | ||
agreeTacButton: 'tac_agree', | ||
agreePrivacyButton: 'tac_privacy', | ||
nextButton: 'tac_next' | ||
}, | ||
AccountListScreen: { | ||
accountList: 'accountList', | ||
} | ||
}; | ||
|
||
export default testIDs; |
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.