using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
using Telerik.WebAii.Controls.Xaml.Wpf;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Design;
using ArtOfTest.WebAii.Design.Execution;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;

namespace WebTest
{

    //
    // You can add custom execution steps by simply
    // adding a void function and decorating it with the [CodedStep] 
    // attribute to the test method. 
    // Those steps will automatically show up in the test steps on save.
    //
    // The BaseWebAiiTest exposes all key objects that you can use
    // to access the current testcase context. [i.e. ActiveBrowser, Find ..etc]
    //
    // Data driven tests can use the Data[columnIndex] or Data["columnName"] 
    // to access data for a specific data iteration.
    //
    // Example:
    //
    // [CodedStep("MyCustom Step Description")]
    // public void MyCustomStep()
    // {
    //        // Custom code goes here
    //      ActiveBrowser.NavigateTo("http://www.google.com");
    //
    //        // Or
    //        ActiveBrowser.NavigateTo(Data["url"]);
    // }
    //
        

    public class WebTest : BaseWebAiiTest
    {
        #region [ Dynamic Pages Reference ]

        private Pages _pages;

        /// <summary>
        /// Gets the Pages object that has references
        /// to all the elements, frames or regions
        /// in this project.
        /// </summary>
        public Pages Pages
        {
            get
            {
                if (_pages == null)
                {
                    _pages = new Pages(Manager.Current);
                }
                return _pages;
            }
        }

        #endregion
        
        // Add your test methods here...
    
        [CodedStep(@"Navigate to : 'https://202.174.92.219:8443/MyKastle/Login.aspx'")]
        public void WebTest_CodedStep()
        {
            // Navigate to : 'https://202.174.92.219:8443/MyKastle/Login.aspx'
            ActiveBrowser.NavigateTo("https://202.174.92.219:8443/MyKastle/Login.aspx");
        }
    
        [CodedStep(@"Enter UserName from Excel Sheet")]
        public void Login_CodedStep()
        {
            Pages.Login0.TxtUserNameText.Text = "hakikj350";
        }
    
        [CodedStep(@"Enter Password from Excel Sheet")]
        public void Login_CodedStep1()
        {
            Pages.Login0.TxtPasswordPassword.Text = "password";
        }
    
        [CodedStep(@"Set 'UcSavePopupTxtReportNameText' text to ''")]
        public void WebTest_CodedStep1()
        {
            // Set 'UcSavePopupTxtReportNameText' text to ''
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
            //ActiveBrowser.Window.SetFocus();
            Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.Text = ("Visitor" +DateTime.Now.ToString("ddMMyyyyHHmmss"));
            //Manager.Desktop.KeyBoard.TypeText("Visitor" +DateTime.Now.ToString("ddMMyyyyHHmmss"), 50, 100);
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.MouseClick();
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.Text = "ssssss23";
        }
    
        //[CodedStep(@"Set 'UcSavePopupTxtReportNameText' text to 'ssssss23'")]
        //public void WebTest_CodedStep2()
        //{
            //// Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.Text = "ssssss23";
            
        //}
    
        //[CodedStep(@"Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'")]
        //public void WebTest_CodedStep2()
        //{
            //// Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.Text = "ssssss23";
            
        //}
    
        //[CodedStep(@"Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'")]
        //public void WebTest_CodedStep2()
        //{
            //// Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
            //ActiveBrowser.Window.SetFocus();
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.MouseClick();
            //Manager.Desktop.KeyBoard.TypeText("ssssss23", 50, 100);
            
        //}
    
        //[CodedStep(@"Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'")]
        //public void WebTest_CodedStep2()
        //{
            //// Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
            //ActiveBrowser.Window.SetFocus();
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.MouseClick();
            //Manager.Desktop.KeyBoard.TypeText("ssssss23", 50, 100);
            
        //}
    
        //[CodedStep(@"Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'")]
        //public void WebTest_CodedStep2()
        //{
            //// Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.Text = "ssssss23";
            
        //}
    
        //[CodedStep(@"Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'")]
        //public void WebTest_CodedStep2()
        //{
            //// Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.Text = "ssssss23";
            
        //}
    
        //[CodedStep(@"Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'")]
        //public void WebTest_CodedStep2()
        //{
            //// Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.Text = "ssssss23";
            
        //}
    
        //[CodedStep(@"Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'")]
        //public void WebTest_CodedStep2()
        //{
            //// Enter text 'ssssss23' in 'UcSavePopupTxtReportNameText'
            //Pages.AuthorizedVisitors20.FrameFrameReportView.UcSavePopupTxtReportNameText.Text = "ssssss23";
            
        //}
    }
}
