Skip to content

Fix the LaTeX problems/HTML so high level source is saved. - #169

Closed
cahrens wants to merge 2 commits into
masterfrom
christina/latex
Closed

Fix the LaTeX problems/HTML so high level source is saved.#169
cahrens wants to merge 2 commits into
masterfrom
christina/latex

Conversation

@cahrens

@cahrens cahrens commented Jun 14, 2013

Copy link
Copy Markdown

Adds an integration test that verifies the bug fix.

Create helper method for typing in CodeMirror (which hopefully will now work on Mac as well).

@dmitchell Please try running the tests on your machine
@JonahStanley can you code review the tests? I do have two waits in the test, which I'd love to get rid of. I think I just need to figure out the right things to wait on.
@cdodge Can you code review the "hack" code that I restored in module_edit.coffee? This is code that was there previously, and it was how we saved all the metadata values. Now the only thing that will get picked up is source_code, as the other fields won't be marked with the class we are looking for.

@ichuang FYI, here is my pull request.

@dmitchell

Copy link
Copy Markdown
Contributor

Fixed the json for discussion topics test, but 2 errors:

Scenario: Test editing key value
#
cms/djangoapps/contentstore/features/advanced-settings.feature:22
Given I am on the Advanced Course Settings page in Studio
# cms/djangoapps/contentstore/features/advanced-settings.py:23
When I edit the value of a policy key and save
# cms/djangoapps/contentstore/features/advanced-settings.py:40
Then the policy key value is changed
# cms/djangoapps/contentstore/features/advanced-settings.py:93
Traceback (most recent call last):
File
"/Users/dmitchell/mitx_all/python/lib/python2.7/site-packages/lettuce/core.py",
line 143, in call
ret = self.function(self.step, _args, *_kw)
File
"/Users/dmitchell/mitx_all/edx-platform/cms/djangoapps/contentstore/features/advanced-settings.py",
line 94, in the_policy_key_value_is_changed
assert_equal(get_display_name_value(), '"foo"')
File
"/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py",
line 511, in assertEqual
assertion_func(first, second, msg=msg)
File
"/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py",
line 504, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: u'"Robot Super Course"' != '"foo"'
And I reload the page

Latex high level source failed but looks like timing?

And when I view the High Level Source I see my changes
#
cms/djangoapps/contentstore/features/problem-editor.py:182
Traceback (most recent call last):
File
"/Users/dmitchell/mitx_all/python/lib/python2.7/site-packages/lettuce/core.py",
line 143, in call
ret = self.function(self.step, _args, *_kw)
File
"/Users/dmitchell/mitx_all/edx-platform/cms/djangoapps/contentstore/features/problem-editor.py",
line 184, in high_level_source_in_editor
world.css_find('.launch-latex-compiler').find_by_css('a').click()
File
"/Users/dmitchell/mitx_all/python/lib/python2.7/site-packages/splinter/driver/webdriver/init.py",
line 341, in click
self._element.click()
File
"/Users/dmitchell/mitx_all/python/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py",
line 51, in click
self._execute(Command.CLICK_ELEMENT)
File
"/Users/dmitchell/mitx_all/python/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py",
line 225, in _execute
return self._parent.execute(command, params)
File
"/Users/dmitchell/mitx_all/python/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py",
line 160, in execute
self.error_handler.check_response(response)
File
"/Users/dmitchell/mitx_all/python/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py",
line 149, in check_response
raise exception_class(message, screen, stacktrace)
ElementNotVisibleException: Message: u'Element must be displayed to
click'

On Fri, Jun 14, 2013 at 3:16 PM, Christina Roberts <notifications@github.com

wrote:

Adds an integration test that verifies the bug fix.

Create helper method for typing in CodeMirror (which hopefully will now
work on Mac as well).

@dmitchell https://github.com/dmitchell Please try running the tests on
your machine
@JonahStanley https://github.com/JonahStanley can you code review the
tests? I do have two waits in the test, which I'd love to get rid of. I
think I just need to figure out the right things to wait on.
@cdodge https://github.com/cdodge Can you code review the "hack" code
that I restored in module_edit.coffee? This is code that was there
previously, and it was how we saved all the metadata values. Now the only
thing that will get picked up is source_code, as the other fields won't be
marked with the class we are looking for.

@ichuang https://github.com/ichuang FYI, here is my pull request.

You can merge this Pull Request by running

git pull https://github.com/edx/edx-platform christina/latex

Or view, comment on, or merge it at:

edx#169
Commit Summary

  • Put back in some older code to save source_code property.
  • Add helper method for typing in CodeMirror, make it robust to Mac
    and Unix.

File Changes

Patch Links:

@chrisndodge

Copy link
Copy Markdown
Contributor

+1 on coffee change

@JonahStanley

Copy link
Copy Markdown
Contributor

The tests worked for me as is...
In order to get rid of the stale element reference errors as well as some other wait-related issues, I plan on refactoring css_click to take in an optional # for attempts so that it will retry clicking a certain amount of times. I will try to get a pull request for it in today so that it can be merged into this but in case I don't, the plan is to do something like

    attempt = 0
    while attempt < 3:
        try:
            world.css_find(".CodeMirror")[index].click()
            break
        except:
            attempt += 1

@cahrens

cahrens commented Jun 17, 2013

Copy link
Copy Markdown
Author

I am closing this PR because I have merged with Jonah's changes in a new branch. See #186.

@cahrens cahrens closed this Jun 17, 2013
chrisrossi pushed a commit to jazkarta/edx-platform that referenced this pull request Mar 31, 2014
removing {marketing,marketing-ie,print}.scss from PIPELINE_CSS
aboudreault pushed a commit to aboudreault/edx-platform that referenced this pull request Aug 14, 2014
…ation-logging

mattdrayer/api-migration-logging: Added logging to script exceptions
ataki pushed a commit to ataki/edx-platform that referenced this pull request Mar 26, 2015
CrewS pushed a commit to CrewS/edx-platform-1 that referenced this pull request Dec 28, 2018
edx-secure pushed a commit that referenced this pull request Feb 13, 2020
SECURITY FIX : Fix CAPA Problems
alanoe pushed a commit to alanoe/edx-platform that referenced this pull request Mar 28, 2020
rediris pushed a commit to gymnasium/edx-platform that referenced this pull request Feb 25, 2021
…x/fix-multichoice-adv-settings

Update advanced settings JS to multichoice settings fields
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