Cucumber Features

Expand All

Collapse All

Feature: Calculations by means of adding one and substructing one

features/calculations.feature:3

Scenario: As a Calculator user I can increase by one and

    # decrease by one current value
    # initial number is 0 which is not shown
  1. Given Calculator is launched and active
    features/step_definitions/calculator_steps.rb:3
  2. Currently active application: CalculatorActivity
  3. When I touch 'ADD'
    features/step_definitions/calculator_steps.rb:38
  4. And notice the result
    features/step_definitions/calculator_steps.rb:43
  5. And I touch 'SUB'
    features/step_definitions/calculator_steps.rb:38
  6. And notice the result
    features/step_definitions/calculator_steps.rb:43
  7. And I touch 'SUB'
    features/step_definitions/calculator_steps.rb:38
  8. And notice the result
    features/step_definitions/calculator_steps.rb:43
  9. And I touch 'ADD'
    features/step_definitions/calculator_steps.rb:38
  10. And notice the result
    features/step_definitions/calculator_steps.rb:43
  11. Then the noticed results should be
    features/step_definitions/calculator_steps.rb:48
    1
    0
    -1
    0

Feature: Changing header and footer when actions taken

features/header_footer.feature:3

Scenario: As a Calculator user I can see greating in header

    # and the first result of ADD operation in footer
    # the result should be '1'
  1. When Calculator is launched and active
    features/step_definitions/calculator_steps.rb:3
  2. Currently active application: CalculatorActivity
  3. Then I see the following elements
    features/step_definitions/calculator_steps.rb:8
    header
    Islam_Hamdy
    footer
    Sarah Osama
  4. When I touch 'ADD'
    features/step_definitions/calculator_steps.rb:38
  5. Then I see the following elements
    features/step_definitions/calculator_steps.rb:8
    header
    Bravo ya islam
    footer
    new number =1
# the scenario FAILS because of the header not changing,
# when SUB button is touched
# I assume this can be big, but indeed the changing header,
# as well as footer requires clarification regarding which
# behaviour is correct
features/header_footer.feature:20

Scenario: As a Calculator user I can see greating in header

    # and the first result of SUB operation in footer
    # the result should be '-1'
  1. When Calculator is launched and active
    features/step_definitions/calculator_steps.rb:3
  2. Currently active application: CalculatorActivity
  3. Then I see the following elements
    features/step_definitions/calculator_steps.rb:8
    header
    Islam_Hamdy
    footer
    Sarah Osama
  4. When I touch 'SUB'
    features/step_definitions/calculator_steps.rb:38
  5. Then I see the following elements
    features/step_definitions/calculator_steps.rb:8
    header
    Bravo ya islam
    footer
    new number =-1
    There are mismatched elements on Calculator view.
    Expected [{"header"=>{:expected=>"Bravo ya islam", :actual=>"Islam_Hamdy", :ok=>false}}] to be empty. (Minitest::Assertion)
    ./features/step_definitions/calculator_steps.rb:32:in `/^I see the following elements$/'
    features/header_footer.feature:28:in `Then I see the following elements'
    ./features/step_definitions/calculator_steps.rb:32:in `/^I see the following elements$/'
    features/header_footer.feature:28:in `Then I see the following elements'
    30  }
    31
    32  assert_empty(
    33    not_matching_elements,
    34    'There are mismatched elements on Calculator view'
  6. screenshot_0.png
     

Feature: Starting Calculator application

features/initialize_calculator.feature:3

Scenario: As a Calculator user I can see initial view, on Calculator launch

  1. When Calculator is launched and active
    features/step_definitions/calculator_steps.rb:3
  2. Currently active application: CalculatorActivity
  3. Then I see the following elements
    features/step_definitions/calculator_steps.rb:8
    title
    Calculator
    header
    Islam_Hamdy
    adding_button
    ADD
    substruction_button
    SUB
    footer
    Sarah Osama
# all the scenarios in this feature FAIL because the counter gets
# underflows and overflows for Interger minimum and maximum values

Feature: Calculator properly handles underflows and overflows

features/underflow_overflow_handling.feature:5

Scenario: As a Calculator user I want to experience no underflows

    # when the count reaches small enough value
    # Calculator should continue producing less by one numbers
  1. Given Calculator is launched and active
    features/step_definitions/calculator_steps.rb:3
  2. Currently active application: CalculatorActivity
  3. And the count is the minimum value of Integer
    features/step_definitions/calculator_steps.rb:57
  4. The value set is: -2147483648
  5. When I touch 'SUB'
    features/step_definitions/calculator_steps.rb:38
  6. And notice the result
    features/step_definitions/calculator_steps.rb:43
  7. Then the result is 1 less than the pre-set up value
    features/step_definitions/calculator_steps.rb:64
    Expected: -2147483649
      Actual: 2147483647 (Minitest::Assertion)
    ./features/step_definitions/calculator_steps.rb:72:in `/^the result is (\d+) (less|more) than the pre\-set up value$/'
    features/underflow_overflow_handling.feature:14:in `Then the result is 1 less than the pre-set up value'
    ./features/step_definitions/calculator_steps.rb:72:in `/^the result is (\d+) (less|more) than the pre\-set up value$/'
    features/underflow_overflow_handling.feature:14:in `Then the result is 1 less than the pre-set up value'
    70    number_after_operation) if direction.eql?('more')
    71
    72  assert_equal(
    73    number_before_operation - diff.to_integer(nil),
    74    number_after_operation) if direction.eql?('less')
  8. screenshot_1.png
     
features/underflow_overflow_handling.feature:16

Scenario: As a Calcultor user I want to experience no overflows

    # when the count reaches big enough value
    # Calculator should continue producing bigger by one numbers
  1. Given Calculator is launched and active
    features/step_definitions/calculator_steps.rb:3
  2. Currently active application: CalculatorActivity
  3. And the count is the maximum value of Integer
    features/step_definitions/calculator_steps.rb:57
  4. The value set is: 2147483647
  5. When I touch 'ADD'
    features/step_definitions/calculator_steps.rb:38
  6. And notice the result
    features/step_definitions/calculator_steps.rb:43
  7. Then the result is 1 more than the pre-set up value
    features/step_definitions/calculator_steps.rb:64
    Expected: 2147483648
      Actual: -2147483648 (Minitest::Assertion)
    ./features/step_definitions/calculator_steps.rb:68:in `/^the result is (\d+) (less|more) than the pre\-set up value$/'
    features/underflow_overflow_handling.feature:25:in `Then the result is 1 more than the pre-set up value'
    ./features/step_definitions/calculator_steps.rb:68:in `/^the result is (\d+) (less|more) than the pre\-set up value$/'
    features/underflow_overflow_handling.feature:25:in `Then the result is 1 more than the pre-set up value'
    66  number_after_operation = @results.first.to_integer nil
    67  
    68  assert_equal(
    69    number_before_operation + diff.to_integer(nil),
    70    number_after_operation) if direction.eql?('more')
  8. screenshot_2.png