Skip to content

Commit

Permalink
Adjust iOS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d4vidi committed Dec 20, 2023
1 parent 5646532 commit 4650de8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion detox/test/e2e/15.urls-and-launchArgs.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { urlDriver } = require('./drivers/url-driver');
const { launchArgsDriver } = require('./drivers/launch-args-driver');

describe('Launch arguments while handing launch URLs', () => {
describe(':android: Launch arguments while handing launch URLs', () => {
it('should pass user args in normally', async () => {
const userArgs = {
how: 'about some',
Expand Down
12 changes: 8 additions & 4 deletions detox/test/e2e/18.user-activities.test.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
const { urlDriver } = require('./drivers/url-driver');
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();
await urlDriver.navToUrlScreen();
await urlDriver.assertUrl('https://my.deeplink.dtx');
});

it('Background searchable item', async () => {
await device.launchApp({newInstance: true});
await urlDriver.navToUrlScreen();
await device.sendToHome();
await device.launchApp({newInstance: false, userActivity: userActivitySearchableItem});
await expect(element(by.text('com.test.itemId'))).toBeVisible();
await urlDriver.assertUrl('com.test.itemId');
});

it('Foreground browsing web', async () => {
await device.launchApp({newInstance: true});
await urlDriver.navToUrlScreen();
await device.sendUserActivity(userActivityBrowsingWeb);
await expect(element(by.text('https://my.deeplink.dtx'))).toBeVisible();
await urlDriver.assertUrl('https://my.deeplink.dtx');
});
});

Expand All @@ -31,4 +35,4 @@ const userActivitySearchableItem = {
"activityType": DetoxConstants.userActivityTypes.searchableItem,
"userInfo": {}
};
userActivitySearchableItem.userInfo[DetoxConstants.searchableItemActivityIdentifier] = "com.test.itemId"
userActivitySearchableItem.userInfo[DetoxConstants.searchableItemActivityIdentifier] = "com.test.itemId"

0 comments on commit 4650de8

Please sign in to comment.