Skip to content

Instantly share code, notes, and snippets.

@mPastuszko
Created October 30, 2012 08:24
Show Gist options
  • Save mPastuszko/3978964 to your computer and use it in GitHub Desktop.
Save mPastuszko/3978964 to your computer and use it in GitHub Desktop.
Story: Filter project by date range
!-------------------------------------------------------------------------------
As an XTRF user
I want to filter out projects by date ranges
In order to find the projects I look for
!--=============================================================================
Scenario: User selects projects starting *today* using *quick select in filter sidebar*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user hovers "current" link in quick select near Start Date
And user clicks "day" in quick select menu
Then Start Date input field should show "Today"
Scenario: User selects projects starting *today* using *quick select in calendar view*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user hovers "current" link in quick select in calendar view
And user clicks "day" in quick select menu
Then Start Date input field should show "Today"
And month selected in From calendar should be September
And year selected in From calendar should be 2012
And day selected in From calendar should be 28
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be September
And year selected in To calendar should be 2012
And day selected in To calendar should be 28
And Anytime checkbox in To calendar should be unchecked
And days number label should show "1 day selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "Today"
Scenario: User selects projects starting *today* using *calendar view manually*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user clicks day 28 in From calendar
And user clicks day 28 in To calendar
Then Start Date input field should show "Today"
And month selected in From calendar should be September
And year selected in From calendar should be 2012
And day selected in From calendar should be 28
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be September
And year selected in To calendar should be 2012
And day selected in To calendar should be 28
And Anytime checkbox in To calendar should be unchecked
And days number label should show "1 day selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "Today"
!--=============================================================================
Scenario: User selects projects started *yesterday* using *quick select in filter sidebar*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user hovers "previous" link in quick select near Start Date
And user clicks "day" in quick select menu
Then Start Date input field should show "Yesterday"
Scenario: User selects projects started *yesterday* using *quick select in calendar view*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user hovers "previous" link in quick select in calendar view
And user clicks "day" in quick select menu
Then Start Date input field should show "Yesterday"
And month selected in From calendar should be September
And year selected in From calendar should be 2012
And day selected in From calendar should be 27
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be September
And year selected in To calendar should be 2012
And day selected in To calendar should be 27
And Anytime checkbox in To calendar should be unchecked
And days number label should show "1 day selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "Yesterday"
Scenario: User selects projects started *yesterday* using *calendar view manually*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user clicks day 27 in From calendar
And user clicks day 27 in To calendar
Then Start Date input field should show "Yesterday"
And month selected in From calendar should be September
And year selected in From calendar should be 2012
And day selected in From calendar should be 27
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be September
And year selected in To calendar should be 2012
And day selected in To calendar should be 27
And Anytime checkbox in To calendar should be unchecked
And days number label should show "1 day selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "Yesterday"
!--=============================================================================
Scenario: User selects projects started *in the previous month* using *quick select in filter sidebar*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user hovers "previous" link in quick select near Start Date
And user clicks "month" in quick select menu
Then Start Date input field should show "From 08/01/2012 to 08/31/2012"
Scenario: User selects projects started *in the previous month* using *quick select in calendar view*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user hovers "previous" link in quick select in calendar view
And user clicks "month" in quick select menu
Then Start Date input field should show "From 08/01/2012 to 08/31/2012"
And month selected in From calendar should be August
And year selected in From calendar should be 2012
And day selected in From calendar should be 1
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be August
And year selected in To calendar should be 2012
And day selected in To calendar should be 31
And Anytime checkbox in To calendar should be unchecked
And days number label should show "31 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "From 08/01/2012 to 08/31/2012"
Scenario: User selects projects started *in the previous month* using *calendar view manually*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user selects month August in From calendar
And user clicks day 1 in From calendar
And user selects month August in To calendar
And user clicks day 31 in To calendar
Then Start Date input field should show "From 08/01/2012 to 08/31/2012"
And month selected in From calendar should be August
And year selected in From calendar should be 2012
And day selected in From calendar should be 1
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be August
And year selected in To calendar should be 2012
And day selected in To calendar should be 31
And Anytime checkbox in To calendar should be unchecked
And days number label should show "31 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "From 08/01/2012 to 08/31/2012"
!--=============================================================================
Scenario: User selects projects started *in the last 14 days* using *quick select in filter sidebar*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user hovers "last" link in quick select near Start Date
And user clicks "14 days" in quick select menu
Then Start Date input field should show "From 09/15/2012 to today"
Scenario: User selects projects started *in the last 14 days* using *quick select in calendar view*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user hovers "last" link in quick select in calendar view
And user clicks "14 days" in quick select menu
Then Start Date input field should show "From 09/15/2012 to today"
And month selected in From calendar should be September
And year selected in From calendar should be 2012
And day selected in From calendar should be 15
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be September
And year selected in To calendar should be 2012
And day selected in To calendar should be 28
And Anytime checkbox in To calendar should be unchecked
And days number label should show "14 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "From 09/15/2012 to today"
Scenario: User selects projects started *in the last 14 days* using *calendar view manually*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user clicks day 27 in From calendar
And user clicks day 27 in To calendar
Then Start Date input field should show "From 09/15/2012 to today"
And month selected in From calendar should be September
And year selected in From calendar should be 2012
And day selected in From calendar should be 15
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be September
And year selected in To calendar should be 2012
And day selected in To calendar should be 28
And Anytime checkbox in To calendar should be unchecked
And days number label should show "14 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "From 09/15/2012 to today"
!--=============================================================================
Scenario: User selects projects started *on September 10 or earlier* using *calendar view manually*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user checks Anytime checkbox in From calendar
And user clicks day 10 in To calendar
Then Start Date input field should show "08/10/2012 or earlier"
And no day in From calendar should be selected
And Anytime checkbox in From calendar should be checked
And month selected in To calendar should be September
And year selected in To calendar should be 2012
And day selected in To calendar should be 10
And Anytime checkbox in To calendar should be unchecked
And days number label should show "Over 365 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "08/10/2012 or earlier"
!--=============================================================================
Scenario: User selects projects starting *anytime* using *calendar view manually*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user checks Anytime checkbox in From calendar
And user clicks day 10 in To calendar
Then Start Date input field should show "Anytime"
And no day in To calendar should be selected
And Anytime checkbox in From calendar should be checked
And no day in To calendar should be selected
And Anytime checkbox in To calendar should be checked
And days number label should show "Over 365 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "Anytime"
!--=============================================================================
Scenario: User selects projects starting *next quarter* using *quick select in filter sidebar*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user hovers "next" link in quick select near Start Date
And user clicks "quarter" in quick select menu
Then Start Date input field should show "From 10/01/2012 to 12/31/2012"
Scenario: User selects projects starting *next quarter* using *quick select in calendar view*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user hovers "next" link in quick select in calendar view
And user clicks "quarter" in quick select menu
Then Start Date input field should show "From 10/01/2012 to 12/31/2012"
And month selected in From calendar should be October
And year selected in From calendar should be 2012
And day selected in From calendar should be 1
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be December
And year selected in To calendar should be 2012
And day selected in To calendar should be 31
And Anytime checkbox in To calendar should be unchecked
And days number label should show "92 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "From 10/01/2012 to 12/31/2012"
Scenario: User selects projects starting *next quarter* using *calendar view manually*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user selects month October in From calendar
And user clicks day 1 in From calendar
And user selects month December in To calendar
And user clicks day 31 in To calendar
Then Start Date input field should show "From 10/01/2012 to 12/31/2012"
And month selected in From calendar should be October
And year selected in From calendar should be 2012
And day selected in From calendar should be 1
And Anytime checkbox in From calendar should be unchecked
And month selected in To calendar should be December
And year selected in To calendar should be 2012
And day selected in To calendar should be 31
And Anytime checkbox in To calendar should be unchecked
And days number label should show "92 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "From 10/01/2012 to 12/31/2012"
!--=============================================================================
Scenario: User selects projects starting *today or later* using *calendar view manually*
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user clicks day 28 in From calendar
And user checks Anytime checkbox in To calendar
Then Start Date input field should show "Today or later"
And month selected in From calendar should be September
And year selected in From calendar should be 2012
And day selected in From calendar should be 28
And Anytime checkbox in From calendar should be unchecked
And no day in To calendar should be selected
And Anytime checkbox in To calendar should be checked
And days number label should show "Over 365 days selected"
When user clicks OK button in calendar view
Then calendar view should disappear
And Start Date input field should show "Today or later"
!--=============================================================================
Scenario: User cancels selecting date range with calendar view
!-------------------------------------------------------------------------------
Given user SeleniumTest is logged in with password seleniumTest123.
And user is on browse project page
And today is September 28, 2012
When user clicks Start Date input field
And user clicks close button in calendar view
Then calendar view should disappear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment