Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified the tool versions and the test suite #48

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions Permissions.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -221,8 +221,6 @@
ORGANIZATIONNAME = Calabash;
TargetAttributes = {
92D569FC18A38F0300B4369B = {
DevelopmentTeam = FYD86LA7RE;
ProvisioningStyle = Manual;
SystemCapabilities = {
com.apple.HealthKit = {
enabled = 1;
Expand All @@ -235,7 +233,7 @@
};
};
buildConfigurationList = 92D569F818A38F0300B4369B /* Build configuration list for PBXProject "Permissions" */;
compatibilityVersion = "Xcode 9.3";
compatibilityVersion = "Xcode 10.0";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -470,6 +468,7 @@
CODE_SIGN_ENTITLEMENTS = Permissions/Permissions.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = FYD86LA7RE;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Permissions/Permissions-Prefix.pch";
Expand Down Expand Up @@ -500,6 +499,7 @@
CODE_SIGN_ENTITLEMENTS = Permissions/Permissions.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = FYD86LA7RE;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Permissions/Permissions-Prefix.pch";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<Properties>
<MonoDevelop.Ide.ItemProperties.Permission__demo PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.Workbench ActiveDocument="Tests.cs">
<Files>
<File FileName="Tests.cs" Line="94" Column="42" />
<File FileName="Tests.cs" Line="166" Column="1" />
</Files>
<Pads>
<Pad Id="MonoDevelop.UnitTesting.TestPad">
<Pad Id="ProjectPad">
<State name="__root__">
<Node name="Permission_demo" expanded="True" selected="True">
<Node name="Permission_demo" expanded="True" />
<Node name="Permission_demo" expanded="True">
<Node name="Permission_demo" expanded="True">
<Node name="Packages" expanded="True">
<Node name="Xamarin.UITest" selected="True" />
</Node>
</Node>
</Node>
</State>
</Pad>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Format":1,"ProjectReferences":[],"MetadataReferences":[{"FilePath":"/Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/4.7-api/mscorlib.dll","Aliases":[],"Framework":null},{"FilePath":"/Users/ahana/Desktop/Permissions/Permissions_UITest/Permission_demo/packages/NUnit.3.12.0/lib/net45/nunit.framework.dll","Aliases":[],"Framework":null},{"FilePath":"/Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/4.7-api/System.Core.dll","Aliases":[],"Framework":null},{"FilePath":"/Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/4.7-api/System.dll","Aliases":[],"Framework":null},{"FilePath":"/Users/ahana/Desktop/Permissions/Permissions_UITest/Permission_demo/packages/Xamarin.UITest.3.0.7/lib/net45/Xamarin.UITest.dll","Aliases":[],"Framework":null}],"Files":["/Users/ahana/Desktop/Permissions/Permissions_UITest/Permission_demo/Tests.cs","/Users/ahana/Desktop/Permissions/Permissions_UITest/Permission_demo/packages.config"],"BuildActions":["Compile","None"],"Analyzers":[],"AdditionalFiles":[],"EditorConfigFiles":[]}
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 3 additions & 2 deletions Permissions_UITest/Permission_demo/Permission_demo.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('packages\NUnit.3.12.0\build\NUnit.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -27,10 +28,10 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath>packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Xamarin.UITest">
<HintPath>..\packages\Xamarin.UITest.2.2.7\lib\net45\Xamarin.UITest.dll</HintPath>
<HintPath>packages\Xamarin.UITest.3.0.7\lib\net45\Xamarin.UITest.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
159 changes: 111 additions & 48 deletions Permissions_UITest/Permission_demo/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,72 +30,135 @@ public void BeforeEachTest()
// #endif
app = ConfigureApp
.iOS
// TODO: Update this path to point to your iOS app and uncomment the
// code if the app is not included in the solution.
//.AppBundle("../../../../../Permissions.app")
// TODO: Update this path to point to your iOS app and uncomment the
// code if the app is not included in the solution.
.AppBundle("/Users/ahanag22/Desktop/Permissions/Products/app/Permissions.app")
.StartApp();

}


// adding Xamarin.UITest tests to the project https://github.com/calabash/Permissions
// The test automates the tapping on the privacy settings menu
// checking if the the popups have been dismissed by the logic here https://github.com/calabash/DeviceAgent.iOS/blob/develop/Server/Utilities/SpringBoardAlerts.m


//Adding Xamarin.UITest tests to the project https://github.com/calabash/Permissions
// App displays iOS privacy settings menu items// tapping each privacy settings menu items that pops up an alert
// checking if the popup is being handled by the logic
// the logic for dismissing popups does recognize the text of the popups
// checked only the popups we've added to our logic here https://github.com/calabash/DeviceAgent.iOS/blob/develop/Server/Utilities/SpringBoardAlerts.m



[Test]
public void AlertShowsUp()
public void AlertShowsUpForContacts()
{
// tapping menu item
app.Tap(x => x.Marked("contacts"));
//taking a screenshot
app.Screenshot("Show Alert for contacts");
app.DismissSpringboardAlerts();
Thread.Sleep(5 * 1000);
//chekcing if the alert has been dismissed
app.Screenshot("Alert dismissed");
}


//creating an anrray of menu items:
string[] stringArray = new string[12];
stringArray[0] = "background location";
stringArray[1] = "contacts";
stringArray[2] = "calendar";
stringArray[3] = "reminders";
stringArray[4] = "microphone";
stringArray[5] = "motion";
stringArray[6] = "camera";
stringArray[7] = "twitter";
stringArray[8] = "apns";
stringArray[9] = "apple music";
stringArray[10] = "speech recognition";
stringArray[11] = "health kit";


for (int i = 0; i < stringArray.Length; i++)
{
//tapping each menu item
app.Tap(x => x.Marked(stringArray[i]));
//taking the screenshot
app.Screenshot("Show Alert for " + stringArray[i]);
//There is generally no need to call DismissSpringboardAlerts()in user test code, I'm calling this method to play it safe
app.DismissSpringboardAlerts();
app.Screenshot("alert dismissed");
//adding a sleep of 5 seconds before tapping the next menu item to give the UI time to be ready
Thread.Sleep(5*1000);
if (i >= 6)
{
app.ScrollDown();

}

}

[Test]
public void AlertShowsUpForReminder()
{
// tapping menu item
app.Tap(x => x.Marked("reminders"));
//taking a screenshot
app.Screenshot("Show Alert for reminders");
app.DismissSpringboardAlerts();
Thread.Sleep(5 * 1000);
//chekcing if the alert has been dismissed
app.Screenshot("Alert dismissed");
}

//checking separtely since tapping on photos naviagates to a different screen
[Test]
public void AlertShowsUpForMicrophone()
{
// tapping menu item
app.Tap(x => x.Marked("microphone"));
//taking a screenshot
app.Screenshot("Show Alert for microphone");
app.DismissSpringboardAlerts();
Thread.Sleep(5 * 1000);
//chekcing if the alert has been dismissed
app.Screenshot("Alert dismissed");
}

[Test]
public void AlertShowsUpForPhotos(){

app.Tap(x => x.Marked("photos"));
app.Screenshot("Alert shows up");
public void AlertShowsUpForMotion()
{
// tapping menu item
app.Tap(x => x.Marked("motion"));
//taking a screenshot
app.Screenshot("Show Alert for motion");
app.DismissSpringboardAlerts();
Thread.Sleep(5 * 1000);
//chekcing if the alert has been dismissed
app.Screenshot("Alert dismissed");
}

[Test]
public void AlertShowsUpForAPNS()
{
app.ScrollDown();
// tapping menu item
app.Tap(x => x.Marked("apns"));
//taking a screenshot
app.Screenshot("Show Alert for apns");
app.DismissSpringboardAlerts();
Thread.Sleep(5 * 1000);
//chekcing if the alert has been dismissed
app.Screenshot("Alert dismissed");
}



[Test]
public void AlertShowsUpForAppleMusic()
{
app.ScrollDown();
// tapping menu item
app.Tap(x => x.Marked("apple music"));
//taking a screenshot
app.Screenshot("Show Alert for apple music");
app.DismissSpringboardAlerts();
Thread.Sleep(5 * 1000);
//chekcing if the alert has been dismissed
app.Screenshot("Alert dismissed");
}


[Test]
public void AlertShowsUpForSpeechRecognition()
{
app.ScrollDown();
// tapping menu item
app.Tap(x => x.Marked("speech recognition"));
//taking a screenshot
app.Screenshot("Show Alert for speech recognition");
app.DismissSpringboardAlerts();
Thread.Sleep(5 * 1000);
//chekcing if the alert has been dismissed
app.Screenshot("Alert dismissed");
}


[Test]
public void AlertShowsUpForTwitter()
{
app.ScrollDown();
// tapping menu item
app.Tap(x => x.Marked("twitter"));
//taking a screenshot
app.Screenshot("Show Alert for twitter");
app.DismissSpringboardAlerts();
Thread.Sleep(5 * 1000);
//chekcing if the alert has been dismissed
app.Screenshot("Alert dismissed");
}
}

}
Expand Down
Binary file not shown.
Binary file modified Permissions_UITest/Permission_demo/bin/Debug/Permission_demo.pdb
Binary file not shown.
Binary file modified Permissions_UITest/Permission_demo/bin/Debug/Xamarin.UITest.dll
Binary file not shown.
Loading