Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions detox/detox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ declare global {
localIdentifier?: string;
networkLogsIncludeHosts?: string[];
networkLogsExcludeHosts?: string[];
autoGrantPermissions?: boolean;
}

interface DetoxCloudAuthConfig {
Expand Down
8 changes: 7 additions & 1 deletion detox/src/configuration/composeSessionConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const log = require('../utils/logger').child({ cat: 'config' });
*/
async function composeSessionConfig(options) {
const { errorComposer, cliConfig, globalConfig, localConfig, isCloudSession } = options;
const cloudSupportedCaps = ['server', 'name', 'project', 'build', 'local', 'forceLocal', 'localIdentifier', 'networkLogsIncludeHosts', 'networkLogsExcludeHosts'];
const cloudSupportedCaps = ['server', 'name', 'project', 'build', 'local', 'forceLocal', 'localIdentifier', 'networkLogsIncludeHosts', 'networkLogsExcludeHosts', 'autoGrantPermissions'];
const session = {
...globalConfig.session,
...localConfig.session,
Expand Down Expand Up @@ -90,6 +90,12 @@ async function composeSessionConfig(options) {
throw errorComposer.invalidCloudSessionProperty('forceLocal', 'boolean');
}
}
if (session.autoGrantPermissions != null) {
const value = session.autoGrantPermissions;
if (typeof value !== 'boolean') {
throw errorComposer.invalidCloudSessionProperty('autoGrantPermissions', 'boolean');
}
}
if (session.localIdentifier != null) {
const value = session.localIdentifier;
if (typeof value !== 'string' || value.length === 0) {
Expand Down
3 changes: 2 additions & 1 deletion detox/src/configuration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ async function composeDetoxConfig({
'forceLocal': _.get(sessionConfig, 'forceLocal'),
'localIdentifier': _.get(sessionConfig, 'localIdentifier'),
'networkLogsIncludeHosts': _.get(sessionConfig, 'networkLogsIncludeHosts'),
'networkLogsExcludeHosts': _.get(sessionConfig, 'networkLogsExcludeHosts')
'networkLogsExcludeHosts': _.get(sessionConfig, 'networkLogsExcludeHosts'),
'autoGrantPermissions': _.get(sessionConfig, 'autoGrantPermissions')
};
sessionConfig.server += `?caps=${encodeURIComponent(JSON.stringify(query_param))}`;
}
Expand Down