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
Improve testing around joining a section LP-1688 #38570
Conversation
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.
Very nice, thanks for adding these!
@@ -1448,6 +1456,13 @@ def create_user(name, url: '/users.json', code: 201, **user_opts) | |||
} | |||
end | |||
|
|||
# press keys allows React to pick up on the changes | |||
And(/I press the keys of the section code into "([^"]*)"$/) do |selector| |
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.
I think calling this "I enter the section code ____ into ____" might be a little bit more readable when it's used. (Also, where is this used?)
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.
Used on line 240 of the UI test file. Since the section code is randomly generated in the Ruby file (steps.rb
), I have no way of accessing that info from the UI test unless I create this additional step that parses the section URL for the section code and uses "press keys" to enter it into the React form.
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.
Ah, I see. I might still use "enter the section code into" instead of "press the keys of the section code into" for better readability where it's used? Up to you.
@@ -1402,6 +1402,14 @@ def create_user(name, url: '/users.json', code: 201, **user_opts) | |||
end | |||
end | |||
|
|||
And(/^I join the section I already own$/) do | |||
page_load(true) do |
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.
Does this differ from "I attempt to join the section" only by this page_load? If so, why is having this page_load important?
And I press the keys of the section code into "input.ui-test-join-section" | ||
And I click selector "div.ui-test-join-section" | ||
Then I wait until element ".announcement-notification" is visible | ||
And element ".announcement-notification" contains text matching "You are already the owner of section" |
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.
nit: add newline at end of line
Additional unit and integration tests to expand test coverage around joining sections. A follow up to #38225 - while #38225 focused on adding an integration test for joining a section through
/join/:section_code
, this PR focuses on joining sections through theJoinSection
component on the student and teacher dashboard.I also added a test for a new type of
JoinSectionNotification
introduced in #38493Links
Testing story
Ran tests locally
Resolved: Still having an issue getting React state to update based on form changes made in the UI test starting on line 225 in
teacher_dashboad.feature
. Hopefully I'll get that resolved shortly -- posted a question to the group in Slack.Reviewer Checklist: