Commit 61aa971d authored by shubham's avatar shubham

BUNCH OF PROGRESS. STARTING FIRST MODULE

parent b890f18a
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Input;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;
namespace CodedUITestProject
{
/// <summary>
/// Summary description for CodedUITest1
/// </summary>
[CodedUITest]
public class CodedUITest1
{
public CodedUITest1()
{
}
[TestMethod]
public void CodedUITestMethod1()
{
// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
}
#region Additional test attributes
// You can use the following additional attributes as you write your tests:
////Use TestInitialize to run code before running each test
//[TestInitialize()]
//public void MyTestInitialize()
//{
// // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
//}
////Use TestCleanup to run code after each test has run
//[TestCleanup()]
//public void MyTestCleanup()
//{
// // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
//}
#endregion
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
private TestContext testContextInstance;
public UIMap UIMap
{
get
{
if (this.map == null)
{
this.map = new UIMap();
}
return this.map;
}
}
private UIMap map;
}
}
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{81949951-5980-455C-9329-3F5813D8AAA3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CodedUITestProject</RootNamespace>
<AssemblyName>CodedUITestProject</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>CodedUITest</TestProjectType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
<Visible>False</Visible>
</CodeAnalysisDependentAssemblyPaths>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UIMap.cs" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' Or '$(VisualStudioVersion)' == '11.0') And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="UIAutomationTypes" />
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CodedUITestProject")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CodedUITestProject")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("81949951-5980-455c-9329-3f5813d8aaa3")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
namespace CodedUITestProject
{
public partial class UIMap
{
}
}
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DF2F8E59-B31D-4C48-B8E5-54B8CB2EA4FC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CodedUITestProject1</RootNamespace>
<AssemblyName>CodedUITestProject1</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>True</IsCodedUITest>
<TestProjectType>CodedUITest</TestProjectType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
<Visible>False</Visible>
</CodeAnalysisDependentAssemblyPaths>
</ItemGroup>
<ItemGroup>
<Compile Include="CodedUITest1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UIMap.cs" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' Or '$(VisualStudioVersion)' == '11.0') And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="UIAutomationTypes" />
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CodedUITestProject1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CodedUITestProject1")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("df2f8e59-b31d-4c48-b8e5-54b8cb2ea4fc")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using Personal_Insight.Models;
using Personal_Insight.Pages;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Personal_Insight.ComputeProduct
{
class Android_Device_Configuration_Service
{
private GoogleProductModel googleProduct;
private IntroPage_5 page;
public GoogleProductModel GoogleProduct { get => googleProduct; set => googleProduct = value; }
public List<Devices> devicesList;
public Android_Device_Configuration_Service()
{
}
public void startWork(IntroPage_5 page)
{
this.page = page;
page.enterLog("Starting work on Android_Device_Configuration_Service");
calculate_numFiles();
gatherDevices();
}
private void gatherDevices()
{
devicesList = new List<Devices>();
string[] files = Directory.GetFiles(googleProduct.ProductFolderPath);
foreach(String file in files)
{
page.enterLog(file);
}
}
private void calculate_numFiles()
{
string[] files = Directory.GetFiles(googleProduct.ProductFolderPath);
googleProduct.NumItems = files.Length;
page.enterLog("Num of files: " + googleProduct.NumItems);
}
public class Devices
{
public String Model { get; set; }
public String Brand { get; set; }
public String IMEI { get; set; }
public Devices(string model, string brand, string iMEI)
{
Model = model;
Brand = brand;
IMEI = iMEI;
}
}
}
}
\ No newline at end of file
......@@ -12,17 +12,38 @@ namespace Personal_Insight.Models
private String productName;
private String productFolderPath;
private BitmapImage imageData;
private BitmapImage verifyModuleImage;
private String verifyModuleText;
private Object productObject;
private long dirSize;
private long numItems;
public GoogleProductModel(string productName, string productFolderPath, BitmapImage imageResource)
public GoogleProductModel(string productName, string productFolderPath, BitmapImage imageResource, Object productObject)
{
this.productName = productName;
this.productFolderPath = productFolderPath;
this.imageData = imageResource;
this.productObject = productObject;
if (imageData.UriSource.ToString().Contains("NotFound"))
{
verifyModuleImage = new BitmapImage(new Uri("pack://application:,,,/Personal Insight;component/assets/icons/" + "icons8-close-window-filled-48.png"));
verifyModuleText = "Not compatible yet.";
}
else
{
verifyModuleImage = new BitmapImage(new Uri("pack://application:,,,/Personal Insight;component/assets/icons/" + "icons8-tick-box-48.png"));
verifyModuleText = "Imported Sucessfully";
}
}
public string ProductName { get => productName; set => productName = value; }
public string ProductFolderPath { get => productFolderPath; set => productFolderPath = value; }
public BitmapImage ImageResource { get => imageData; set => imageData = value; }
public BitmapImage VerifyModuleImage { get => verifyModuleImage; set => verifyModuleImage = value; }
public String VerifyModuleText { get => verifyModuleText; set => verifyModuleText = value; }
public Object ProductObject { get => productObject; set => productObject = value; }
public long NumItems { get => numItems; set => numItems = value; }
}
}
using System;
using Personal_Insight.ComputeProduct;
using Personal_Insight.Pages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......@@ -52,6 +54,9 @@ namespace Personal_Insight.Models
public const String YouTube = "YouTube";
public const String Mail = "Mail";
private static Object productObject;
public static Object ProductObject { get => productObject; set => productObject = value; }
// for this code image needs to be a project resource
public static BitmapImage LoadImage(string productName)
{
......@@ -60,180 +65,406 @@ namespace Personal_Insight.Models
{
case ADCS:
fileName = "ADCS";
productObject = new Android_Device_Configuration_Service();
break;
case ANL:
fileName = "ANL";
productObject = new Android_Device_Configuration_Service();
break;
case Blogger:
fileName = "Blogger";
productObject = new Android_Device_Configuration_Service();
break;
case Bookmarks:
fileName = "Bookmarks";
productObject = new Android_Device_Configuration_Service();
break;
case Calendar:
fileName = "Calendar";
productObject = new Android_Device_Configuration_Service();
break;
case Chrome:
fileName = "Chrome";
productObject = new Android_Device_Configuration_Service();
break;
case GPC:
fileName = "GPC";
productObject = new Android_Device_Configuration_Service();
break;
case Contacts:
fileName = "Contacts";
productObject = new Android_Device_Configuration_Service();
break;
case CP:
fileName = "CP";
productObject = new Android_Device_Configuration_Service();
break;
case CS:
fileName = "CS";
productObject = new Android_Device_Configuration_Service();
break;
case Drive:
fileName = "Drive";
productObject = new Android_Device_Configuration_Service();
break;
case Fit:
fileName = "Fit";
productObject = new Android_Device_Configuration_Service();
break;
case GC:
fileName = "GC";
productObject = new Android_Device_Configuration_Service();
break;
case GMB:
fileName = "GMB";
productObject = new Android_Device_Configuration_Service();
break;
case GPay:
fileName = "GPay";
productObject = new Android_Device_Configuration_Service();
break;
case GPB:
fileName = "GPB";
productObject = new Android_Device_Configuration_Service();
break;
case GPGS:
fileName = "GPGS";
productObject = new Android_Device_Configuration_Service();
break;
case GPhotos:
fileName = "GPhotos";
productObject = new Android_Device_Configuration_Service();
break;
case GPlusS:
fileName = "GPlusS";
productObject = new Android_Device_Configuration_Service();
break;
case GPM:
fileName = "GPM";
productObject = new Android_Device_Configuration_Service();
break;
case GPMTV:
fileName = "GPMTV";
productObject = new Android_Device_Configuration_Service();
break;
case GPS:
fileName = "GPS";
productObject = new Android_Device_Configuration_Service();
break;
case GS:
fileName = "GS";
productObject = new Android_Device_Configuration_Service();
break;
case GSM:
fileName = "GSM";
productObject = new Android_Device_Configuration_Service();
break;
case GW:
fileName = "GW";
productObject = new Android_Device_Configuration_Service();
break;
case HA:
fileName = "HA";
productObject = new Android_Device_Configuration_Service();
break;
case Hangouts:
fileName = "Hangouts";
productObject = new Android_Device_Configuration_Service();
break;
case Keep:
fileName = "Keep";
productObject = new Android_Device_Configuration_Service();
break;
case LH:
fileName = "LH";
productObject = new Android_Device_Configuration_Service();
break;
case MA:
fileName = "MA";
productObject = new Android_Device_Configuration_Service();
break;
case Mail:
fileName = "Mail";
productObject = new Android_Device_Configuration_Service();
break;
case Maps:
fileName = "Maps";
productObject = new Android_Device_Configuration_Service();
break;