Skip to content

Instantly share code, notes, and snippets.

View Sweekriti91's full-sized avatar
🐼
Hullabaloo

Sweekriti Satpathy Sweekriti91

🐼
Hullabaloo
View GitHub Profile
@Sweekriti91
Sweekriti91 / DatePicker UITest
Created May 8, 2020 17:06
Xamarin.UITest DatePicker sample
public ManualActivityPage SetStartDate(string Month, string Date, string Year)
{
app.Tap(StartDatePicker);
app.Screenshot("Date Picker Open");
int month = (int)Enum.Parse(typeof(Months), Month, true);
int year = Int32.Parse(Year);
int date = Int32.Parse(Date);
if (OnAndroid)
{
app.Query(x => x.Class("DatePicker").Index(0).Invoke("updateDate", year, month, date));
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
variables:
AppCenterDroidSlug: '<insertAppCENTERSLUG>'
AppCenterDroidDevices: '<INSERTDEVICEID>'
steps:
- task: AppCenterTest@1
displayName: 'Test Android with Visual Studio App Center'
inputs:
appFile: '$(Build.ArtifactStagingDirectory)/*.apk'
@Sweekriti91
Sweekriti91 / Test.cs
Created September 26, 2017 00:31
Test Types
[Test]
public void AssertIgnoreTest()
{
Assert.Ignore();
app.Screenshot("Test Assert Ignored!");
Console.WriteLine("ERROR MESSAGE FROM ASSERTIGNORETEST");
}
[Test]
public void AssertInconclusiveTest()
@Sweekriti91
Sweekriti91 / build.sh
Created May 31, 2017 21:52
Build Script to use with build.cake
#!/usr/bin/env bash
##########################################################################
# This is the Cake bootstrapper script for Linux and OS X.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################
# Define directories.
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
@Sweekriti91
Sweekriti91 / build.cake
Created May 31, 2017 21:51
Cake Script to Build/Upload to TestCloud
#tool "nuget:?package=NUnit.Runners&version=2.6.4"
#addin "Cake.FileHelpers"
#addin "Cake.Xamarin"
// --------------------------------------------------------------------------------
// Arguments
// --------------------------------------------------------------------------------
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
@Sweekriti91
Sweekriti91 / rakefile.rb
Created May 31, 2017 21:50
Rake Build/UITest Script
require "benchmark"
require "date"
require 'net/http'
### PROPERTIES TO SET
APP_NAME = "Your App"
ANDROID_DIR = "YourApp.Android"
IOS_DIR = "YourApp.iOS"
TEST_DIR = "YourApp.Tests"
@Sweekriti91
Sweekriti91 / HelperFunctions.cs
Last active May 23, 2017 23:24
Small Scroll Down Example
public void SmallScrollDown()
{
AppRect r = null;
if(OnAndroid)
r = app.Query()[0].Rect;
if (OniOS)
r = app.Query(x => x.Class("UIWindow"))[0].Rect;
app.DragCoordinates(r.CenterX, r.CenterY, r.CenterX, r.CenterY - r.Height / 4);
}