Cucumber Features

Expand All

Collapse All

# Our minimum version of Safari does not support web workers
@no_mobile @no_safari

Feature: Python Lab run code

Background

  1. visual log on sauce labs: https://saucelabs.com/tests/489a07390c4242b99d6311ba21efb67d
  2. Given I create a student named "Penelope"
    features/step_definitions/account_steps.rb:153
  3. And I am on "http://studio.code.org/courses/allthethingscourse/units/1/lessons/50/levels/1?noIntrojs=true"
    features/step_definitions/steps.rb:125
  4. And I wait to see "#uitest-codebridge-run"
    features/step_definitions/steps.rb:160
  5. And I wait until "#uitest-codebridge-run" is not disabled
    features/step_definitions/steps.rb:1007
features/code_tools/pythonlab/pythonlab_run.feature:17

Scenario: Continue button and progress status shows up correctly

    # Level 1 is not validated; continue button will show up after editing and running code.
  1. And I wait to see ".cm-content"
    features/step_definitions/steps.rb:160
  2. And I verify progress in the header of the current page is "not_tried" for level 1
    features/step_definitions/progress.rb:81
  3. And I focus selector ".cm-content"
    features/step_definitions/steps.rb:625
  4. And I press keys "print('more code')\n"
    features/step_definitions/steps.rb:1386
  5. # Wait to ensure the editor has the updated text before clicking run
  6. And I wait for 1 second
    features/step_definitions/steps.rb:407
  7. And I press "uitest-codebridge-run"
    features/step_definitions/steps.rb:436
  8. And I wait until "#uitest-codebridge-console" contains text "more code"
    features/step_definitions/steps.rb:268
  9. Then I verify progress in the header of the current page is "attempted" for level 1
    features/step_definitions/progress.rb:81
  10. And element "#instructions-continue-button" is visible
    features/step_definitions/steps.rb:913
  11. And element "#instructions-continue-button" contains text "Continue"
    features/step_definitions/steps.rb:817
  12. And I press "instructions-continue-button"
    features/step_definitions/steps.rb:436
  13. # Validated level that passes by default, running validation will pass the level and
    # cause the continue button to be enabled.
  14. And I wait until current URL contains "http://studio.code.org/courses/allthethingscourse/units/1/lessons/50/levels/2"
    features/step_definitions/steps.rb:379
  15. # Check that progress has been updated for the previous level
  16. Then I verify progress in the header of the current page is "perfect" for level 1
    features/step_definitions/progress.rb:81
  17. And I wait until element "#resource-panel-tab-validation" is visible
    features/step_definitions/steps.rb:313
  18. And I press "resource-panel-tab-validation"
    features/step_definitions/steps.rb:436
    stale element reference: element is not attached to the page document
      (Session info: chrome=109.0.5414.75); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception (Selenium::WebDriver::Error::StaleElementReferenceError)
    ./utils/selenium_browser.rb:51:in `create_response'
    ./features/step_definitions/steps.rb:440:in `block (2 levels) in '
    ./features/step_definitions/steps.rb:68:in `page_load'
    ./features/step_definitions/steps.rb:440:in `/^I press "([^"]*)"(?: to load a new (page|tab))?$/'
    ./features/support/hooks.rb:28:in `block in '
    features/code_tools/pythonlab/pythonlab_run.feature:38:in `And I press "resource-panel-tab-validation"'
    49    # Replaces 'unexpected response' message with the actual parsed error from the JSON response, if provided.
    50    def create_response(code, body, content_type)
    51      super
    52    rescue Selenium::WebDriver::Error::WebDriverError => exception
    53      if (msg = exception.message.match(/unexpected response, code=(?\d+).*\n(?.*)/))
    54# gem install syntax to get syntax highlighting
  19. And I wait to see "#uitest-validate-button"
    features/step_definitions/steps.rb:160
  20. And I wait until "#uitest-validate-button" is not disabled
    features/step_definitions/steps.rb:1007
  21. And I press "uitest-validate-button"
    features/step_definitions/steps.rb:436
  22. And I wait until element "#instructions-continue-button" is visible
    features/step_definitions/steps.rb:313
  23. And element "#instructions-continue-button" contains text "Continue"
    features/step_definitions/steps.rb:817
  24. Then I verify progress in the header of the current page is "perfect" for level 2
    features/step_definitions/progress.rb:81
  25. Then I sign out
    features/step_definitions/account_steps.rb:278