-
Notifications
You must be signed in to change notification settings - Fork 2
/
firstTest.spec.js
48 lines (44 loc) · 1.57 KB
/
firstTest.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const { reloadApp, getAppUrl,blacklistLiveReloadUrl,blacklistCmdlineFormat } = require('detox-expo-helpers')
describe('Example', () => {
it('should load the app', async () => {
console.log("Lauching using reloadApp")
await reloadApp();
console.log("App launched")
await expect(element(by.label('Open up App.js to start working on your app!'))).toBeVisible();
});
it('should load the app with the url', async () => {
console.log("Lauching expo with URL")
const url = await getAppUrl();
const blacklist = await blacklistCmdlineFormat()
console.log("Blacklist: ", blacklist)
await device.launchApp({
newInstance: true,
sourceApp: 'host.exp.exponent',
url,
launchArgs: {
EXKernelDisableNuxDefaultsKey: true,
detoxPrintBusyIdleResources: 'YES',
detoxURLBlacklistRegex: blacklist
},
})
console.log("App launched")
await expect(element(by.label('Open up App.js to start working on your app!'))).toBeVisible();
});
it('should open the app URL', async () => {
console.log("Lauching expo")
await device.launchApp({
newInstance: true,
sourceApp: 'host.exp.exponent',
launchArgs: {
EXKernelDisableNuxDefaultsKey: true,
detoxPrintBusyIdleResources: 'YES',
},
})
await blacklistLiveReloadUrl()
const url = await getAppUrl();
console.log("Opening app URL:", url);
await device.openURL({url})
console.log("App launched")
await expect(element(by.label('Open up App.js to start working on your app!'))).toBeVisible();
});
});