Exemple #1
0
        public BrowserProfileViewModel(IBrowserStateNotificationService browserStateNotificationService, IMediator mediator, BrowserProfile browserProfile)
        {
            _browserProfile = browserProfile;

            Browser = new BrowserViewModel(browserStateNotificationService, mediator, _browserProfile.Browser);
            Profile = new ProfileViewModel(browserStateNotificationService, mediator, _browserProfile.Profile);
        }
Exemple #2
0
        public async Task UseBrowserProfileAsync(BrowserProfile browserProfile, string requestUrl, bool saveRequestUrl)
        {
            if (saveRequestUrl)
            {
                var requestDomain = SelectionRule.GetPartFromUrl(SelectionRule.SelectionRuleParts.Domain, requestUrl);
                var command       = new CreateProfileSelectionRuleCommand(
                    browserProfile.Profile.Id,
                    SelectionRule.SelectionRuleParts.Domain,
                    SelectionRule.SelectionRuleCompareTypes.Equals,
                    requestDomain);

                await _mediator.Send(command);
            }

            browserProfile.NavigateToUrl(requestUrl);

            await _mediator.Send(new ApplicationShutdownCommand());
        }
Exemple #3
0
        public static IWebDriver GetDriver()
        {
            var browserProfile = new BrowserProfile(Settings.GetSettings());

            return(CreateDriver(browserProfile));
        }
Exemple #4
0
 private Task UseBrowserProfile(BrowserProfile browserProfile)
 {
     return(_browserService.UseBrowserProfileAsync(browserProfile, BrowserState.RequestUrl, BrowserState.SaveRequestUrl));
 }