-
Notifications
You must be signed in to change notification settings - Fork 5
Home page redesign tests refactor and bugs fixing of logs, comments, reports creation. #26
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
5bd2390
Updated delete_project function is utils.py file.
732a493
Updated css selector on test_delete_sketches.py file.
d7c0d22
Updated create_sketch function is utils.py file.
200c686
Updated test_add_projectfile_direct function is test_sketch.py file.
e6bd116
Updated Firefox version to 45 in firefox_capabilities.yaml file.
c25b39d
Modified test_walkthrough.py to avoid random failures when testing pa…
8c4d236
Renamed P-Space-Jarvis attiny85.zip to P-Space-Jarvis-attiny85.zip.
be9b388
Updated test_compile_local_files function due to homepage changes.
bea5ae2
Updated functions that test upload functionality.
f709d18
Corrected assert statement in test_compile_local_files function.
2e586a1
Updated comments on function update_comment in disqus.py file.
daa8028
Added missing space in create_log function's arguments.
a49a574
Disqus comment in the last example of each library not logged in logf…
9046f0f
Updated dictionary of template strings used to generate the Disqus co…
ac01613
Updated function that handles Disqus library comments.
a07320d
Fixed issue: Disqus comment is not created when library has no examples.
ed135b4
Fixed issue: Disqus comment is not created when library has no examples.
0cbbc75
Fixed issue: Disqus comment is not created when library has no examples.
238867a
Fixed Firefox issue when running test_library_fetch.py test.
c80a28c
Removed redundant else condition from handle_library_comment function.
67215ee
Added parenthesis after if statements so that the code execution orde…
0d807d4
Removed unnecessary console.log used for debugging purpose.
b75a8a6
Added missing space after = .
42ee6b4
Added missing spaces after == .
d2583c3
Removed expected_condition from test_add_projectfile_direct function.
f75cd14
Added multiple functions that change project properties.
296a7aa
Updated create_project function and related tests.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixed issue: Disqus comment is not created when library has no examples.
Modified test_libraries.py in order to test that all library examples compile successfully and that Disqus comments are created on library url pages and on examples.
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,47 @@ | ||
| from codebender_testing.config import LIBRARIES_TEST_LOGFILE | ||
| from codebender_testing.utils import SeleniumTestCase | ||
|
|
||
| GET_SKETCHES_SCRIPT = "return $('{selector}').map(function() {{ return this.href; }}).toArray();" | ||
|
|
||
| GET_ALL_LIBRARIES_EXAMPLES_URLS_SCRIPT = """ | ||
| var librariesMap = {}; | ||
| var machineNameFilter = /.+\(\s(.+)\.h\s\)/; | ||
| var accordionHeadings = $('#mycontainer').find('.accordion-heading'); | ||
| $.each(accordionHeadings, function (key, value) {{ | ||
| var libraryName = $(value).text().trim(); | ||
| if (machineNameFilter.test(libraryName)) {{ | ||
| libraryName = libraryName.match(machineNameFilter)[1].trim(); | ||
| }} | ||
| if (!librariesMap.hasOwnProperty(libraryName)) {{ | ||
| librariesMap[libraryName] = []; | ||
| }} | ||
|
|
||
| var examples = $(value).parent().find('.accordion-body').find('li a'); | ||
|
|
||
| $.each(examples, function (k, v) {{ | ||
| var href = $(v).attr('href'); | ||
| librariesMap[libraryName].push(href); | ||
| }}); | ||
| }}); | ||
| console.log(librariesMap); | ||
| return librariesMap; | ||
| """ | ||
| class TestLibraryExamples(SeleniumTestCase): | ||
|
|
||
| def test_compile_all_libraries(self): | ||
| """Tests that all library examples compile successfully.""" | ||
| self.compile_all_sketches('/libraries', '.accordion li a', | ||
| compile_type='library', | ||
| iframe=False, project_view=True, | ||
| create_report=True, logfile=LIBRARIES_TEST_LOGFILE, | ||
| comment=True) | ||
| url = '/libraries' | ||
| self.open(url) | ||
|
|
||
| examples = self.execute_script(GET_SKETCHES_SCRIPT.format(selector='.accordion li a'), '$') | ||
| assert len(examples) > 0 | ||
| libraries = self.execute_script(GET_SKETCHES_SCRIPT.format(selector='.library_link'), '$') | ||
| assert len(libraries) > 0 | ||
| examples_libraries = examples + libraries | ||
|
|
||
| """Tests that all library examples compile successfully and comments on library url page and on its examples.""" | ||
| library_examples_urls = self.execute_script(GET_ALL_LIBRARIES_EXAMPLES_URLS_SCRIPT, '$') | ||
|
|
||
| self.comment_compile_libraries_examples(examples_libraries, library_examples_urls, | ||
| compile_type='library', iframe=False, | ||
| project_view=True, create_report=True, | ||
| logfile=LIBRARIES_TEST_LOGFILE, comment=True) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot the console.log()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.