-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Timeline self-integration testing (wix#2522)
- Loading branch information
Showing
24 changed files
with
515 additions
and
19 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
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,9 @@ | ||
let _timestamp = 1000; | ||
|
||
function nextTimestamp() { | ||
const timestamp = _timestamp; | ||
_timestamp += 100; | ||
return timestamp; | ||
} | ||
|
||
module.exports = nextTimestamp; |
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 @@ | ||
describe('Fake-timestamps provider', () => { | ||
it('should provide timestamps in fixed intervals', () => { | ||
const now = require('./fakeTimestampsProvider'); | ||
expect(now()).toEqual(1000); | ||
expect(now()).toEqual(1100); | ||
expect(now()).toEqual(1200); | ||
}); | ||
}); |
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
3 changes: 3 additions & 0 deletions
3
detox/test/integration/__snapshots__/timeline-artifact.test.js.snap
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,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Timeline integration test should deterministically produce a timeline artifact 1`] = `"[{\\"name\\":\\"process_name\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1000,\\"ph\\":\\"M\\",\\"args\\":{\\"name\\":\\"detox\\"}},{\\"name\\":\\"thread_name\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1000,\\"ph\\":\\"M\\",\\"args\\":{\\"name\\":\\"Worker #2\\"}},{\\"name\\":\\"detoxInit\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1100,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"acquireDevice\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1200,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"acquireDevice\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1300,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"appUninstall\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1400,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"appUninstall\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1500,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"appInstall\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1600,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"appInstall\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1700,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"launchApp\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1800,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"launchApp\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":1900,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"detoxInit\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2000,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"StubDevice#2\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2100,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"Stub2\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2200,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"should have welcome screen\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2300,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2400,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2500,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"should have welcome screen\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2600,\\"ph\\":\\"E\\",\\"args\\":{\\"status\\":\\"passed\\"}},{\\"name\\":\\"should show hello screen after tap\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2700,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2800,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":2900,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"should show hello screen after tap\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3000,\\"ph\\":\\"E\\",\\"args\\":{\\"status\\":\\"passed\\"}},{\\"name\\":\\"Stub2\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3100,\\"ph\\":\\"E\\",\\"args\\":{}},{\\"name\\":\\"StubDevice#2\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3200,\\"ph\\":\\"E\\",\\"args\\":{}},{\\"name\\":\\"process_name\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1000,\\"ph\\":\\"M\\",\\"args\\":{\\"name\\":\\"detox\\"}},{\\"name\\":\\"thread_name\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1000,\\"ph\\":\\"M\\",\\"args\\":{\\"name\\":\\"Worker #1\\"}},{\\"name\\":\\"detoxInit\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1100,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"acquireDevice\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1200,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"acquireDevice\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1300,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"appUninstall\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1400,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"appUninstall\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1500,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"appInstall\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1600,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"appInstall\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1700,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"launchApp\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1800,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"launchApp\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":1900,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"detoxInit\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2000,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"StubDevice#1\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2100,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"Stub3\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2200,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"should have welcome screen\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2300,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2400,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2500,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"should have welcome screen\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2600,\\"ph\\":\\"E\\",\\"args\\":{\\"status\\":\\"passed\\"}},{\\"name\\":\\"should show hello screen after tap\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2700,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2800,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":2900,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"should show hello screen after tap\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":3000,\\"ph\\":\\"E\\",\\"args\\":{\\"status\\":\\"passed\\"}},{\\"name\\":\\"should show world screen after tap\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":3100,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":3200,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":3300,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"should show world screen after tap\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":3400,\\"ph\\":\\"E\\",\\"args\\":{\\"status\\":\\"passed\\"}},{\\"name\\":\\"Stub3\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":3500,\\"ph\\":\\"E\\",\\"args\\":{}},{\\"name\\":\\"StubDevice#1\\",\\"pid\\":0,\\"tid\\":\\"1\\",\\"ts\\":3600,\\"ph\\":\\"E\\",\\"args\\":{}},{\\"name\\":\\"process_name\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3300,\\"ph\\":\\"M\\",\\"args\\":{\\"name\\":\\"detox\\"}},{\\"name\\":\\"thread_name\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3300,\\"ph\\":\\"M\\",\\"args\\":{\\"name\\":\\"Worker #2\\"}},{\\"name\\":\\"detoxInit\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3400,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"acquireDevice\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3500,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"acquireDevice\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3600,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"appUninstall\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3700,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"appUninstall\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3800,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"appInstall\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":3900,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"appInstall\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4000,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"launchApp\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4100,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"launchApp\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4200,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"detoxInit\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4300,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"StubDevice#2\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4400,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"Stub1\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4500,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"should have welcome screen\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4600,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4700,\\"ph\\":\\"B\\",\\"args\\":{}},{\\"name\\":\\"reloadRN\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4800,\\"ph\\":\\"E\\",\\"args\\":{\\"success\\":true}},{\\"name\\":\\"should have welcome screen\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":4900,\\"ph\\":\\"E\\",\\"args\\":{\\"status\\":\\"failed\\"}},{\\"name\\":\\"Stub1\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":5000,\\"ph\\":\\"E\\",\\"args\\":{}},{\\"name\\":\\"StubDevice#2\\",\\"pid\\":0,\\"tid\\":\\"2\\",\\"ts\\":5100,\\"ph\\":\\"E\\",\\"args\\":{}}"`; |
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 @@ | ||
module.exports = { | ||
"testMatch": ["<rootDir>/*.test.js"], | ||
"testTimeout": 120000, | ||
"verbose": true, | ||
"bail": false, | ||
}; |
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,10 @@ | ||
module.exports = { | ||
"rootDir": "../..", | ||
"testEnvironment": "../test/e2e/environment.js", | ||
"testRunner": "../test/node_modules/jest-circus/runner", | ||
"testMatch": ["<rootDir>/integration/e2e/*.test.js"], | ||
"setupFilesAfterEnv": [], | ||
"testTimeout": 120000, | ||
"verbose": false, | ||
"bail": false, | ||
}; |
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 @@ | ||
describe('Stub1', () => { | ||
beforeEach(async () => { | ||
await device.reloadReactNative(); | ||
await element(by.text('Sanity')).tap(); | ||
}); | ||
|
||
it('should have welcome screen', async () => { | ||
await expect(element(by.text('Welcome'))).toBeVisible(); | ||
await expect(element(by.text('Say Hello'))).toBeVisible(); | ||
await expect(element(by.text('Say World'))).toBeVisible(); | ||
throw new Error(`I'm only here to make things interesting!`); | ||
}); | ||
}); |
Oops, something went wrong.