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

Update selenium tests #3412

Merged
merged 8 commits into from Mar 23, 2018

Conversation

Projects
None yet
2 participants
@mpacer
Copy link
Member

mpacer commented Mar 9, 2018

This PR comes from the same pair programming session with @takluyver that #3411 came from.

This also depends upon #3411.

current_items = get_list_items(authenticated_browser)
current_items_links = [item["link"] for item in current_items]
stored_items = visited_dict.pop(authenticated_browser.current_url)
stored_items_links = [item["link"] for item in stored_items]

This comment has been minimized.

@takluyver

takluyver Mar 13, 2018

Member

Neat, I like the comparison of what's here now vs what was here before.

items = get_list_items(authenticated_browser)
visited_dict[authenticated_browser.current_url] = items
print(authenticated_browser.current_url, len(items))
if len(items)>1:

This comment has been minimized.

@takluyver

takluyver Mar 13, 2018

Member

Why does it not work with 1 item? Does it catch the link to go up a directory?

I think it would be good to filter out which items are directories, so that this doesn't accidentally load a notebook or another file.

This comment has been minimized.

@mpacer

mpacer Mar 16, 2018

Author Member

For the first, I was using that to filter out .. but I see now that that actually introduces weird behaviour at the root.

For the second, I gather that I can distinguish that based on the link target being on the /tree vs. /notebook or /file endpoints?

This comment has been minimized.

@takluyver

takluyver Mar 20, 2018

Member

Yep, that's right.

This comment has been minimized.

@mpacer

mpacer Mar 20, 2018

Author Member

Oops! i forgot about this simple fix and have been focused on getting the notebook navigation stuff working on the markdown stuff. I'll fix this quickly

@takluyver takluyver added this to the 5.5 milestone Mar 13, 2018

raise("You currently ")
wait_for_selector(browser, '.item_link')
items = get_list_items(browser)
return [i for i in items if 'tree' in i['link'] and i['label'] != '..']

This comment has been minimized.

@takluyver

takluyver Mar 22, 2018

Member

This will go wrong for any file that has tree in the name. Maybe that's unlikely, but I think it's worth doing it a bit more thoroughly.

This comment has been minimized.

@mpacer

mpacer Mar 22, 2018

Author Member

ok addressed by using an explicit check for whether urls point to something in the tree (with url_in_tree)

"""
try:
assert 'tree' in browser.current_url
except PageError:

This comment has been minimized.

@takluyver

takluyver Mar 22, 2018

Member

This is a convoluted way of writing if 'tree' not in browser.current_url: , even if it was catching the right error. Let's stick to the simple if statement rather than using assert to achieve the same thing.

This comment has been minimized.

@mpacer

mpacer Mar 22, 2018

Author Member

fair enough — changed.

@takluyver takluyver merged commit dc1eeab into jupyter:master Mar 23, 2018

4 checks passed

codecov/patch 0% of diff hit (target 0%)
Details
codecov/project 77.58% (-0.13%) compared to e321c80
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Mar 23, 2018

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.