public TestsSharedCode(IWebDriver driver) { _driver = driver; CommonActions = new CommonActions(_driver); }
private void SetUp() { _driver = new ChromeDriver(); CommonActions = new CommonActions(_driver); }
private void Dashboard_Load(object sender, EventArgs e) { DonateCategory.Dock = DockStyle.Top; // Show buttons CommonActions.DisableContextMenu(); var openItem = new DashboardItem(Resources.IconRepoOpen, _openRepository.Text); openItem.Click += openItem_Click; CommonActions.AddItem(openItem); var cloneItem = new DashboardItem(Resources.IconCloneRepoGit, _cloneRepository.Text); cloneItem.Click += cloneItem_Click; CommonActions.AddItem(cloneItem); var cloneSvnItem = new DashboardItem(Resources.IconCloneRepoSvn, _cloneSvnRepository.Text); cloneSvnItem.Click += cloneSvnItem_Click; CommonActions.AddItem(cloneSvnItem); foreach (IRepositoryHostPlugin el in RepoHosts.GitHosters) { IRepositoryHostPlugin gitHoster = el; var di = new DashboardItem(Resources.IconCloneRepoGithub, string.Format(_cloneFork.Text, el.Description)); di.Click += (repoSender, eventArgs) => UICommands.StartCloneForkFromHoster(this, gitHoster, GitModuleChanged); CommonActions.AddItem(di); } var createItem = new DashboardItem(Resources.IconRepoCreate, _createRepository.Text); createItem.Click += createItem_Click; CommonActions.AddItem(createItem); DonateCategory.DisableContextMenu(); var gitHubItem = new DashboardItem(Resources.develop.ToBitmap(), _develop.Text); gitHubItem.Click += GitHubItem_Click; DonateCategory.AddItem(gitHubItem); var donateItem = new DashboardItem(Resources.dollar.ToBitmap(), _donate.Text); donateItem.Click += DonateItem_Click; DonateCategory.AddItem(donateItem); var translateItem = new DashboardItem(Resources.EditItem, _translate.Text); translateItem.Click += TranslateItem_Click; DonateCategory.AddItem(translateItem); var issuesItem = new DashboardItem(Resources.bug, _issues.Text); issuesItem.Click += IssuesItem_Click; DonateCategory.AddItem(issuesItem); // // create Show current branch menu item and add to Dashboard menu // var showCurrentBranchMenuItem = new ToolStripMenuItem(_showCurrentBranch.Text); showCurrentBranchMenuItem.Click += showCurrentBranchMenuItem_Click; showCurrentBranchMenuItem.Checked = AppSettings.DashboardShowCurrentBranch; var menuStrip = FindControl <MenuStrip>(Parent.Parent.Parent, p => true); // TODO: improve: Parent.Parent.Parent == FormBrowse var dashboardMenu = (ToolStripMenuItem)menuStrip.Items.Cast <ToolStripItem>().SingleOrDefault(p => p.Name == "dashboardToolStripMenuItem"); dashboardMenu.DropDownItems.Add(showCurrentBranchMenuItem); }
public void MergeFunctions(CommonActions functions) { this._functions.Merge(functions); }
public static void Start(List <Entity> matchingEntities) { var mcGraw = EntityQueries.GetEntityWithName(matchingEntities, NPCName.McGraw); var ellie = EntityQueries.GetEntityWithName(matchingEntities, NPCName.Ellie); var tolstoy = EntityQueries.GetEntityWithName(matchingEntities, NPCName.Tolstoy); var player = EntityQueries.GetEntityWithName(matchingEntities, NPCName.You); var q = EntityQueries.GetEntityWithName(matchingEntities, NPCName.Q); var jannet = EntityQueries.GetEntityWithName(matchingEntities, NPCName.Jannet); var cheeringStartPoint = new SyncedAction(new List <Entity> { mcGraw, ellie, tolstoy, q, jannet }); //Player var playerSequence = new ActionSequence("Player Party"); playerSequence.Add(new CallbackAction(() => WelcomeSignControllerVisualizer.Instance.SetWelcomeSignActive(true))); playerSequence.Add(new TeleportAction(Locations.StandPoint1())); ActionManagerSystem.Instance.QueueAction(player, playerSequence); var mcGrawSequence = new ActionSequence("McGraw Party"); var qSequence = new ActionSequence("Q Party"); //Either McGraw or Q can be your friend at the end. Not both. if (mcGraw.GetState <RelationshipState>().PlayerOpinion >= 0) { mcGrawSequence.Add(new TeleportAction(Locations.StandPoint3())); mcGrawSequence.Add(new ConversationAction(new McGrawPartyGreeting())); mcGrawSequence.Add(cheeringStartPoint); mcGrawSequence.Add(new SetReactiveConversationAction(new McGrawPartyPositive(), mcGraw)); mcGrawSequence.Add(new PauseAction(1f)); mcGrawSequence.Add(CheerLoop(2)); mcGrawSequence.Add(new GetWaypointAction(Goal.Sit, true, true)); mcGrawSequence.Add(new GoToWaypointAction()); mcGrawSequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(mcGraw, mcGrawSequence); qSequence.Add(new TeleportAction(Locations.SitDownPoint1())); qSequence.Add(cheeringStartPoint); qSequence.Add(new SetReactiveConversationAction(new QPartyNegative(), q)); qSequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(q, qSequence); } else { qSequence.Add(new TeleportAction(Locations.StandPoint3())); qSequence.Add(new ConversationAction(new QPartyGreeting())); qSequence.Add(cheeringStartPoint); qSequence.Add(new SetReactiveConversationAction(new QPartyPositive(), q)); qSequence.Add(new PauseAction(0.5f)); qSequence.Add(CheerLoop(3)); qSequence.Add(new GetWaypointAction(Goal.Sit, true, true)); qSequence.Add(new GoToWaypointAction()); qSequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(q, qSequence); mcGrawSequence.Add(new TeleportAction(Locations.SitDownPoint1())); mcGrawSequence.Add(cheeringStartPoint); mcGrawSequence.Add(new SetReactiveConversationAction(new McGrawPartyNegative(), mcGraw)); mcGrawSequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(mcGraw, mcGrawSequence); } //Jannet if (jannet.GetState <RelationshipState>().PlayerOpinion >= 0) { var jannetSequence = new ActionSequence("Jannet Party Positive"); jannetSequence.Add(new TeleportAction(Locations.StandPoint2())); jannetSequence.Add(cheeringStartPoint); jannetSequence.Add(new SetReactiveConversationAction(new JannetPartyPositive(), jannet)); jannetSequence.Add(new PauseAction(1.2f)); jannetSequence.Add(CheerLoop(3)); jannetSequence.Add(new GetWaypointAction(Goal.Sit, true, true)); jannetSequence.Add(new GoToWaypointAction()); jannetSequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(jannet, jannetSequence); } else { var jannetSequence = new ActionSequence("Jannet Party Negative"); jannetSequence.Add(new TeleportAction(Locations.SitDownPoint2())); jannetSequence.Add(cheeringStartPoint); jannetSequence.Add(new SetReactiveConversationAction(new JannetPartyNegative(), jannet)); jannetSequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(jannet, jannetSequence); } //Tolstoy if (tolstoy.GetState <RelationshipState>().PlayerOpinion >= 0) { var tolstoySequence = new ActionSequence("Tolstoy Party Positive"); tolstoySequence.Add(new TeleportAction(Locations.StandPoint4())); tolstoySequence.Add(cheeringStartPoint); tolstoySequence.Add(new SetReactiveConversationAction(new TolstoyPartyPositive(), tolstoy)); tolstoySequence.Add(new PauseAction(1f)); tolstoySequence.Add(CheerLoop(2)); tolstoySequence.Add(new GetWaypointAction(Goal.Sit, true, true)); tolstoySequence.Add(new GoToWaypointAction()); tolstoySequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(tolstoy, tolstoySequence); } else { var tolstoySequence = new ActionSequence("Tolstoy Party Negative"); tolstoySequence.Add(new TeleportAction(Locations.SitDownPoint3())); tolstoySequence.Add(cheeringStartPoint); tolstoySequence.Add(new SetReactiveConversationAction(new TolstoyPartyNegative(), tolstoy)); tolstoySequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(tolstoy, tolstoySequence); } //Ellies if (ellie.GetState <RelationshipState>().PlayerOpinion >= 0) { var ellieSequence = new ActionSequence("Ellie Party"); ellieSequence.Add(new TeleportAction(Locations.StandPoint5())); ellieSequence.Add(cheeringStartPoint); ellieSequence.Add(new SetReactiveConversationAction(new ElliePartyPositive(), ellie)); ellieSequence.Add(CheerLoop(3)); ellieSequence.Add(new GetWaypointAction(Goal.Sit, true, true)); ellieSequence.Add(new GoToWaypointAction()); ellieSequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(ellie, ellieSequence); } else { var ellieSequence = new ActionSequence("Ellie Party Negative"); ellieSequence.Add(new TeleportAction(Locations.SitDownPoint4())); ellieSequence.Add(cheeringStartPoint); ellieSequence.Add(new SetReactiveConversationAction(new ElliePartyNegative(), ellie)); ellieSequence.Add(CommonActions.SitDownLoop()); ActionManagerSystem.Instance.QueueAction(ellie, ellieSequence); } }
public Coupled(IWebDriver webDriver) : base(webDriver) { commonActions = new CommonActions(webDriver); }
public static void DrugPusherInspectorShowdown(Entity inspector, Entity drugPusher, Transform sitDownPoint) { var showdownPusher = new ActionSequence("ShowdownPusher"); var showdownInspector = new ActionSequence("ShowdownInspector"); showdownPusher.Add(new TeleportAction(sitDownPoint)); showdownPusher.Add(new ReportSuccessDecorator(CommonActions.SitDownLoop())); //Confront each other! (Consider make this be in front of bar). CommonActions.AddSyncEntityAction(inspector, drugPusher, showdownInspector, showdownPusher); showdownInspector.Add(new SetTargetEntityAction(drugPusher)); showdownInspector.Add(new GoToMovingEntityAction(3.0f)); CommonActions.AddSyncEntityAction(inspector, drugPusher, showdownInspector, showdownPusher); //Placeholder "agument". Perhaps the player could see what was being said? //Floating speach bubbles? showdownInspector.Add(new PauseAction(2)); showdownInspector.Add(new UpdateMoodAction(Mood.Angry)); showdownPusher.Add(new PauseAction(3)); showdownPusher.Add(new UpdateMoodAction(Mood.Angry)); showdownInspector.Add(new PauseAction(5)); showdownInspector.Add(new UpdateMoodAction(Mood.Angry)); showdownPusher.Add(new PauseAction(6)); showdownPusher.Add(new UpdateMoodAction(Mood.Angry)); CommonActions.AddSyncEntityAction(inspector, drugPusher, showdownInspector, showdownPusher); showdownPusher.Add(CommonActions.StandUp()); showdownPusher.Add(new SetTargetEntityAction(inspector)); showdownPusher.Add(new GoToMovingEntityAction()); showdownInspector.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerStartWaryIdle)); showdownPusher.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerStartWaryIdle)); showdownPusher.Add(new PauseAction(2)); CommonActions.AddSyncEntityAction(inspector, drugPusher, showdownInspector, showdownPusher); showdownInspector.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerStopWaryIdle)); showdownPusher.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerStopWaryIdle)); CommonActions.AddSyncEntityAction(inspector, drugPusher, showdownInspector, showdownPusher); ActionSequence inspectorFight; ActionSequence pusherFight; Fight(inspector, drugPusher, out inspectorFight, out pusherFight); showdownInspector.Add(inspectorFight); showdownPusher.Add(pusherFight); ActionManagerSystem.Instance.QueueAction(drugPusher, showdownPusher); ActionManagerSystem.Instance.QueueAction(inspector, showdownInspector); Resolution(inspector, drugPusher); }
private static void Resolution(Entity inspector, Entity drugPusher) { var resolutionTimeout = 10.0f; var decisionState = StaticStates.Get <PlayerDecisionsState>(); var successfulDrinks = decisionState.NumberOfDrinksServedInDrugStory; var drugPusherActions = new ActionSequence("DrugPusher Resolution"); var inspectorActions = new ActionSequence("Inspector Resolution"); if (IsDrugPusherDrinking()) { if (successfulDrinks == 0 || successfulDrinks == 1) { inspectorActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerFlyBack)); inspectorActions.Add(new PauseAction(2.0f)); drugPusherActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Run)); drugPusherActions.Add(new LeaveBarAction()); drugPusherActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Walk)); inspectorActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerGetUp)); inspectorActions.Add(new ConversationAction( new NoResponseConversation("Damn it, he got away. I guess those drinks didn't do much did they. Maybe work on your bartending skills next time.", DialogueOutcome.Bad, resolutionTimeout))); inspectorActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Slow)); inspectorActions.Add(new LeaveBarAction()); inspectorActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Walk)); } else if (successfulDrinks == 2) { drugPusherActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerFlyBack)); drugPusherActions.Add(new PauseAction(2.0f)); if (decisionState.AcceptedDrugPushersOffer) { StaticStates.Get <OutcomeTrackerState>().AddOutcome("McGraw got Q but you are not absolved of your part in it."); inspectorActions.Add(new ConversationAction( new NoResponseConversation( new[] { "Thanks to your help I was able to stop this criminal. He had enough Space Weed on him to put him away for a good while.", "He did say that you were in on it... he's pretty drunk though so he's probably just making it up." }, DialogueOutcome.Bad, resolutionTimeout) ) ); } else { StaticStates.Get <OutcomeTrackerState>().AddOutcome("McGraw is very pleased with your performance. Q is most certainly not."); inspectorActions.Add(new ConversationAction( new NoResponseConversation( new[] { "Thanks to your help I was able to stop this criminal. He had enough Space Weed on him to put him away for a good while.", "You're a great asset to this crew." }, DialogueOutcome.Bad, resolutionTimeout) ) ); } CommonActions.AddSyncEntityAction(inspector, drugPusher, inspectorActions, drugPusherActions); drugPusherActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerGetUp)); drugPusherActions.Add(new PauseAction(1.0f)); CommonActions.AddSyncEntityAction(inspector, drugPusher, inspectorActions, drugPusherActions); drugPusherActions.Add(new LeaveBarAction()); inspectorActions.Add(new LeaveBarAction()); } else if (successfulDrinks == 3) { drugPusherActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerFlyBack)); drugPusherActions.Add(new PauseAction(2.0f)); if (decisionState.AcceptedDrugPushersOffer) { StaticStates.Get <OutcomeTrackerState>().AddOutcome("McGraw is very pleased with your performance and has no idea your were on the take! Win win."); inspectorActions.Add(new ConversationAction( new NoResponseConversation( new[] { "Thanks to your help I was able to stop this criminal. He had enough Space Weed on him to put him away for a good while.", "He tried to tell me something but he's so drunk he can barely speak! Good job." }, DialogueOutcome.Bad, resolutionTimeout) ) ); } else { StaticStates.Get <OutcomeTrackerState>().AddOutcome("McGraw is very pleased with your performance and has no idea your were on the take! Win win."); inspectorActions.Add(new ConversationAction( new NoResponseConversation( new[] { "Thanks to your help I was able to stop this criminal. He had enough Space Weed on him to put him away for a good while.", "You're a great asset to this crew." }, DialogueOutcome.Bad, resolutionTimeout) ) ); } CommonActions.AddSyncEntityAction(inspector, drugPusher, inspectorActions, drugPusherActions); drugPusherActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerGetUp)); drugPusherActions.Add(new PauseAction(1.0f)); CommonActions.AddSyncEntityAction(inspector, drugPusher, inspectorActions, drugPusherActions); drugPusherActions.Add(new LeaveBarAction()); inspectorActions.Add(new LeaveBarAction()); } } else { if (successfulDrinks == 0 || successfulDrinks == 1) { drugPusherActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerFlyBack)); drugPusherActions.Add(new PauseAction(1.5f)); StaticStates.Get <OutcomeTrackerState>().AddOutcome("McGraw is going to be watching you carefully."); inspectorActions.Add(new ConversationAction( new NoResponseConversation( new[] { "No thanks to you I was able to catch this criminal. He had enough Space Weed on him to put him away for a good while.", "He tells me that you were in on it, I'm going to have my eye on you for a long time." }, DialogueOutcome.Bad, resolutionTimeout) ) ); CommonActions.AddSyncEntityAction(inspector, drugPusher, inspectorActions, drugPusherActions); drugPusherActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerGetUp)); drugPusherActions.Add(new PauseAction(1.0f)); CommonActions.AddSyncEntityAction(inspector, drugPusher, inspectorActions, drugPusherActions); drugPusherActions.Add(new LeaveBarAction()); inspectorActions.Add(new LeaveBarAction()); } else if (successfulDrinks == 2) { inspectorActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerFlyBack)); inspectorActions.Add(new PauseAction(2.0f)); drugPusherActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Run)); drugPusherActions.Add(new LeaveBarAction()); drugPusherActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Walk)); inspectorActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerGetUp)); StaticStates.Get <OutcomeTrackerState>().AddOutcome("Q is very plesed with your actions. McGraw is none the wiser"); inspectorActions.Add(new ConversationAction( new NoResponseConversation("*Hic* Damn, he got away. I shouldn't have drank so much. I'm sorry you had to see that.", DialogueOutcome.Bad, resolutionTimeout))); inspectorActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Slow)); inspectorActions.Add(new LeaveBarAction()); inspectorActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Walk)); } else if (successfulDrinks == 3) { inspectorActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerFlyBack)); inspectorActions.Add(new PauseAction(2.0f)); drugPusherActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Run)); drugPusherActions.Add(new LeaveBarAction()); drugPusherActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Walk)); inspectorActions.Add(new TriggerAnimationAction(Util.AnimationEvent.TriggerGetUp)); StaticStates.Get <OutcomeTrackerState>().AddOutcome("Q is very plesed with your actions. McGraw is none the wiser"); inspectorActions.Add(new ConversationAction( new NoResponseConversation("*Hic* Damn... I shouldn't have drank so much. Sorry you had to see that, you're a good kid. *Hic*", DialogueOutcome.Bad, resolutionTimeout))); inspectorActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Slow)); inspectorActions.Add(new LeaveBarAction()); inspectorActions.Add(new SetMovementSpeedAction(SetMovementSpeedAction.MovementType.Walk)); } } ActionManagerSystem.Instance.QueueAction(drugPusher, drugPusherActions); ActionManagerSystem.Instance.QueueAction(inspector, inspectorActions); }
// enter text and search and select city public OneWayFlight SelectCity(By byTxtEnterCity, String searchText) { CommonActions.selectCity(driver, byTxtEnterCity, searchText); return(this); }
// select flight mode public OneWayFlight SelectFlightMode() { CommonActions.selectFlightMode(driver, btnSelectOneWayFlightType); //TestLogs.info("OneWayFlight- mdule selected"); return(this); }
// select module public OneWayFlight LaunchModule() { // launch flight module CommonActions.launchModule(driver, CommonElementGroup.btnSelectFlightModule); return(this); }
/// <summary> /// Approves of fails an offline/invoice order /// </summary> /// <param name="isFailed"></param> private void ProcessOrder(bool isFailed) { CommonActions commonActions = new CommonActions(Driver); commonActions.SignIn_in_admin_panel(); commonActions.Authorize_the_first_payment(); if (!isFailed) { commonActions.Approve_offline_payment(); } else { commonActions.Fail_offline_payment(); } }
internal CommonSelector(CommonActions action, string selector) { mAction = action; mSelector = selector; }