示例#1
0
 public Firefox(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption option, WindowSession windowSession)
     : base(automationElement, windowFactory, option, windowSession)
 {
 }
示例#2
0
        /// <summary>
        /// Looks at all the windows visible for the application and finds one which matches the condition. The match is run against the title
        /// of the windows
        /// </summary>
        /// <param name="match"></param>
        /// <param name="initializeOption">option for the window which matches the condition</param>
        /// <exception cref="UIItemSearchException">The application type is not supported by White</exception>
        public virtual Window Find(Predicate <string> match, InitializeOption initializeOption)
        {
            WindowSession windowSession = applicationSession.WindowSession(initializeOption);

            return(windowFactory.FindWindow(process, match, initializeOption, windowSession));
        }
 private CachedContainerItemFactory CreateCacheFactory(InitializeOption option)
 {
     return(new CachedContainerItemFactory(CachedUIItems.CreateAndCachePrimaryChildControls(automationElement, option), actionListener));
 }
示例#4
0
 private static string FileLocation(InitializeOption initializeOption)
 {
     return(string.Format(@"{0}\{1}.xml", CoreAppXmlConfiguration.Instance.WorkSessionLocation, initializeOption.Identifier));
 }
示例#5
0
        /// <summary>
        /// Get visible window
        /// </summary>
        /// <param name="title">Title text of window displayed on desktop</param>
        /// <param name="option">Option which would be used to initialize the window.</param>
        /// <returns></returns>
        /// <exception cref="UIItemSearchException">The application type is not supported by White</exception>
        public virtual Window GetWindow(string title, InitializeOption option)
        {
            WindowSession windowSession = applicationSession.WindowSession(option);

            return(windowFactory.CreateWindow(title, process, option, windowSession));
        }
示例#6
0
 protected Window(AutomationElement automationElement, InitializeOption initializeOption,
                  WindowSession windowSession)
     : base(automationElement, new NullActionListener(), initializeOption, windowSession)
 {
     InitializeWindow();
 }
示例#7
0
        public virtual T Get <T>(string title, InitializeOption option) where T : AppScreen
        {
            Func <Window> window = () => applicationSession.Application.GetWindow(title, IdentifiedOption <T>(option));

            return(Get <T>(title, window));
        }
示例#8
0
 /// <summary>
 /// Applicable only if CacheMode is used. This is for internal purpose of white and should not be used, as caching by itself is not supported
 /// </summary>
 /// <param name="option"></param>
 public virtual void ReInitialize(InitializeOption option)
 {
     currentContainerItemFactory.ReInitialize(option);
 }
 public virtual Window Create(AutomationElement automationElement, InitializeOption initializeOption, WindowSession session)
 {
     return(new InternetExplorerWindow(automationElement, WindowFactory.Desktop, initializeOption, session));
 }
示例#10
0
        public override Window ModalWindow(string title, InitializeOption option)
        {
            var childWindow = Get <Window>(SearchCriteria.ByText(title));

            return(childWindow);
        }
示例#11
0
        public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
        {
            var childWindow = Get <Window>(searchCriteria);

            return(childWindow);
        }
 public override WindowSession WindowSession(InitializeOption initializeOption)
 {
     return(new NullWindowSession());
 }
 public override WindowSession ModalWindowSession(InitializeOption modalInitializeOption)
 {
     return(new NullWindowSession());
 }
示例#14
0
        public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
        {
            WindowFactory desktopWindowsFactory = WindowFactory.Desktop;

            return(desktopWindowsFactory.FindModalWindow(searchCriteria, option, automationElement, WindowSession.ModalWindowSession(option)));
        }
示例#15
0
 public BrowserWindow(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption option, WindowSession windowSession)
     : base(automationElement, windowFactory, option, windowSession)
 {
 }
示例#16
0
 public Win32Window(AutomationElement automationElement, WindowFactory windowFactory, InitializeOption option, WindowSession windowSession)
     : base(automationElement, option, windowSession)
 {
     this.windowFactory = windowFactory;
 }
示例#17
0
 /// <summary>
 /// Get the modal window launched by this window.
 /// </summary>
 /// <param name="searchCriteria">Search Criteria to use to find a window</param>
 /// <param name="option">Newly created window would be initialized using this option</param>
 /// <returns></returns>
 public abstract Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option);
示例#18
0
 public override Window ModalWindow(string title, InitializeOption option)
 {
     return(windowFactory.FindModalWindow(title, Process.GetProcessById(automationElement.Current.ProcessId), option, automationElement,
                                          WindowSession.ModalWindowSession(option)));
 }
示例#19
0
 private static InitializeOption IdentifiedOption <T>(InitializeOption option)
 {
     return(option.AndIdentifiedBy(typeof(T).FullName));
 }
示例#20
0
 public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
 {
     return(windowFactory.ModalWindow(searchCriteria, option, WindowSession.ModalWindowSession(option)));
 }
示例#21
0
        public virtual T Get <T>(SearchCriteria searchCriteria, InitializeOption option) where T : AppScreen
        {
            Func <Window> window = () => applicationSession.Application.GetWindow(searchCriteria, IdentifiedOption <T>(option));

            return(Get <T>(searchCriteria.ToString(), window));
        }
示例#22
0
 public override Window ModalWindow(string title, InitializeOption option)
 {
     return(null);
 }
示例#23
0
        public static CachedUIItems CreateAndCachePrimaryChildControls(AutomationElement parent, InitializeOption option)
        {
            var cachedUIItems = new CachedUIItems();

            cachedUIItems.FindAll(parent);
            cachedUIItems.list.Sort(new AutomationElementPositionComparer());
            return(cachedUIItems);
        }
示例#24
0
 public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
 {
     return(null);
 }
示例#25
0
        /// <summary>
        /// Find the first window which belongs to this application and satisfies the critera.
        /// </summary>
        /// <param name="searchCriteria"></param>
        /// <param name="initializeOption">found window would be initialized with this option</param>
        /// <returns></returns>
        /// <exception cref="UIItemSearchException">The application type is not supported by White</exception>
        public virtual Window GetWindow(SearchCriteria searchCriteria, InitializeOption initializeOption)
        {
            WindowSession windowSession = applicationSession.WindowSession(initializeOption);

            return(windowFactory.CreateWindow(searchCriteria, process, initializeOption, windowSession));
        }
 public override Window ModalWindow(string title, InitializeOption option)
 {
     throw new NotSupportedException();
 }
 public CurrentContainerItemFactory(PrimaryUIItemFactory primaryUIItemFactory, InitializeOption initializeOption, AutomationElement automationElement,
                                    ActionListener listener)
 {
     this.automationElement = automationElement;
     actionListener         = listener;
     current = nonCachedContainerItemFactory = new NonCachedContainerItemFactory(primaryUIItemFactory, actionListener);
     if (initializeOption.Cached)
     {
         cachedContainerItemFactory = CreateCacheFactory(initializeOption);
         current = cachedContainerItemFactory;
     }
 }
 public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
 {
     throw new NotSupportedException();
 }
示例#29
0
 public DummyWindow(AutomationElement automationElement, InitializeOption initializeOption, WindowSession windowSession)
     : base(automationElement, initializeOption, windowSession)
 {
 }
示例#30
0
 /// <summary>
 /// Get the modal window launched by this window.
 /// </summary>
 /// <param name="title">Title of the modal window</param>
 /// <param name="option">Newly created window would be initialized using this option</param>
 /// <returns></returns>
 public abstract Window ModalWindow(string title, InitializeOption option);
 public virtual Window Create(AutomationElement automationElement, InitializeOption initializeOption, WindowSession session)
 {
     return new Firefox(automationElement, WindowFactory.Desktop, initializeOption, session);
 }
示例#32
0
 protected TestConfiguration(string program, string commandLineArguments)
 {
     this.program = program;
     this.commandLineArguments = commandLineArguments;
     windowInitializeOption    = InitializeOption.NoCache;
 }