-
Notifications
You must be signed in to change notification settings - Fork 0
/
18.user-activities.test.js
34 lines (29 loc) · 1.28 KB
/
18.user-activities.test.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
const DetoxConstants = require('detox').DetoxConstants;
describe(':ios: User Activity', () => {
it('Init from browsing web', async () => {
// await device.__debug_sleep(10000);
await device.launchApp({newInstance: true, userActivity: userActivityBrowsingWeb});
await expect(element(by.text('https://my.deeplink.dtx'))).toBeVisible();
});
it('Background searchable item', async () => {
await device.launchApp({newInstance: true});
await device.sendToHome();
await device.launchApp({newInstance: false, userActivity: userActivitySearchableItem});
await expect(element(by.text('com.test.itemId'))).toBeVisible();
});
it('Foreground browsing web', async () => {
await device.launchApp({newInstance: true});
await device.sendUserActivity(userActivityBrowsingWeb);
await expect(element(by.text('https://my.deeplink.dtx'))).toBeVisible();
});
});
const userActivityBrowsingWeb = {
"activityType": DetoxConstants.userActivityTypes.browsingWeb,
"webpageURL": "https://my.deeplink.dtx",
"referrerURL": "https://google.com/"
};
const userActivitySearchableItem = {
"activityType": DetoxConstants.userActivityTypes.searchableItem,
"userInfo": {}
};
userActivitySearchableItem.userInfo[DetoxConstants.searchableItemActivityIdentifier] = "com.test.itemId"