Skip to content

Commit

Permalink
feat: added new Timeline step binding for clicking create for a custo…
Browse files Browse the repository at this point in the history
…m activity (#82)

* Added new Timeline step binding for clicking create for a custom activity.

* Fixed method name

* Added ignores to failing tests and linked to EasyRepro issues.
  • Loading branch information
LukeBenting authored Jun 7, 2021
1 parent 4556652 commit 100f2e3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/// <summary>
Expand Down Expand Up @@ -102,6 +104,17 @@ public static void WhenIAddAnEmailToTheTimeline(string subject, string duration,
contacts.Rows.Where(r => r[0] == "BCC").Select(r => r["Name"]).ToArray());
}

/// <summary>
/// Clicks the create button for the given activity.
/// </summary>
/// <param name="activityName">The name of the activity entity.</param>
[When(@"I click create for (?:a|an) '(.*)' on the timeline")]
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}\")]"));
}

private static void EmailContacts(string reference, string[] contacts)
{
if (contacts.Length == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -27,4 +29,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 |
| 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

0 comments on commit 100f2e3

Please sign in to comment.