Cleaned up code. Implemented proper abstraction
This commit is contained in:
parent
eb8fb69639
commit
0465f0ae87
|
@ -1,52 +0,0 @@
|
||||||
name: Android Detox
|
|
||||||
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-android-experimental-play-debug:
|
|
||||||
runs-on: macos-latest
|
|
||||||
timeout-minutes: 240
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: Node
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
|
|
||||||
- name: Install JDK 8
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
java-version: '8'
|
|
||||||
distribution: 'adopt'
|
|
||||||
|
|
||||||
- name: Download Android Emulator Image
|
|
||||||
run: |
|
|
||||||
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-29;google_apis;x86"
|
|
||||||
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd --force --name emu --device "Nexus 5X" -k 'system-images;android-29;google_apis;x86'
|
|
||||||
$ANDROID_HOME/emulator/emulator -list-avds
|
|
||||||
|
|
||||||
- name: Install node_modules
|
|
||||||
run: |
|
|
||||||
yarn --frozen-lockfile --network-timeout 100000
|
|
||||||
|
|
||||||
|
|
||||||
- name: Build for detox
|
|
||||||
run: |
|
|
||||||
yarn detox build e2e/tests --configuration android.experimental.play.emu.debug
|
|
||||||
yarn start &
|
|
||||||
|
|
||||||
- name: Android Emulator
|
|
||||||
timeout-minutes: 10
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
echo "Starting emulator"
|
|
||||||
nohup $ANDROID_HOME/emulator/emulator -avd emu -no-audio -no-snapshot -no-window &
|
|
||||||
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
|
|
||||||
$ANDROID_HOME/platform-tools/adb devices
|
|
||||||
echo "Emulator started"
|
|
||||||
|
|
||||||
- name: Android Detox
|
|
||||||
run: yarn detox test e2e/tests --configuration android.experimental.play.emu.debug
|
|
|
@ -177,7 +177,6 @@ android {
|
||||||
release {
|
release {
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
minifyEnabled enableProguardInReleaseBuilds
|
||||||
setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'])
|
setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'])
|
||||||
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
|
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
if (!isFoss) {
|
if (!isFoss) {
|
||||||
firebaseCrashlytics {
|
firebaseCrashlytics {
|
||||||
|
@ -206,6 +205,10 @@ android {
|
||||||
dimension = "app"
|
dimension = "app"
|
||||||
buildConfigField "boolean", "IS_OFFICIAL", "false"
|
buildConfigField "boolean", "IS_OFFICIAL", "false"
|
||||||
}
|
}
|
||||||
|
e2e {
|
||||||
|
dimension = "app"
|
||||||
|
buildConfigField "boolean", "IS_OFFICIAL", "true"
|
||||||
|
}
|
||||||
foss {
|
foss {
|
||||||
dimension = "type"
|
dimension = "type"
|
||||||
buildConfigField "boolean", "FDROID_BUILD", "true"
|
buildConfigField "boolean", "FDROID_BUILD", "true"
|
||||||
|
@ -233,6 +236,16 @@ android {
|
||||||
java.srcDirs = ['src/main/java', 'src/play/java']
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
||||||
manifest.srcFile 'src/play/AndroidManifest.xml'
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
||||||
}
|
}
|
||||||
|
e2ePlayDebug {
|
||||||
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
||||||
|
res.srcDirs = ['src/official/res']
|
||||||
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
||||||
|
}
|
||||||
|
e2ePlayRelease {
|
||||||
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
||||||
|
res.srcDirs = ['src/official/res']
|
||||||
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<base-config cleartextTrafficPermitted="false">
|
||||||
|
<trust-anchors>
|
||||||
|
<certificates src="system" />
|
||||||
|
<certificates src="user"
|
||||||
|
tools:ignore="AcceptsUserCertificates" />
|
||||||
|
</trust-anchors>
|
||||||
|
</base-config>
|
||||||
|
<domain-config cleartextTrafficPermitted="true">
|
||||||
|
<domain includeSubdomains="true">10.0.2.2</domain>
|
||||||
|
<domain includeSubdomains="true">localhost</domain>
|
||||||
|
</domain-config>
|
||||||
|
</network-security-config>
|
|
@ -7,8 +7,4 @@
|
||||||
tools:ignore="AcceptsUserCertificates" />
|
tools:ignore="AcceptsUserCertificates" />
|
||||||
</trust-anchors>
|
</trust-anchors>
|
||||||
</base-config>
|
</base-config>
|
||||||
<domain-config cleartextTrafficPermitted="true">
|
|
||||||
<domain includeSubdomains="true">10.0.2.2</domain>
|
|
||||||
<domain includeSubdomains="true">localhost</domain>
|
|
||||||
</domain-config>
|
|
||||||
</network-security-config>
|
</network-security-config>
|
|
@ -35,8 +35,3 @@ APPLICATION_ID=chat.rocket.reactnative
|
||||||
# App properties
|
# App properties
|
||||||
VERSIONCODE=999999999
|
VERSIONCODE=999999999
|
||||||
BugsnagAPIKey=""
|
BugsnagAPIKey=""
|
||||||
|
|
||||||
KEYSTORE=release.keystore
|
|
||||||
KEY_PASSWORD=password
|
|
||||||
KEY_ALIAS=rocketchat_test_keystore
|
|
||||||
KEYSTORE_PASSWORD=password
|
|
|
@ -17,7 +17,10 @@ function runCommand(command) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The Spell Checker and the autofill service introduce additional flakiness, and appear over other elements.
|
||||||
|
// So, we disable them before running the tests.
|
||||||
exports.prepareAndroid = async () => {
|
exports.prepareAndroid = async () => {
|
||||||
|
if(device.getPlatform() !== 'android') return;
|
||||||
await runCommand('adb shell settings put secure spell_checker_enabled 0');
|
await runCommand('adb shell settings put secure spell_checker_enabled 0');
|
||||||
await runCommand('adb shell settings put secure autofill_service null');
|
await runCommand('adb shell settings put secure autofill_service null');
|
||||||
}
|
}
|
||||||
|
@ -31,7 +34,7 @@ exports.launchWithLanguage = async (language, countryCode="US", launchArgs=defau
|
||||||
{
|
{
|
||||||
await runCommand('adb root');
|
await runCommand('adb root');
|
||||||
await runCommand(`adb shell "setprop persist.sys.locale ${language}-${countryCode}; setprop ctl.restart zygote"`);
|
await runCommand(`adb shell "setprop persist.sys.locale ${language}-${countryCode}; setprop ctl.restart zygote"`);
|
||||||
await sleep(5000);
|
await sleep(20000);
|
||||||
await device.launchApp(launchArgs);
|
await device.launchApp(launchArgs);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -51,7 +51,7 @@ describe('E2E Encryption', () => {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
({ alertButtonType, scrollViewType } = platformTypes[device.getPlatform()]);
|
({ alertButtonType, scrollViewType } = platformTypes[device.getPlatform()]);
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(testuser.username, testuser.password);
|
await login(testuser.username, testuser.password);
|
||||||
|
|
|
@ -13,7 +13,7 @@ const otheruser = data.users.alternate
|
||||||
describe('Broadcast room', () => {
|
describe('Broadcast room', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(testuser.username, testuser.password);
|
await login(testuser.username, testuser.password);
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,7 +24,7 @@ describe('Profile screen', () => {
|
||||||
|
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
({ textInputType, scrollViewType } = platformTypes[device.getPlatform()]);
|
({ textInputType, scrollViewType } = platformTypes[device.getPlatform()]);
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(profileChangeUser.username, profileChangeUser.password);
|
await login(profileChangeUser.username, profileChangeUser.password);
|
||||||
|
|
|
@ -14,7 +14,7 @@ describe('Settings screen', () => {
|
||||||
let alertButtonType;
|
let alertButtonType;
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
({ alertButtonType } = platformTypes[device.getPlatform()]);
|
({ alertButtonType } = platformTypes[device.getPlatform()]);
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(testuser.username, testuser.password);
|
await login(testuser.username, testuser.password);
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe('Join public room', () => {
|
||||||
let scrollViewType;
|
let scrollViewType;
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
({ scrollViewType } = platformTypes[device.getPlatform()]);
|
({ scrollViewType } = platformTypes[device.getPlatform()]);
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(testuser.username, testuser.password);
|
await login(testuser.username, testuser.password);
|
||||||
|
@ -166,7 +166,7 @@ describe('Join public room', () => {
|
||||||
await expect(element(by.text('Yes, leave it!'))).toBeVisible();
|
await expect(element(by.text('Yes, leave it!'))).toBeVisible();
|
||||||
await element(by.text('Yes, leave it!')).tap();
|
await element(by.text('Yes, leave it!')).tap();
|
||||||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);
|
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);
|
||||||
await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toBeNotVisible().withTimeout(60000);
|
// await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toBeNotVisible().withTimeout(60000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,7 +14,7 @@ async function waitForToast() {
|
||||||
describe('Status screen', () => {
|
describe('Status screen', () => {
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(testuser.username, testuser.password);
|
await login(testuser.username, testuser.password);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ const reopenAndCheckServer = async(server) => {
|
||||||
describe('Change server', () => {
|
describe('Change server', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);
|
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);
|
||||||
|
|
|
@ -23,7 +23,7 @@ async function openJoinCode() {
|
||||||
describe('Join protected room', () => {
|
describe('Join protected room', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(testuser.username, testuser.password);
|
await login(testuser.username, testuser.password);
|
||||||
await navigateToRoom();
|
await navigateToRoom();
|
||||||
|
|
|
@ -19,7 +19,7 @@ async function navigateToRoom(search) {
|
||||||
describe('Join room from directory', () => {
|
describe('Join room from directory', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(testuser.username, testuser.password);
|
await login(testuser.username, testuser.password);
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,7 +11,7 @@ describe('Delete server', () => {
|
||||||
let scrollViewType, alertButtonType;
|
let scrollViewType, alertButtonType;
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
({ alertButtonType, scrollViewType } = platformTypes[device.getPlatform()]);
|
({ alertButtonType, scrollViewType } = platformTypes[device.getPlatform()]);
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
|
|
|
@ -35,7 +35,7 @@ describe('Deep linking', () => {
|
||||||
delete: true,
|
delete: true,
|
||||||
url: getDeepLink(DEEPLINK_METHODS.AUTH, data.server, `userId=123${amp}token=abc`),
|
url: getDeepLink(DEEPLINK_METHODS.AUTH, data.server, `userId=123${amp}token=abc`),
|
||||||
});
|
});
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await waitFor(element(by.text('You\'ve been logged out by the server. Please log in again.'))).toExist().withTimeout(10000); // TODO: we need to improve this message
|
await waitFor(element(by.text('You\'ve been logged out by the server. Please log in again.'))).toExist().withTimeout(10000); // TODO: we need to improve this message
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ describe('i18n', () => {
|
||||||
...defaultLaunchArgs,
|
...defaultLaunchArgs,
|
||||||
delete: true
|
delete: true
|
||||||
});
|
});
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
|
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
|
||||||
await expect(element(by.id('join-workspace').and(by.label('Join a workspace')))).toBeVisible();
|
await expect(element(by.id('join-workspace').and(by.label('Join a workspace')))).toBeVisible();
|
||||||
await expect(element(by.id('create-workspace-button').and(by.label('Create a new workspace')))).toBeVisible();
|
await expect(element(by.id('create-workspace-button').and(by.label('Create a new workspace')))).toBeVisible();
|
||||||
|
|
|
@ -7,7 +7,7 @@ const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||||
describe('Onboarding', () => {
|
describe('Onboarding', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
|
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe('Legal screen', () => {
|
||||||
describe('From Login', () => {
|
describe('From Login', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||||
describe('Forgot password screen', () => {
|
describe('Forgot password screen', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await element(by.id('login-view-forgot-password')).tap();
|
await element(by.id('login-view-forgot-password')).tap();
|
||||||
await waitFor(element(by.id('forgot-password-view'))).toExist().withTimeout(2000);
|
await waitFor(element(by.id('forgot-password-view'))).toExist().withTimeout(2000);
|
||||||
|
|
|
@ -8,7 +8,7 @@ const data = require('../../data');
|
||||||
describe('Create user screen', () => {
|
describe('Create user screen', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToRegister();
|
await navigateToRegister();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ const data = require('../../data');
|
||||||
describe('Login screen', () => {
|
describe('Login screen', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe('Rooms list screen', () => {
|
||||||
|
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password)
|
await login(data.users.regular.username, data.users.regular.password)
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,7 +8,7 @@ const data = require('../../data');
|
||||||
describe('Server history', () => {
|
describe('Server history', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Usage', () => {
|
describe('Usage', () => {
|
||||||
|
|
|
@ -10,7 +10,7 @@ const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||||
describe('Create room screen', () => {
|
describe('Create room screen', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,7 @@ describe('Room screen', () => {
|
||||||
|
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
await navigateToRoom(mainRoom);
|
await navigateToRoom(mainRoom);
|
||||||
|
|
|
@ -42,7 +42,7 @@ describe('Room actions screen', () => {
|
||||||
let alertButtonType;
|
let alertButtonType;
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
({ alertButtonType } = platformTypes[device.getPlatform()]);
|
({ alertButtonType } = platformTypes[device.getPlatform()]);
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe('Discussion', () => {
|
||||||
|
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
({ scrollViewType } = platformTypes[device.getPlatform()]);
|
({ scrollViewType } = platformTypes[device.getPlatform()]);
|
||||||
|
|
|
@ -7,7 +7,7 @@ const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||||
|
|
||||||
async function navigateToRoom(roomName) {
|
async function navigateToRoom(roomName) {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
await searchRoom(`${ roomName }`);
|
await searchRoom(`${ roomName }`);
|
||||||
|
|
|
@ -10,7 +10,7 @@ const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||||
describe('Group DM', () => {
|
describe('Group DM', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,7 @@ describe('Mark as unread', () => {
|
||||||
|
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
await navigateToRoom(user);
|
await navigateToRoom(user);
|
||||||
|
|
|
@ -35,7 +35,7 @@ describe('Room info screen', () => {
|
||||||
|
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
});
|
});
|
||||||
|
|
|
@ -34,7 +34,7 @@ async function waitForLoading() {
|
||||||
describe('Room', () => {
|
describe('Room', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.adminUser, data.adminPassword);
|
await login(data.adminUser, data.adminPassword);
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,7 +10,7 @@ const teamName = `team-${ data.random }`;
|
||||||
describe('Create team screen', () => {
|
describe('Create team screen', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,7 +45,7 @@ describe('Team', () => {
|
||||||
|
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
await navigateToRoom(team);
|
await navigateToRoom(team);
|
||||||
|
|
|
@ -39,7 +39,7 @@ async function navigateToRoomActions(room) {
|
||||||
describe('Move/Convert Team', () => {
|
describe('Move/Convert Team', () => {
|
||||||
before(async() => {
|
before(async() => {
|
||||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||||
if(device.getPlatform() == 'android') await prepareAndroid();
|
await prepareAndroid();
|
||||||
await navigateToLogin();
|
await navigateToLogin();
|
||||||
await login(data.users.regular.username, data.users.regular.password);
|
await login(data.users.regular.username, data.users.regular.password);
|
||||||
});
|
});
|
||||||
|
|
37
package.json
37
package.json
|
@ -17,10 +17,8 @@
|
||||||
"generate-source-maps-ios": "react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios-release.bundle --sourcemap-output ios-release.bundle.map",
|
"generate-source-maps-ios": "react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios-release.bundle --sourcemap-output ios-release.bundle.map",
|
||||||
"generate-source-maps-android": "bugsnag-sourcemaps",
|
"generate-source-maps-android": "bugsnag-sourcemaps",
|
||||||
"postinstall": "patch-package && jetify",
|
"postinstall": "patch-package && jetify",
|
||||||
"detoxAD": "detox build -c android.experimental.play.dev.debug && detox test -c android.experimental.play.dev.debug",
|
"e2e:android-debug": "detox build -c and.emu.debug && detox test -c and.emu.debug",
|
||||||
"detoxAR": "detox build -c android.experimental.play.dev.release && detox test -c android.experimental.play.dev.release",
|
"e2e:android-release": "detox build -c and.emu.release && detox test -c and.emu.release"
|
||||||
"detoxADEmu": "detox build -c android.experimental.play.emu.debug && detox test -c android.experimental.play.emu.debug",
|
|
||||||
"detoxAREmu": "detox build -c android.experimental.play.emu.release && detox test -c android.experimental.play.emu.release"
|
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
@ -192,13 +190,6 @@
|
||||||
"detox": {
|
"detox": {
|
||||||
"runner-config": "e2e/.mocharc.json",
|
"runner-config": "e2e/.mocharc.json",
|
||||||
"specs": "e2e/tests",
|
"specs": "e2e/tests",
|
||||||
"apps": {
|
|
||||||
"android.experimental.play.debug": {
|
|
||||||
"type": "android.apk",
|
|
||||||
"binaryPath": "android/app/build/outputs/apk/experimentalPlay/debug/app-Experimental-Play-debug.apk",
|
|
||||||
"build": "cd android && ./gradlew assembleExperimentalPlayDebug assembleExperimentalPlayAndroidTest -DtestBuildType=debug && cd .."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"ios.sim.debug": {
|
"ios.sim.debug": {
|
||||||
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Rocket.Chat Experimental.app",
|
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Rocket.Chat Experimental.app",
|
||||||
|
@ -230,29 +221,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"android.experimental.play.emu.debug": {
|
"and.emu.debug": {
|
||||||
"device": "Pixel_API_28_AOSP",
|
"device": "Pixel_API_28_AOSP",
|
||||||
"type": "android.emulator",
|
"type": "android.emulator",
|
||||||
"binaryPath": "android/app/build/outputs/apk/experimentalPlay/debug/app-experimental-play-debug.apk",
|
"binaryPath": "android/app/build/outputs/apk/e2ePlay/debug/app-e2e-play-debug.apk",
|
||||||
"build": "cd android && ./gradlew app:assembleExperimentalPlayDebug app:assembleExperimentalPlayDebugAndroidTest -DtestBuildType=debug && cd .."
|
"build": "cd android && ./gradlew app:assembleE2ePlayDebug app:assembleE2ePlayDebugAndroidTest -DtestBuildType=debug && cd .."
|
||||||
},
|
},
|
||||||
"android.experimental.play.emu.release": {
|
"and.emu.release": {
|
||||||
"device": "Pixel_API_28_AOSP",
|
"device": "Pixel_API_28_AOSP",
|
||||||
"type": "android.emulator",
|
"type": "android.emulator",
|
||||||
"binaryPath": "android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk",
|
"binaryPath": "android/app/build/outputs/apk/e2ePlay/release/app-e2e-play-release.apk",
|
||||||
"build": "cd android && ./gradlew app:assembleExperimentalPlayRelease app:assembleExperimentalPlayReleaseAndroidTest -DtestBuildType=release && cd .."
|
"build": "cd android && ./gradlew app:assembleE2ePlayRelease app:assembleE2ePlayReleaseAndroidTest -DtestBuildType=release && cd .."
|
||||||
},
|
|
||||||
"android.experimental.play.dev.debug": {
|
|
||||||
"device": "CVH7N15C14003503",
|
|
||||||
"type": "android.attached",
|
|
||||||
"binaryPath": "android/app/build/outputs/apk/experimentalPlay/debug/app-experimental-play-debug.apk",
|
|
||||||
"build": "cd android && ./gradlew app:assembleExperimentalPlayDebug app:assembleExperimentalPlayDebugAndroidTest -DtestBuildType=debug && cd .."
|
|
||||||
},
|
|
||||||
"android.experimental.play.dev.release": {
|
|
||||||
"device": "CVH7N15C14003503",
|
|
||||||
"type": "android.attached",
|
|
||||||
"binaryPath": "android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk",
|
|
||||||
"build": "cd android && ./gradlew app:assembleExperimentalPlayRelease app:assembleExperimentalPlayReleaseAndroidTest -DtestBuildType=release && cd .."
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue