segunda-feira, 20 de julho de 2015

Automate Xamarin.Forms testing with Xamarin.UITest and Test Cloud

Xamarin Test-cloud.exe  failed on Proxy.


1) Create the file bellow: test-cloud.exe.config




xml version="1.0" encoding="utf-8" ?>
     <configuration>
          <appSettings>
                    <add key="HttpProxyPort" value="http://YOURPROXY:PORT"/>
                    <add key="NetworkUserName" value="YOURUSER"/>
                    <add key="NetworkUserPass" value="YOURPASSWORD"/>
         </appSettings>
          <system.net>
              <defaultProxy enabled="true" useDefaultCredentials="false">
                       <module type="ProxyUtil.MyProxy, ProxyUtil"/>
              </defaultProxy>
                       <settings>
                           <servicePointManager expect100Continue="false" />
                     </settings>
          </system.net>
</configuration>


2) Build the ProxyUtil.dll as the following code:



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Configuration;

namespace ProxyUtil
{
    public class MyProxy : IWebProxy
    {
      public ICredentials Credentials
      {
        get
        {
          return new NetworkCredential(ConfigurationManager.AppSettings["NetworkUserName"],
            ConfigurationManager.AppSettings["NetworkUserPass"]);
        }
        set { }
      }

      public Uri GetProxy(Uri destination)
      {
        return new Uri(ConfigurationManager.AppSettings["HttpProxyPort"]);
      }

      public bool IsBypassed(Uri host)
      {
        return false;
      }

    }
}


3) Store the 3 files in the same location: ProxyUtil.dll, test-cloud.exe, test-cloud.exe.config

http://developer.xamarin.com/guides/cross-platform/xamarin-forms/dependency-service/
http://developer.xamarin.com/guides/cross-platform/xamarin-forms/uitest-and-test-cloud/

Must be code, because you need to use on test cloud.




using System;

using Xamarin.Forms;

namespace XamarinTestLab
{
    public class App : Application
    {
        Label lbl ;
        Button btn;

        public App ()
        {
            // The root page of your application
            btn = new Button {
                Text = "Click me",
                StyleId = "MyButton"
            };

            lbl = new Label {
                Text = "Hello, Xamarin.Forms!",
                StyleId = "MyLabel"
            };

            MainPage = new ContentPage {
                Content = new StackLayout {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
                        lbl,
                        btn
                    }
                }
            };
            btn.Clicked+= OnButtonClicked;
        }

        void OnButtonClicked(object sender, EventArgs e)
        {
            lbl.Text = "Has clicked Tester";
        }
        protected override void OnStart ()
        {
            // Handle when your app starts
        }

        protected override void OnSleep ()
        {
            // Handle when your app sleeps
        }

        protected override void OnResume ()
        {
            // Handle when your app resumes
        }
    }
}

 /////////////////Test Code bellow//////////////



using System.Linq;
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.Android;
using Xamarin.UITest.Queries;

namespace XamarinTestLab.UITests
{
    [TestFixture]
    public class Tests
    {
        AndroidApp app;
        static readonly Func<AppQueryAppQuery> InitialMessage = c => c.Marked("MyLabel").Text("Hello, Xamarin.Forms!");
        static readonly Func<AppQueryAppQuery> Button = c => c.Marked("MyButton");
        static readonly Func<AppQueryAppQuery> DoneMessage = c => c.Marked("MyLabel").Text("Was clicked");

        [SetUp]
        public void BeforeEachTest ()
        {
            app = ConfigureApp.Android.StartApp ();
        }

        [Test]
        public void WelcomeTextIsDisplayed ()
        {
            AppResult[] result = app.Query(InitialMessage);
            Assert.IsTrue(result.Any(), "The initial message string isn't correct - maybe the app wasn't re-started?");

            // Act
            app.Tap(Button);

            // Assert
            result = app.Query(DoneMessage);
            Assert.IsTrue(result.Any(), "The 'clicked' message is not being displayed.");
        }
    }
}





[On Windows]

Try: https://xamarin.com/test-cloud-demo

C:\Users\flapuinka\AppData\Roaming\NuGet\External\Packages\Xamarin.UITest.0.7.1\tools\test-cloud.exe submit "C:\Users\flapuinka\Documents\Projects\XamarinTestLab\Droid\bin\Release\com.companyname.xamarintestlab.apk" cbe38a0b29d115d649cfdeef0704e335 --devices b2aae5c8 --series "master" --locale "en_US" --user lapuinka@gmail.com --assembly-dir "C:\Users\flapuinka\Documents\Projects\XamarinTestLab\UITests\bin\Release"


Negotiating file upload to Xamarin Test Cloud.
Posting to https://testcloud.xamarin.com/ci/upload2

Uploading nunit.framework.dll ... Already uploaded.
Uploading Xamarin.UITest.dll ... Already uploaded.
Uploading com.companyname.xamarintestlab_resigned.apk... 100%
Uploading XamarinTestLab.UITests.dll... 100%
Uploading AndroidTestServer.apk... 100%

Upload complete.

Status: Validating
Status: Validating
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)
Status: Running on 4 devices (0 / 4 completed)


The results show as the follow:



https://developer.xamarin.com/guides/android/troubleshooting/resolving-library-installation-errors/




https://archive.org/about/jobs.php
     Manager: Operations Engineering

    Location: Inner Richmond, San Francisco, CA and City of Richmond, CA

    Job Classification: Full-time, Exempt

    Job Summary: The Internet Archive has over 25PB of unique digital information all running across an integrated cluster of over 700 VMs on 500+ bare-metal hosts in 3 data centers. We are looking for a smart operations manager and engineer with proven experience effectively managing a high-performance team of system administrators and technical operations staff. The ideal candidate will have solid demonstrated experience improving and maintaining the reliability and performance of both internal and publicly facing web infrastructure, online services, information repositories, and database systems. They must also be skilled in management communications and able to work collaboratively with our teams of talented engineers and program staff.

    Key Responsibilities:
            Manage and mentor the technical and devop” team responsible for monitoring, maintaining, and restoring the health of all Internet Archive online services. This includes all publicly-facing service, the storage and compute cluster, as well as key internal services related to crawling, indexing, and access to archived web content
            Maintain and expand monitoring and reporting systems to communicate current and historical activity for multiple publicly facing Services and to ensure service continuity and performance.
            Analyze, implement, and manage effective improvements in the maintenance and operations processes and infrastructure.
            Assignment, recruiting, hiring, and terminating of staff as needed to sustain operational objectives and efficiency.
            Recommend the purchase of equipment needed to sustain responsive services and cost-effective operations.

        Minimum Qualifications:
            Experience managing large server cluster infrastructure
            Experience as lead manager and mentor of a technical operations team
            Passion and fierce advocate for the end user experience of web-delivered services
            Experience in highly available 24x7 production environment.
            Passion for automation, data-driven decision making, and information reporting
            Experience with high-bandwidth networking environments
            Work history that includes production-level programming in high-transaction environments.
            Fluency in Linux system administration, Unix shell scripting, and Python, PHP, etc.
            Extensive experience with Ansible, Git, Nagios, Postgres, Redis, ELK stack, etc.
            Experience deploying and administering database, search, and web-host services
            Be an excellent and creative problem solver. You do not need to know everything but you need to know how to find the solution.
            Experienced in open source practices and passion for staying current with industry trends
            Excellent oral/written communication and documentation skills
            Willingness to travel to network operation centers and participate as necessary in physical equipment install
            BS Computer Science, or equivalent work experience

        Preferred Qualifications:
            Experience deploying and maintaining big-data analytics tools, especially Hadoop, Druid, or RethinkDB
            MS in Computer Science or equivalent work experience
            Flexibility and a sense of humor

        Reporting Structure: The Manager of Operations Engineering reports to the Director of Engineering and works closely with the Head Librarian and Founder.

        To apply:Please send your resume and cover letter to jobs+manageroperationsengineering@archive.org with the subject line CI-402 Manager of Operations and Infrastructure.

        Internet Archive will consider for employment-qualified applicants with criminal histories in a manner consistent with the requirements of the Fair Chance Ordinance.

        About the Internet Archive: The Internet Archive is a non-profit with a huge mission: to give everyone access to all knowledge the books, web pages, audio, television and software of our shared human culture. Forever. Based in San Francisco and with satellites around the world, the Internet Archive staffers are building the digital library of the future--a place where we can all go to learn and explore. Our 140 engineers, book scanners, librarians, designers and team members have built one of the top 200 websites in the world. (https://archive.org). Like other Bay Area technology firms, we offer staffers a catered lunch every Friday, Blue Bottle Coffee, endless M&Ms and working in the coolest office space in SF. But more importantly, you will be helping to make sure we preserve the history of the Digital Age.
        Senior Engineer: Wayback Machine

        About the Internet Archive: Internet Archive is a 501(c)(3) non-profit library founded in 1996. Our motto is Universal Access to All Knowledge. We collect web sites, books, audio, videos, software, and other types of media and make them available to the world for free. Based in San Francisco and with satellites around the world, the Internet Archive staffers are building the digital library of the future--a place where we can all go to learn and explore. Our 140 engineers, book scanners, librarians, designers and team members have built the #250 website in the world, https://archive.org.

        Location: San Francisco, CA

        Job Classification: Full-time, exempt

        Job Summary: The Internet Archive's Wayback Machine is the world's largest public archive of historical web sites. Have you ever wanted to work with 450 billion things at once? Would you like to serve 1,500 requests per second? How about having your service referred to regularly in news articles and blog posts across the web? You can work on a challenging and popular project and help the world at the same time.

        We are looking for a smart, collaborative and resourceful engineer to help develop the next version of the Wayback Machine. The ideal candidate will possess a desire to work collaboratively with a small internal team and a large, vocal and active user community; demonstrating independence, creativity, initiative and technological savvy, in addition to being a great programmer/architect.

        Minimum Qualifications:

            2-3 years work experience in Python, or similar
            Experience working in Linux environments
            Familiarity with Java (current deployment is written in Java)
            Good understanding of latest web framework technologies and aspects of web technology and protocols
            Flexibility and a sense of humor
            BS Computer Science, or equivalent work experience

        Preferred Qualifications:
            Experience with web crawlers and/or applications designed to display archived web content (especially server-side apps)
            Cluster computing experience
            Open source practices experience

        To apply: Please send your resume and cover letter to Jobs+SeniorWaybackEngineer@archive.org with the subject line "Wayback Machine Senior Engineer."

        Internet Archive is an Equal Opportunity Employer. Internet Archive complies with the Fair Chance Ordinance.

        Internet Archive is an Equal Opportunity Employer. Internet Archive complies with the Fair Chance Ordinance.
        Web Application Developer (Books)

        About the Internet Archive: The Internet Archive is a non-profit with a huge mission: to give everyone access to all knowledge the books, web pages, audio, television and software of our shared human culture. Forever. Based in San Francisco and with satellites around the world, the Internet Archive staffers are building the digital library of the future - a place where anyone can go to learn and explore. Our 140 engineers, book scanners, librarians, designers and team members have built one of the top websites in the world, https://archive.org.
        Location: San Francisco, CA

        Job Classification: Full-time, exempt
        Job Summary: The Internet Archive has a huge corpus of digital information. Every day, our team of development engineers creates tools and applications to work with 22 petabytes of content that includes millions of books and texts, millions of hours of video, millions of audio tracks, and over 450 billion web captures. We are looking for a smart engineer to help develop next generation of web-based applications used by libraries and archives around the world to build and manage archives of books, texts, and image content. The ideal candidate will be a strong programmer who has successfully completed several projects involving large or intricate web applications or services, and will work collaboratively with talented engineering colleagues.

        Key Responsibilities: The responsibilities of this position are to develop and evolve the internal tools that support the review, editing and re-publishing of books and texts that have ben scanned into digital formats. More specifically, this means:
                Work at the direction of the technical project leader to create the next generation toolset for editing and assembling digital texts.
                Contribute to the documentation, training, maintenance, and evolution of this and other tools.
            Minimum Qualifications:
                2-3 years work experience with Javascript, HTLM5, and CSS.
                Experience working with image file data structures.
                Experience with building or maintaining APIs.
                Good understanding of latest web framework technologies and aspects of web technology and protocols.
                Fluency in Linux environments
                Flexibility and a sense of humor

            Preferred Qualifications:
                Experience with scanning and digital book formats (PDF, epub, AZW, etc.).
                Strong programming experience in PHP, Python, or both.
                Experience working with iiif image presentation framework.
                Experience open source practices and participation in open source forums
                Specific experience with Atlassian tool sets (Jira, Confluence)

            The Web Application Developer reports to the Director of Engineering and will work closely with the digital book teams.The entire staff is guided by founder and Digital Librarian, Brewster Kahle. Like many Bay Area technology firms, we offer staffers a catered lunch every Friday, espresso bar, endless M&Ms and working in the coolest office space in SF. But more importantly, you will be helping to make sure we bring out cultural treasures into the digital age, while preserving our present and future. Read more about the Internet Archive in Medium and The New Yorker

            To Apply: Please send your resume and cover letter to Jobs+WebAppDeveloper@archive.org with the subject line "AE-104: Web Application Developer"
            Internet Archive is an Equal Opportunity Employer. Internet Archive complies with the Fair Chance Ordinance. Internet Archive is a 501(c)(3) non-profit library founded in 1996.

            Senior Python Engineer

            Location: Inner Richmond, San Francisco, CA

            Job Classification: Full-time, exempt

            Job Summary: The Internet Archive is one of the world's largest public archive of historical web sites and digital information. This includes millions of books and texts, millions of hours of video, millions of audio tracks, and over 450 billion web captures. We are looking for smart engineers with deep experience in web application development and a passion for modern technologies and approaches software development. The ideal candidate will be a quick learner and have demonstrated thoughtful coding technique with good consideration to ensuring the reliability and performance of large web applications or services. They will also be excited to work collaboratively with talented engineering colleagues. You can work on a challenging and popular project and help the world at the same time.

            Key Responsibilities: The duties of this position are to develop software applications that support the Digital Books operations. This will entail coding (mostly in Python and JavaScript), system analysis, application design, and other technical duties.

            Minimum Qualifications:
                2-3 years extensive work experience in Python
                2-3 years work experience with JavaScript
                Experience working in Linux environments and GitHub.
                Good understanding of latest web framework technologies and aspects of web technology and protocols
                Flexibility and a sense of humor
                BS Computer Science, or equivalent work experience

            Preferred Qualifications:
                Experience building web applications that access and update large digital collections (as of ebook, digital recordings, etc.
                Experience in Open source practices.

            Reporting Structure: Senior Python Developer report to the Director of Engineering and will work closely with the Books team to define, detail and conceptualize book applications.

            To apply: Please send your resume and cover letter to mailto:Jobs+SeniorPythonEngineer@archive.org with the subject line "AE-304: Senior Python Developer."

            Internet Archive will consider for employment-qualified applicants with criminal histories in a manner consistent with the requirements of the Fair Chance Ordinance.

            About the Internet Archive: The Internet Archive is a non-profit with a huge mission: to give everyone access to all knowledge—the books, web pages, audio, television and software of our shared human culture. Forever. Based in San Francisco and with satellites around the world, the Internet Archive staffers are building the digital library of the future--a place where we can all go to learn and explore. Our 140 engineers, book scanners, librarians, designers and team members have built the #200 website in the world. (https://archive.org). Like other Bay Area technology firms, we offer staffers a catered lunch every Friday, Blue Bottle Coffee, endless M&Ms and working in the coolest office space in SF. But more importantly, you will be helping to make sure we preserve the history of the Digital Age.

Postar um comentário