Skip to content

Commit

Permalink
Merge pull request #5 from King-of-Spades/espresso-(fixed)
Browse files Browse the repository at this point in the history
Espresso (fixed)
  • Loading branch information
King-of-Spades authored Mar 13, 2018
2 parents 1dde577 + 569878c commit 40aa7a6
Show file tree
Hide file tree
Showing 101 changed files with 104 additions and 62 deletions.
2 changes: 1 addition & 1 deletion Appium/Android/Maven/tcupload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TestCloud_Command='paste command here'
app_path='../swiftnote.apk'
platform='xtcMac/xtc'

# Run using the command "sh upload.sh"
# Run using the command "sh tcupload.sh"
Build_Upload_Command='mvn -DskipTests -P prepare-for-upload package'
eval $Build_Upload_Command

Expand Down
22 changes: 18 additions & 4 deletions Appium/Android/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,35 @@ This sample includes an APK file and a pre-written Appium test suite prepared fo

(Note: The author of this sample used IntelliJ IDEA 2017.3.4 (Ultimate Edition) on Mac OS X 10.13.3, though other tools for building may work.)

# Uploading to AppCenter/Test
# Uploading app & tests
## Uploading to AppCenter/Test
1. Build the Maven project.
2. Generate a command line for upload. [Directions](/../../#appcentertest-command-line)
3. Run the upload command with project-specific arguments:
- **OS X** paste your command as the value for 'AppCenter_Test_Command' in 'upload.sh'. In terminal navigate to the Maven folder and run 'sh upload.sh' to generate the 'test/upload' folder and then upload to AppCenter/Test
- **Windows** The 'tcupload.sh' file is not technically compatible with Windows, however it shows how to modify the generated command to upload this sample manually.
- **Windows** The 'upload.sh' file is not technically compatible with Windows, however it shows how to modify the generated command to upload this sample manually.

See Also: [upload.sh](Maven/upload.sh)

# Uploading to Xamarin Test Cloud
## Uploading to Xamarin Test Cloud
1. Build the Maven project
2. Generate a command line for upload. [Directions](/../../#testcloud-command-line)
3. Unzip 'Maven/xtcMac.zip' or 'Maven/xtcWindows.zip' depending on the platform you're using.
4. Run the upload command with project-specific arguments:
- **OS X** paste your command as the value for 'TestCloud_Command' in 'tcupload.sh'. In terminal navigate to the Maven folder and run 'sh tcupload.sh' to generate the 'test/upload' folder and then upload to AppCenter/Test.
- **Windows** The 'tcupload.sh' file is not technically compatible with Windows, however it shows how to modify the generated command to upload this sample manually.

See Also: [tcupload.sh](Maven/tcupload.sh)
See Also: [tcupload.sh](Maven/tcupload.sh)


# About Swiftnotes Sample App
Within this repo, the sourcecode for this app can be found in the [Espresso/Swiftnotes](../../espresso/swiftnotes) folder. That folder also contains the LICENSE file for the sample.

## License
Copyright © 2017 Adrian Chifor

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
33 changes: 0 additions & 33 deletions Espresso/Swiftnotes-solution/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions Espresso/Swiftnotes-solution/android.sh

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ build/
local.properties
*.iml
.gradle
xtcMac
xtcWin
File renamed without changes.
47 changes: 47 additions & 0 deletions Espresso/Swiftnotes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Build status
[![Build status](https://build.appcenter.ms/v0.1/apps/07cf2b4b-3731-4013-90e5-7d790816a968/branches/master/badge)](https://appcenter.ms)

# Building & running tests locally
## Building
Steps on how to build Swiftnotes:
1. Make sure you have the latest version of Android Studio with Gradle v4.1 and the required Android SDK Tools installed (26.1.1 Build tools)
2. Open the project using *Android Studio > File > Import Project*
3. Select *build.gradle* in Swiftnotes. (Picking another directory may still seem to open the project, but cause trouble building.)
4. Go to *File > Project Structure > SDK Location* and make sure Android SDK and JDK paths are set.
5. Select *Build > Rebuild Project*

## Running tests
To run tests locally:
1. Make sure you can build the app (see above)
2. Navigate in Android Studio to *app > java > com.moonpi.swifnotes (androidTest) > CreateNoteTest*
3. Right-click *CreateNoteTest* and select *Run 'CreateNoteTest'*
4. Select a device or emulator from the dialog to install the app and run the tests.

# Uploading app & tests
## Uploading to App Center Test
1. Build the app & tests locally. (Running locally is optional but a good idea)
2. Generate a command line for upload. [Directions](/../../#appcentertest-command-line)
3. Run the upload command with project-specific arguments:
- **OS X** paste your command as the value for 'AppCenter_Test_Command' in 'upload.sh'. In terminal navigate to the Maven folder and run 'sh upload.sh' to upload to AppCenter/Test
- **Windows** The 'upload.sh' file is not technically compatible with Windows, however it shows how to modify the generated command to upload this sample manually.
See Also: [upload.sh](upload.sh)

## Uploading to Test Cloud
1. Build the app & tests locally. (Running locally is optional but a good idea)
2. Generate a command line for upload. [Directions](/../../#testcloud-command-line)
3. Unzip 'xtcMac.zip' or 'xtcWindows.zip' depending on the platform you're using.
4. Run the upload command with project-specific arguments:
- **OS X** paste your command as the value for 'TestCloud_Command' in 'tcupload.sh', and remove the directory value for '--workspace'. In terminal run 'sh tcupload.sh' to upload to AppCenter/Test.
- **Windows** The 'tcupload.sh' file is not technically compatible with Windows, however it shows how to modify the generated command to upload this sample manually.

See Also: [tcupload.sh](tcupload.sh)

# License for Swiftnotes sample app

Copyright © 2017 Adrian Chifor

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions Espresso/Swiftnotes/tcupload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Provide Test Cloud upload command
TestCloud_Command='paste your command here'
# Delete 'app/build/outputs/apk' because the script is unable to update it when reading the slashes. The "workspace" variable below will add the path back in.

# provide a path to the APK, the workspace, and the unzipped xtcMac or xtcWin folder.
apk_path='app/build/outputs/apk/debug/app-debug.apk'
workspace='--workspace app/build/outputs/apk/androidTest/debug'
platform='xtcMac/xtc'

# Run using the command "sh tcupload.sh"

# Script injects app_path & platform and executes resulting command
TestCloud_Command=${TestCloud_Command/'--workspace'/$workspace}
TestCloud_Command=${TestCloud_Command/'yourAppFile.apk'/$apk_path}
TestCloud_Command=${TestCloud_Command/'xtc'/$platform}
echo $TestCloud_Command
eval $TestCloud_Command
14 changes: 14 additions & 0 deletions Espresso/Swiftnotes/upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Provide AppCenter/Test upload command
AppCenter_Test_Command='paste your command here'

# Point to APK & test build-dir
apk_path='app/build/outputs/apk/debug/app-debug.apk'
build_dir='app/build/outputs/apk/androidTest/debug'

# Run using the command "sh tcupload.sh"

# Script injects set values
AppCenter_Test_Command=${AppCenter_Test_Command/'pathToFile.apk'/$apk_path}
AppCenter_Test_Command=${AppCenter_Test_Command/'pathToEspressoBuildFolder'/$build_dir}
echo $AppCenter_Test_Command
eval $AppCenter_Test_Command
Binary file added Espresso/Swiftnotes/xtcMac.zip
Binary file not shown.
Binary file added Espresso/Swiftnotes/xtcWin.zip
Binary file not shown.
8 changes: 5 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ This sample includes the AppCenter/Test specific steps documented here: https://
- [Xamarin.UITest Android & iOS sample](Xamarin.UITest/UITestDemo) This Xamarin.Forms sample app is compatible with both iOS & Android; and includes a Xamarin.UITest project for the actual tests.


## Espresso
This sample includes the AppCenter/Test specific steps documented here: https://docs.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/espresso



<!--
### iOS (Unfinished)
We are still working on completing an iOS sample.
## Espresso (Unfinished)
This sample includes an Android Studio solution with the root folder set to **AppCenter-Test-Samples/Espresso/Swiftnotes-solution**. It includes the AppCenter/Test specific steps documented here: https://docs.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/espresso
## XCUITest (Unfinished)
This sample includes an XCUITest in an Xcode app set up to run in AppCenter/Test based on the steps documented here: https://docs.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/xcuitest
Expand Down

0 comments on commit 40aa7a6

Please sign in to comment.