Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jonahstanley/upgrade chrome version #516

Merged
merged 5 commits into from
Jul 31, 2013

Conversation

JonahStanley
Copy link
Contributor

suggested reviewers: @singingwolfboy @jzoldak
The following features had issues with chrome/chrome driver versions

lms/djangoapps/courseware/features/homepage.feature
cms/djangoapps/contentstore/features/advanced-settings.feature
cms/djangoapps/contentstore/features/html-editor.feature
cms/djangoapps/contentstore/features/problem-editor.feature
cms/djangoapps/contentstore/features/section.feature
cms/djangoapps/contentstore/features/subsection.feature
cms/djangoapps/contentstore/features/upload.feature
cms/djangoapps/contentstore/features/video-editor.feature
cms/djangoapps/contentstore/features/video.feature

In order to fix these, the following things were changed:

  1. In homepage.feature, partners could no longer be accessed with .text or .value so .html was used
  2. Code mirror was very awkward to deal with and the place to accept user input is technically hidden so by making it visible, the previous interaction could be kept.
  3. The other issues were fixed by adding implicit waits and success conditions to clicks. These were mostly failing due to animation speeds. One of the animation endings could only be detected through its styling, thus the evaluate_script is used in order to access it.

These changes were tested in chrome version 28.0.1500.71 and chromedriver 2.1.210398
testing.md was updated accordingly. It is also important to note that this version of chromedriver is compatible with versions 27-30 meaning that it won't work with chrome 26 (what a lot of people might be running) explaining why both need to be updated at once.

All changes that were made should be backwards compatible due to the nature of the changes (since mostly only verification steps were added). world.wait_for is an implicit wait so these tests shouldn't take any longer to run.

@@ -13,6 +13,10 @@ def create_component_instance(step, component_button_css, category,

click_new_component_button(step, component_button_css)

def animation_done(_driver):
return world.browser.evaluate_script("$('div.new-component').css('display')") == 'none'
world.wait_for(animation_done)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting acceptance test failures here:

Given I have created a Video component                          # cms/djangoapps/contentstore/features/common.py:208
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
    ret = self.function(self.step, *args, **kw)
  File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/common.py", line 213, in i_created_a_video_component
    has_multiple_templates=False
  File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py", line 18, in create_component_instance
    world.wait_for(animation_done)
  File "/Users/db/dev/edx-platform/common/djangoapps/terrain/ui_helpers.py", line 23, in wait_for
    WebDriverWait(world.browser.driver, 5).until(func)
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/support/wait.py", line 71, in until
    raise TimeoutException(message)
TimeoutException: Message: '' 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed... I forgot that one click components do not have animations so I made a check for which component type we are creating

@@ -12,12 +12,17 @@ def create_component_instance(step, component_button_css, category,
has_multiple_templates=True):

click_new_component_button(step, component_button_css)
if category == 'problem' or category == 'html':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: it's simpler and clearer to write if category in ('problem', 'html'):

@JonahStanley
Copy link
Contributor Author

Does that meant that the tests were working or just that you noticed those two issues?

@singingwolfboy
Copy link
Contributor

Just noticed the issues. I can retry the tests now, if you think they will work.

@JonahStanley
Copy link
Contributor Author

I think they will. I am pretty sure I fixed those two broken tests you were seeing before

@singingwolfboy
Copy link
Contributor

More errors, but they don't seem related to the lines of code that you changed, so I don't know what to make of them. :(

  Scenario: High Level source is persisted for LaTeX problem (bug STUD-280)                             # cms/djangoapps/contentstore/features/problem-editor.feature:69
    Given I have created a LaTeX Problem                                                                # cms/djangoapps/contentstore/features/problem-editor.py:156
    When I edit and compile the High Level Source                                                       # cms/djangoapps/contentstore/features/problem-editor.py:168
    Then my change to the High Level Source is persisted                                                # cms/djangoapps/contentstore/features/problem-editor.py:175
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/problem-editor.py", line 180, in high_level_source_persisted
        world.wait_for(verify_text)
      File "/Users/db/dev/edx-platform/common/djangoapps/terrain/ui_helpers.py", line 23, in wait_for
        WebDriverWait(world.browser.driver, 5).until(func)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/support/wait.py", line 71, in until
        raise TimeoutException(message)
    TimeoutException: Message: '' 
    And when I view the High Level Source I see my changes 
  Scenario: Edit section release date                                           # cms/djangoapps/contentstore/features/section.feature:23
    Given I have opened a new course in Studio                                  # cms/djangoapps/contentstore/features/common.py:52
    And I have added a new section                                              # cms/djangoapps/contentstore/features/section.py:28
    When I click the Edit link for the release date                             # cms/djangoapps/contentstore/features/section.py:33
    And I save a new section release date                                       # cms/djangoapps/contentstore/features/section.py:39
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/section.py", line 42, in i_save_a_new_section_release_date
        world.browser.click_link_by_text('Save')
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/splinter/driver/__init__.py", line 311, in click_link_by_text
        return self.find_link_by_text(text).first.click()
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/splinter/driver/webdriver/__init__.py", line 344, in click
        self._element.click()
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 54, in click
        self._execute(Command.CLICK_ELEMENT)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 228, in _execute
        return self._parent.execute(command, params)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 165, in execute
        self.error_handler.check_response(response)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 158, in check_response
        raise exception_class(message, screen, stacktrace)
    WebDriverException: Message: u'unknown error: Element is not clickable at point (588, 412). Other element would receive the click: <a class="ui-state-default" href="#">...</a>\n  (Session info: chrome=28.0.1500.95)\n  (Driver info: chromedriver=2.1,platform=Mac OS X 10.8.4 x86_64)' 
    Then the section release date is updated                                    # cms/djangoapps/contentstore/features/section.py:117
    And I see a "saving" notification    
  Scenario: Users can edit static pages                     # cms/djangoapps/contentstore/features/static-pages.feature:18
    Given I have opened a new course in Studio              # cms/djangoapps/contentstore/features/common.py:52
    And I go to the static pages page                       # cms/djangoapps/contentstore/features/static-pages.py:9
    And I add a new page                                    # cms/djangoapps/contentstore/features/static-pages.py:17
    When I "edit" the "Empty" page                          # cms/djangoapps/contentstore/features/static-pages.py:32
    And I change the name to "New"                          # cms/djangoapps/contentstore/features/static-pages.py:40
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/static-pages.py", line 47, in change_name
        name_input._element.send_keys(Keys.END, Keys.BACK_SPACE)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 162, in send_keys
        self._execute(Command.SEND_KEYS_TO_ELEMENT, {'value': typing})
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 228, in _execute
        return self._parent.execute(command, params)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 165, in execute
        self.error_handler.check_response(response)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 158, in check_response
        raise exception_class(message, screen, stacktrace)
    ElementNotVisibleException: Message: u'element not visible\n  (Session info: chrome=28.0.1500.95)\n  (Driver info: chromedriver=2.1,platform=Mac OS X 10.8.4 x86_64)' 
    Then I should see a "New" static page  
  Scenario: User can view metadata                                  # cms/djangoapps/contentstore/features/video-editor.feature:4
    Given I have created a Video component                          # cms/djangoapps/contentstore/features/common.py:208
    And I edit and select Settings                                  # cms/djangoapps/contentstore/features/problem-editor.py:28
    Then I see the correct settings and default values              # cms/djangoapps/contentstore/features/video-editor.py:8
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/video-editor.py", line 16, in i_see_the_correct_settings_and_values
        ['Speed: 1.5x', '', False]])
      File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py", line 74, in verify_all_setting_entries
        expected_entries[counter][1], expected_entries[counter][2]
      File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py", line 60, in verify_setting_entry
        assert_equal(display_name, setting.find_by_css('.setting-label')[0].value)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 516, in assertEqual
        assertion_func(first, second, msg=msg)
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 509, in _baseAssertEqual
        raise self.failureException(msg)
    AssertionError: 'Default Speed' != u''
  Scenario: User can modify display name                            # cms/djangoapps/contentstore/features/video-editor.feature:9
    Given I have created a Video component                          # cms/djangoapps/contentstore/features/common.py:208
    And I edit and select Settings                                  # cms/djangoapps/contentstore/features/problem-editor.py:28
    Then I can modify the display name                              # cms/djangoapps/contentstore/features/problem-editor.py:45
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lettuce/core.py", line 143, in __call__
        ret = self.function(self.step, *args, **kw)
      File "/Users/db/dev/edx-platform/cms/djangoapps/contentstore/features/problem-editor.py", line 48, in i_can_modify_the_display_name
        world.get_setting_entry(DISPLAY_NAME).find_by_css('.setting-input')[0].fill('3.4')
    AttributeError: 'NoneType' object has no attribute 'find_by_css'
    And my display name change is persisted on save  

@singingwolfboy
Copy link
Contributor

Never mind -- must have been a fluke. I re-ran the tests, and they all passed. :shipit:

@jmnater
Copy link

jmnater commented Jul 31, 2013

👍

@wedaly
Copy link
Contributor

wedaly commented Jul 31, 2013

Runs for me on the old version of Chrome as well. 👍

JonahStanley pushed a commit that referenced this pull request Jul 31, 2013
@JonahStanley JonahStanley merged commit 8d11c24 into master Jul 31, 2013
@JonahStanley JonahStanley deleted the jonahstanley/upgrade-chrome-version branch July 31, 2013 15:17
chrisrossi pushed a commit to jazkarta/edx-platform that referenced this pull request Mar 31, 2014
Kelketek referenced this pull request in open-craft/edx-platform Sep 17, 2015
yokose-ks added a commit to nttks/edx-platform that referenced this pull request Dec 1, 2015
kawaguchi-ks added a commit to nttks/edx-platform that referenced this pull request Dec 1, 2015
…age-user-certificate-feature

Add manage user certificate feature (openedx#516)
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
farhaanbukhsh pushed a commit that referenced this pull request Mar 20, 2023
…language_nutmeg

fix: use language specified in SiteConfiguration [BB-6930]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants