Skip to content

Instantly share code, notes, and snippets.

@ngty
Created April 2, 2009 15:55
Show Gist options
  • Save ngty/89264 to your computer and use it in GitHub Desktop.
Save ngty/89264 to your computer and use it in GitHub Desktop.
Feature: Create Public Holidays
In order for the system to function as a reasonable HRM
It should support public holidays w.r.t countries
As human resource personnel, I should be able to create public holidays in the system
Scenario Outline: Access "New Public Holiday" Page
Given the following countries exist in the system (...)
| name |
| Singapore |
| Malaysia |
And the following users exist in the system (...) *
| name | email | country | role_assignments |
| Jane | [email protected] | Singapore | Human Resource |
| Max | [email protected] | Malaysia | Human Resource |
And I use firefox to visit "Manage Public Holidays" page as "<user>" [2009/01]
When I follow "New Public Holiday"
Then I should see "New Public Holiday" page
And I should see "Events / Public holidays" side navigator as "selected"
And I should see "Manage / New" breadcrumb navigator
And I should see "Basic Info" section showing (...)
* "Country*" selected as "<country>"
* "Date*" as "" & ""
* "Remark(s)" as ""
And I should see buttons "Save", "Reset" & "Cancel"
Examples:
| user | country |
| Jane | Singapore |
| Max | Malaysia |
Scenario: Interactive Dynamic Effects (w.r.t Conflicting Dates)
Given the following countries exist in the system (...)
| name |
| Malaysia |
| Singapore |
And the following users exist in the system (...) *
| name | email | country | role_assignments |
| Jane | [email protected] | Singapore | Human Resource |
| Dennis | [email protected] | Malaysia | |
And the following public holidays exist in the system (...) *
| date_start | date_end | country |
| 2009-02-20 | 2009-02-21 | Singapore |
| 2009-01-28 | 2009-02-01 | Malaysia |
| 2009-02-23 | 2009-02-23 | Singapore |
| 2009-02-24 | 2009-02-25 | Malaysia |
And I use firefox to visit "New Public Holiday" page as "Jane" [2009/02]
And I focus on "Basic Info" section
And I should not see any datepicker
When I click on "Date*" (start)
Then I should see a datepicker w days "20", "21" & "23" disabled
When I click on "Date*" (end)
Then I should see a datepicker w days "20", "21" & "23" disabled
When I fill in "Date*" with "" & ""
And I press "Save"
Then I should see "New Public Holiday" page
When I select "Country*" as "Malaysia"
When I click on "Date*" (start)
Then I should see a datepicker w days "1", "24" & "25" disabled
When I click on "Date*" (end)
Then I should see a datepicker w days "1", "24" & "25" disabled
Scenario Outline: Failure to Create Public Holiday
Given the following countries exist in the system (...)
| name |
| Singapore |
| Malaysia |
And the following users exist in the system (...) *
| name | email | role_assignments |
| Jane | [email protected] | Human Resource |
| Max | [email protected] | |
And the following public holidays exist in the system (...) *
| date_start | date_end | country |
| 2009-02-20 | 2009-02-21 | Malaysia |
| 2009-02-22 | 2009-02-22 | Malaysia |
| 2009-02-23 | 2009-02-23 | Malaysia |
| 2009-02-24 | 2009-02-24 | Malaysia |
And I use firefox to visit "New Public Holiday" page as "Jane" [2009/02]
And I focus on "Basic Info" section
And I select "Country*" as "<country>"
And I fill in "Date*" with "<date_start>" & "<date_end>"
And I fill in "Remark(s)" with ""
When I press "Save"
Then I should see "New Public Holiday" page
And I should see "Public holiday failed to be created" error
And I should see "<detail>" error detail
When I focus on "Basic Info" section (error)
Then I should see "Country*" selected as "<country>" (ok)
And I should see "Date*" as "<date_start>" & "<date_end>" (<date.dc>)
And I should see "Remark(s)" as "" (ok)
When I press "Cancel"
Then I should see "Manage Public Holidays" page
And I should see "Creating of public holiday cancelled" warning
And I should only see the following 4 public holidays (...)
* "2009-02-20 ~ 2009-02-21 (x2)"
* "2009-02-22"
* "2009-02-23"
* "2009-02-24"
Examples:
| date_start | date_end | country | detail | date.dc |
| 2009-02-20 | 2009-02-20 | Malaysia | Date is already taken | error |
| 2009-01-25 | 2009-01-24 | Singapore | Date start must not be after date end | error |
| 2009-01-32 | 2009-02-01 | Singapore | Date start/end is invalid | error |
| 2009-01-25 | 2009-01-32 | Singapore | Date start/end is invalid | error |
| 2009-02-25 | | Singapore | Date start/end must not be blank | error |
| | 2009-02-25 | Singapore | Date start/end must not be blank | error |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment