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

Weblab: fix Start Over and add version history test #19682

Merged
merged 1 commit into from Dec 15, 2017

Conversation

cpirich
Copy link
Contributor

@cpirich cpirich commented Dec 15, 2017

  • When selecting "Start Over" from the Version History dialog, Weblab would proceed to delete all files, but using the current project version, meaning that it would overwrite any changes made during that browser session with the empty project. Non-files-API code avoids this by forcing a new version when resetting the project. We now do the same for Files API projects by ensuring that the call to FilesApi.deleteAll() always generates a new version (using basePath() for the URL instead of basePathWithFilesVersion())
  • Added a weblab version history UI test. Unfortunately, it can't peek inside of the bramble IFRAME due to cross-domain restrictions, but we can at least verify that the proper number of unique versions are being created after we: (1) add a file, (2) save, (3) reset the project, (4) choose to restore the version after we first saved with the new file.

Scenario: Weblab Versions
# Create the initial version by adding a CSS file:
When I click selector "#headers div:nth-child(2)"
And I wait for 3 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually try to avoid arbitrary wait times in UI tests because they're more brittle than waiting for a particular element to appear. I understand that might not be possible in this test due to the cross-origin issues - is there anything we can watch for at this step and the one below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is definitely tough to wait on something that we can't see. If we figure out cross-domain access, it will help UI tests for weblab for sure!

And I wait for 3 seconds

# Click save & refresh:
Then I click selector "#versions-header ~ div"
Copy link
Contributor

Choose a reason for hiding this comment

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

I've never seen the general sibling combinator selector before. TIL.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for adding a UI test covering this behavior. I wonder if there's any way around the iframe stuff - you'd think the selenium driver, since it simulates user interactions, could reach anything loaded on the page (though it makes sense that our javascript-dependent steps wouldn't work).

@cpirich cpirich merged commit 7ade437 into staging Dec 15, 2017
@cpirich cpirich deleted the weblab_fix_start_over_plus_version_history_test branch December 15, 2017 18:59
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.

None yet

2 participants