From 1757e18fde31205136459311748d15d301a072a0 Mon Sep 17 00:00:00 2001 From: Luke Benting Date: Wed, 2 Jun 2021 08:53:46 +0100 Subject: [PATCH 1/3] Added new Timeline step binding for clicking create for a custom activity. --- .../Steps/TimelineSteps.cs | 13 +++++++++++++ .../TimelineSteps.feature | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs b/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs index d88a9d7..95e82dc 100644 --- a/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs +++ b/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs @@ -3,6 +3,8 @@ using System; using System.Linq; using Microsoft.Dynamics365.UIAutomation.Api.UCI; + using Microsoft.Dynamics365.UIAutomation.Browser; + using OpenQA.Selenium; using TechTalk.SpecFlow; /// @@ -102,6 +104,17 @@ public static void WhenIAddAnEmailToTheTimeline(string subject, string duration, contacts.Rows.Where(r => r[0] == "BCC").Select(r => r["Name"]).ToArray()); } + /// + /// Clicks the create button for the given activity. + /// + /// The name of the activity entity. + [When(@"I click create for (?:a|an) '(.*)' on the timeline")] + public static void WhenIAddAnEmailToTheTimeline(string activityName) + { + Driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Timeline.Popout])); + Driver.ClickWhenAvailable(By.XPath($"//li[contains(@id,\"notescontrol-createNewRecord_flyoutMenuItem_{activityName}\")]")); + } + private static void EmailContacts(string reference, string[] contacts) { if (contacts.Length == 0) diff --git a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/TimelineSteps.feature b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/TimelineSteps.feature index 5e01d7a..8cbd9f2 100644 --- a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/TimelineSteps.feature +++ b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/TimelineSteps.feature @@ -27,4 +27,8 @@ Scenario: Add email to timeline Given I have created 'a contact' When I add an email to the timeline with the subject 'A subject', the duration '1', and the following contacts | Type | Name | - | To | John Smith | \ No newline at end of file + | To | John Smith | + +Scenario: Click create for appointment on the timeline + Given I have created 'a contact' + When I click create for an 'appointment' on the timeline \ No newline at end of file From ce73525f9840eebfd45503f59e5379b85e7e3148 Mon Sep 17 00:00:00 2001 From: Luke Benting Date: Wed, 2 Jun 2021 09:03:09 +0100 Subject: [PATCH 2/3] Fixed method name --- .../Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs b/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs index 95e82dc..d0dfe2f 100644 --- a/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs +++ b/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/TimelineSteps.cs @@ -109,7 +109,7 @@ public static void WhenIAddAnEmailToTheTimeline(string subject, string duration, /// /// The name of the activity entity. [When(@"I click create for (?:a|an) '(.*)' on the timeline")] - public static void WhenIAddAnEmailToTheTimeline(string activityName) + public static void WhenIClickCreateOnTheTimeline(string activityName) { Driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Timeline.Popout])); Driver.ClickWhenAvailable(By.XPath($"//li[contains(@id,\"notescontrol-createNewRecord_flyoutMenuItem_{activityName}\")]")); From 92ab786ba64219651faa2c108fe6748e895cd61c Mon Sep 17 00:00:00 2001 From: Luke Benting Date: Fri, 4 Jun 2021 14:16:39 +0100 Subject: [PATCH 3/3] Added ignores to failing tests and linked to EasyRepro issues. --- .../BusinessProcessFlowSteps.feature | 4 ++-- .../DialogSteps.feature | 6 ++++++ .../EntitySteps.feature | 4 +++- .../QuickCreateSteps.feature | 2 +- .../TimelineSteps.feature | 2 ++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/BusinessProcessFlowSteps.feature b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/BusinessProcessFlowSteps.feature index fa85a96..23ad4f4 100644 --- a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/BusinessProcessFlowSteps.feature +++ b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/BusinessProcessFlowSteps.feature @@ -31,9 +31,9 @@ Scenarios: | column | type | value | | sb_text | text | Some text | | sb_number | numeric | 10 | - | sb_yesno | boolean | false | + # | sb_yesno | boolean | false | Currently failing due to https://github.com/microsoft/EasyRepro/issues/1140 | sb_choice | optionset | Option A | - | sb_dateandtime | datetime | 1/1/2021 13:00 | + # | sb_dateandtime | datetime | 1/1/2021 13:00 | Currently failing due to https://github.com/microsoft/EasyRepro/issues/1139 | sb_dateonly | datetime | 1/1/2021 | | sb_currency | currency | £10.00 | diff --git a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/DialogSteps.feature b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/DialogSteps.feature index 61c32c1..b51fd36 100644 --- a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/DialogSteps.feature +++ b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/DialogSteps.feature @@ -16,14 +16,20 @@ Scenario: Cancel a confirmation dialog When I select the 'Show Confirmation Dialog' command And I cancel when presented with the confirmation dialog +@ignore +#Currently failing due to https://github.com/microsoft/EasyRepro/issues/1120 Scenario: Assign to me on assign dialog When I select the 'Assign' command And I assign to me on the assign dialog +@ignore +#Currently failing due to https://github.com/microsoft/EasyRepro/issues/1120 Scenario: Assign to user on assign dialog When I select the 'Assign' command And I assign to a user named 'Power Apps Checker Application' on the assign dialog +@ignore +#Currently failing due to https://github.com/microsoft/EasyRepro/issues/1120 Scenario: Assign to team on assign dialog Given I have created 'a different team' When I select the 'Assign' command diff --git a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/EntitySteps.feature b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/EntitySteps.feature index e172cb9..222305d 100644 --- a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/EntitySteps.feature +++ b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/EntitySteps.feature @@ -29,7 +29,7 @@ Scenarios: | sb_yesno | boolean | true | | sb_choice | optionset | Option A | | sb_choices | multioptionset | Option A, Option B | - | sb_dateandtime | datetime | 1/1/2021 13:00 | + # | sb_dateandtime | datetime | 1/1/2021 13:00 | Currently failing due to https://github.com/microsoft/EasyRepro/issues/1139 | sb_dateonly | datetime | 1/1/2021 | | sb_currency | currency | £10.00 | @@ -106,6 +106,8 @@ Scenario: Save a record When I enter 'Some text' into the 'sb_name' text field on the form And I save the record +@ignore +#Currently failing due to https://github.com/microsoft/EasyRepro/issues/1120 Scenario: Assign to a user or team Given I have created 'a team' And I have created 'a secondary mock record' diff --git a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/QuickCreateSteps.feature b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/QuickCreateSteps.feature index d24cd17..b9abbd4 100644 --- a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/QuickCreateSteps.feature +++ b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/QuickCreateSteps.feature @@ -18,7 +18,7 @@ Scenarios: | sb_yesno | boolean | true | | sb_choice | optionset | Option A | | sb_choices | multioptionset | Option A, Option B | - | sb_dateandtime | datetime | 1/1/2021 13:00 | + # | sb_dateandtime | datetime | 1/1/2021 13:00 | Currently failing due to https://github.com/microsoft/EasyRepro/issues/1139 | sb_dateonly | datetime | 1/1/2021 | | sb_currency | currency | £10.00 | diff --git a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/TimelineSteps.feature b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/TimelineSteps.feature index 8cbd9f2..d54d31d 100644 --- a/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/TimelineSteps.feature +++ b/bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/TimelineSteps.feature @@ -11,6 +11,8 @@ Background: Scenario: Add appointment to timeline When I add an appointment to the timeline with the subject 'A subject', the description 'A description', the duration '1', and the location 'A location' +@ignore +#Currently failing due to https://github.com/microsoft/EasyRepro/issues/1075 Scenario: Add note to timeline When I add a note to the timeline with the title 'A note' and the body 'A note's body'