Skip to content
Merged
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
2 changes: 2 additions & 0 deletions example/.owl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
diff/
latest/
Binary file modified example/.owl/baseline/android/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/.owl/baseline/ios/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 26 additions & 6 deletions src/cli/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,18 @@ describe('run.ts', () => {

expect(execMock).toHaveBeenNthCalledWith(
1,
'xcrun simctl install iPhone\\ Simulator RNDemo.app',
'xcrun simctl status_bar iPhone\\ Simulator override --time 9:41',
{ cwd, stdio: 'ignore' }
);

expect(execMock).toHaveBeenNthCalledWith(
2,
'xcrun simctl install iPhone\\ Simulator RNDemo.app',
{ cwd, stdio: 'ignore' }
);

expect(execMock).toHaveBeenNthCalledWith(
3,
`xcrun simctl launch iPhone\\ Simulator ${bundleIdIOS}`,
{ stdio: 'ignore' }
);
Expand Down Expand Up @@ -86,12 +92,18 @@ describe('run.ts', () => {

expect(execMock).toHaveBeenNthCalledWith(
1,
'xcrun simctl install iPhone\\ Simulator RNDemo.app',
'xcrun simctl status_bar iPhone\\ Simulator override --time 9:41',
{ cwd, stdio: 'ignore' }
);

expect(execMock).toHaveBeenNthCalledWith(
2,
'xcrun simctl install iPhone\\ Simulator RNDemo.app',
{ cwd, stdio: 'ignore' }
);

expect(execMock).toHaveBeenNthCalledWith(
3,
`xcrun simctl launch iPhone\\ Simulator ${bundleIdIOS}`,
{ stdio: 'ignore' }
);
Expand Down Expand Up @@ -123,12 +135,16 @@ describe('run.ts', () => {

await run.runAndroid(config, logger);

expect(execMock).toHaveBeenNthCalledWith(1, `adb install -r ${appPath}`, {
expect(execMock).toHaveBeenNthCalledWith(1, `adb shell date 01010941`, {
stdio: 'ignore',
});

expect(execMock).toHaveBeenNthCalledWith(2, `adb install -r ${appPath}`, {
stdio: 'ignore',
});

expect(execMock).toHaveBeenNthCalledWith(
2,
3,
`adb shell monkey -p \"com.rndemo\" -c android.intent.category.LAUNCHER 1`,
{ stdio: 'ignore' }
);
Expand All @@ -147,16 +163,20 @@ describe('run.ts', () => {

await run.runAndroid(config, logger);

expect(execMock).toHaveBeenNthCalledWith(1, `adb shell date 01010941`, {
stdio: 'ignore',
});

expect(execMock).toHaveBeenNthCalledWith(
1,
2,
`adb install -r ${binaryPath}`,
{
stdio: 'ignore',
}
);

expect(execMock).toHaveBeenNthCalledWith(
2,
3,
`adb shell monkey -p \"com.rndemo\" -c android.intent.category.LAUNCHER 1`,
{ stdio: 'ignore' }
);
Expand Down
8 changes: 8 additions & 0 deletions src/cli/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export const runIOS = async (config: Config, logger: Logger) => {
const bundleId = getIOSBundleIdentifier(appPath);
const simulator = config.ios!.device.replace(/([ /])/g, '\\$1');

const SIMULATOR_TIME = '9:41';
const setTimeCommand = `xcrun simctl status_bar ${simulator} override --time ${SIMULATOR_TIME}`;
await execa.command(setTimeCommand, { stdio, cwd });

const installCommand = `xcrun simctl install ${simulator} ${appFilename}`;
await execa.command(installCommand, { stdio, cwd });

Expand All @@ -46,6 +50,10 @@ export const runAndroid = async (config: Config, logger: Logger) => {
const appPath = path.join(cwd, appFilename);
const { packageName } = config.android!;

const SIMULATOR_TIME = '0941';
const setTimeCommand = `adb shell date 0101${SIMULATOR_TIME}`;
await execa.command(setTimeCommand, { stdio });

const installCommand = `adb install -r ${appPath}`;
await execa.command(installCommand, { stdio });

Expand Down