Files
iNaturalistReactNative/e2e/helpers.js
Johannes Klein 16018e6998 1312 e2e experiments (#1320)
* Bump detox

* Update detox

* Disable one test for now

* Bump detox

* Increase test timeouts

* Collect more logs

* Increase run timeout

* Comment

* Increase timeout

* Replace password autofill workaround

* Move workaround after launchApp

* Upgrade github actions workflows

* Forgot one action

* Update test.yml

* Testing concurrency

* Use concurrency for e2e as well

* Remove previous concurrency code

* Testing different Slack action

* Change slack msg

* Try different msg

* Revert "Try different msg"

This reverts commit ddaad331d1.

* Revert "Change slack msg"

This reverts commit 852204b074.

* Revert "Testing different Slack action"

This reverts commit fb072e65e3.

* Testing some more notify

* Testing notification

* Revert "Testing notification"

This reverts commit 974dfcb32f.

* Revert "Testing some more notify"

This reverts commit 39b3d668e2.
2024-03-28 23:41:40 +01:00

37 lines
1.6 KiB
JavaScript

import { execSync } from "child_process";
export async function iNatE2eBeforeAll( device ) {
if ( device.getPlatform() === "android" ) {
await device.launchApp( {
newInstance: true,
permissions: { location: "always" }
} );
}
}
export async function iNatE2eBeforeEach( device ) {
// device.launchApp would be preferred for an app of our complexity. It does work locally
// for both, but on CI for Android it does not work. So we use reloadReactNative for Android.
if ( device.getPlatform() === "android" ) {
await device.reloadReactNative();
} else {
await device.launchApp( {
newInstance: true,
permissions: { location: "always" }
} );
// disable password autofill
execSync(
// eslint-disable-next-line max-len
`plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO ~/Library/Developer/CoreSimulator/Devices/${device.id}/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/UserSettings.plist`
);
execSync(
// eslint-disable-next-line max-len
`plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO ~/Library/Developer/CoreSimulator/Devices/${device.id}/data/Library/UserConfigurationProfiles/EffectiveUserSettings.plist`
);
execSync(
// eslint-disable-next-line max-len
`plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO ~/Library/Developer/CoreSimulator/Devices/${device.id}/data/Library/UserConfigurationProfiles/PublicInfo/PublicEffectiveUserSettings.plist`
);
}
}