Skip to content

Commit

Permalink
Merge pull request #40693 from code-dot-org/stage-to-lesson-feature-f…
Browse files Browse the repository at this point in the history
…iles

Stage to lesson in .feature files
  • Loading branch information
dmcavoy committed May 21, 2021
2 parents fcb4d5f + aa9f083 commit 9115919
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 94 deletions.
4 changes: 2 additions & 2 deletions dashboard/test/ui/features/hour_of_code/hour_of_code.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Scenario: Solving puzzle 1, proceeding to puzzle 2, verifying that puzzle 1 appe
# Course overview should also show progress
Then I navigate to the course page for "hourofcode"
And I wait for 2 seconds
And I verify progress for stage 1 level 1 is "perfect"
And I verify progress for lesson 1 level 1 is "perfect"
# Course overview in a different script shouldn't show progress
Then I am on "http://studio.code.org/s/20-hour/lessons/2/levels/2?noautoplay=true"
Then I wait until I am on "http://studio.code.org/s/20-hour/lessons/2/levels/2?noautoplay=true"
Expand Down Expand Up @@ -47,7 +47,7 @@ Scenario: Failing at puzzle 1, refreshing puzzle 1, bubble should show up as att
And I verify progress in the header of the current page is "attempted" for level 1
And I navigate to the course page for "hourofcode"
And I wait for 2 seconds
And I verify progress for stage 1 level 1 is "attempted"
And I verify progress for lesson 1 level 1 is "attempted"

@no_mobile
Scenario: Go to puzzle 10, see video, go somewhere else, return to puzzle 10, should not see video, comes back on link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Scenario:
# Course overview should also show progress
Then I navigate to the course page for "hourofcode"
And I wait until jQuery Ajax requests are finished
And I verify progress for stage 1 level 1 is "perfect"
And I verify progress for lesson 1 level 1 is "perfect"
# Course overview in a different script shouldn't show progress
Then I am on "http://studio.code.org/s/20-hour/lessons/2/levels/2?noautoplay=true"
And I verify progress in the header of the current page is "not_tried" for level 1
Expand Down Expand Up @@ -53,7 +53,7 @@ Scenario: Async progress write followed by a stale read
And I wait for 3 seconds
And I navigate to the course page for "hourofcode"
And I wait until jQuery Ajax requests are finished
And I verify progress for stage 1 level 20 is "not_tried"
And I verify progress for lesson 1 level 20 is "not_tried"

Scenario: Progress on the server that is not on the client
Given I am on "http://studio.code.org/hoc/20?noautoplay=true"
Expand All @@ -67,7 +67,7 @@ Scenario: Progress on the server that is not on the client
And I verify progress in the header of the current page is "attempted" for level 20
And I navigate to the course page for "hourofcode"
And I wait until jQuery Ajax requests are finished
And I verify progress for stage 1 level 20 is "attempted"
And I verify progress for lesson 1 level 20 is "attempted"

@no_mobile
Scenario: Go to puzzle 10, see video, go somewhere else, return to puzzle 10, should not see video
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Lesson extras teacher panel
Then I save the section id from row 0 of the section table

# Lesson extras overview page
Then I navigate to the script "coursea-2018" stage 14 lesson extras page for the section I saved
Then I navigate to the script "coursea-2018" lesson 14 lesson extras page for the section I saved
And I wait until element "#teacher-panel-container" is visible
And check that the URL contains "section_id="
And I wait until element ".uitest-sectionselect:contains(Untitled Section)" is visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Scenario: Stage Locking Dialog
Then I sign in as "Teacher_bobby"
Then I am on "http://studio.code.org/s/allthethings"
And I see no difference for "selected section"
Then I open the stage lock dialog
Then I open the lesson lock dialog
And I see no difference for "stage lock dialog"
Then I unlock the stage for students
Then I unlock the lesson for students
And I wait until element ".modal-backdrop" is gone
And I scroll our lockable stage into view
And I scroll our lockable lesson into view
And I see no difference for "course overview for authorized teacher"
And I close my eyes

Expand All @@ -37,8 +37,8 @@ Scenario: Lock settings for students
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I unlock the stage for students
And I open the lesson lock dialog
And I unlock the lesson for students
And I wait until element ".modal-backdrop" is gone

# now unlocked/not tried for student
Expand All @@ -48,10 +48,10 @@ Scenario: Lock settings for students
And I wait until element "td:contains(Anonymous student survey 2)" is visible
And I wait until jQuery Ajax requests are finished
Then element "td:contains(Anonymous student survey 2) .fa-unlock" is visible
Then I verify progress for stage 31 level 1 is "not_tried"
Then I verify progress for stage 31 level 2 is "not_tried"
Then I verify progress for stage 31 level 3 is "not_tried"
Then I verify progress for stage 31 level 4 is "not_tried"
Then I verify progress for lesson 31 level 1 is "not_tried"
Then I verify progress for lesson 31 level 2 is "not_tried"
Then I verify progress for lesson 31 level 3 is "not_tried"
Then I verify progress for lesson 31 level 4 is "not_tried"

# student submits

Expand All @@ -74,8 +74,8 @@ Scenario: Lock settings for students
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I show stage answers for students
And I open the lesson lock dialog
And I show lesson answers for students
And I wait until element ".modal-backdrop" is gone

# now unlocked/submitted for student
Expand All @@ -85,10 +85,10 @@ Scenario: Lock settings for students
And I wait until element "td:contains(Anonymous student survey 2)" is visible
And I wait until jQuery Ajax requests are finished
Then element "td:contains(Anonymous student survey 2) .fa-unlock" is visible
Then I verify progress for stage 31 level 1 is "not_tried"
Then I verify progress for stage 31 level 2 is "not_tried"
Then I verify progress for stage 31 level 3 is "not_tried"
Then I verify progress for stage 31 level 4 is "not_tried"
Then I verify progress for lesson 31 level 1 is "not_tried"
Then I verify progress for lesson 31 level 2 is "not_tried"
Then I verify progress for lesson 31 level 3 is "not_tried"
Then I verify progress for lesson 31 level 4 is "not_tried"

When I am on "http://studio.code.org/s/allthethings/lockable/1/levels/1/page/4"
And I wait until element "h2:contains(Pre-survey)" is visible
Expand All @@ -115,8 +115,8 @@ Scenario: Lock settings for students who never submit
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I unlock the stage for students
And I open the lesson lock dialog
And I unlock the lesson for students
And I wait until element ".modal-backdrop" is gone

# now unlocked/not tried for student
Expand All @@ -126,19 +126,19 @@ Scenario: Lock settings for students who never submit
And I wait until element "td:contains(Anonymous student survey 2)" is visible
And I wait until jQuery Ajax requests are finished
Then element "td:contains(Anonymous student survey 2) .fa-unlock" is visible
Then I verify progress for stage 31 level 1 is "not_tried"
Then I verify progress for stage 31 level 2 is "not_tried"
Then I verify progress for stage 31 level 3 is "not_tried"
Then I verify progress for stage 31 level 4 is "not_tried"
Then I verify progress for lesson 31 level 1 is "not_tried"
Then I verify progress for lesson 31 level 2 is "not_tried"
Then I verify progress for lesson 31 level 3 is "not_tried"
Then I verify progress for lesson 31 level 4 is "not_tried"

# student does not submit assessment before teacher switches to readonly

And I sign in as "Teacher_billy"
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I show stage answers for students
And I open the lesson lock dialog
And I show lesson answers for students
And I wait until element ".modal-backdrop" is gone

# now unlocked/not submitted for student
Expand All @@ -148,10 +148,10 @@ Scenario: Lock settings for students who never submit
And I wait until element "td:contains(Anonymous student survey 2)" is visible
And I wait until jQuery Ajax requests are finished
Then element "td:contains(Anonymous student survey 2) .fa-unlock" is visible
Then I verify progress for stage 31 level 1 is "not_tried"
Then I verify progress for stage 31 level 2 is "not_tried"
Then I verify progress for stage 31 level 3 is "not_tried"
Then I verify progress for stage 31 level 4 is "not_tried"
Then I verify progress for lesson 31 level 1 is "not_tried"
Then I verify progress for lesson 31 level 2 is "not_tried"
Then I verify progress for lesson 31 level 3 is "not_tried"
Then I verify progress for lesson 31 level 4 is "not_tried"

Scenario: Lock settings for retake not submit scenario
# initially locked for student in summary view
Expand All @@ -171,8 +171,8 @@ Scenario: Lock settings for retake not submit scenario
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I unlock the stage for students
And I open the lesson lock dialog
And I unlock the lesson for students
And I wait until element ".modal-backdrop" is gone

# now unlocked/not tried for student
Expand All @@ -182,19 +182,19 @@ Scenario: Lock settings for retake not submit scenario
And I wait until element "td:contains(Anonymous student survey 2)" is visible
And I wait until jQuery Ajax requests are finished
Then element "td:contains(Anonymous student survey 2) .fa-unlock" is visible
Then I verify progress for stage 31 level 1 is "not_tried"
Then I verify progress for stage 31 level 2 is "not_tried"
Then I verify progress for stage 31 level 3 is "not_tried"
Then I verify progress for stage 31 level 4 is "not_tried"
Then I verify progress for lesson 31 level 1 is "not_tried"
Then I verify progress for lesson 31 level 2 is "not_tried"
Then I verify progress for lesson 31 level 3 is "not_tried"
Then I verify progress for lesson 31 level 4 is "not_tried"

# student does not submit assessment before teacher switches to locked

And I sign in as "Teacher_babby"
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I lock the stage for students
And I open the lesson lock dialog
And I lock the lesson for students
And I wait until element ".modal-backdrop" is gone

# now locked/not submitted for student
Expand All @@ -211,8 +211,8 @@ Scenario: Lock settings for retake not submit scenario
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I unlock the stage for students
And I open the lesson lock dialog
And I unlock the lesson for students
And I wait until element ".modal-backdrop" is gone

# now editable, and student can submit
Expand Down Expand Up @@ -253,8 +253,8 @@ Scenario: Lock settings for retake after submit scenario
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I unlock the stage for students
And I open the lesson lock dialog
And I unlock the lesson for students
And I wait until element ".modal-backdrop" is gone

# student submits
Expand All @@ -264,10 +264,10 @@ Scenario: Lock settings for retake after submit scenario
And I wait until element "td:contains(Anonymous student survey 2)" is visible
And I wait until jQuery Ajax requests are finished
Then element "td:contains(Anonymous student survey 2) .fa-unlock" is visible
Then I verify progress for stage 31 level 1 is "not_tried"
Then I verify progress for stage 31 level 2 is "not_tried"
Then I verify progress for stage 31 level 3 is "not_tried"
Then I verify progress for stage 31 level 4 is "not_tried"
Then I verify progress for lesson 31 level 1 is "not_tried"
Then I verify progress for lesson 31 level 2 is "not_tried"
Then I verify progress for lesson 31 level 3 is "not_tried"
Then I verify progress for lesson 31 level 4 is "not_tried"
When I am on "http://studio.code.org/s/allthethings/lockable/1/levels/1/page/4"
And I click selector ".submitButton" once I see it
And I wait to see a dialog titled "Submit your survey"
Expand All @@ -287,8 +287,8 @@ Scenario: Lock settings for retake after submit scenario
And I am on "http://studio.code.org/s/allthethings"
# Wait until detail view loads
And I wait until element "span:contains(Lesson 1: Jigsaw)" is visible
And I open the stage lock dialog
And I unlock the stage for students
And I open the lesson lock dialog
And I unlock the lesson for students
And I wait until element ".modal-backdrop" is gone

# now editable, and student can see unsubmit button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feature: BubbleChoice
And I wait until current URL contains "user_id="
And I wait until element "td:contains(Lesson Name)" is visible
And I wait until element "td:contains(Bubble Choice)" is visible
Then I verify progress for stage 42 level 1 is "perfect"
Then I verify progress for lesson 42 level 1 is "perfect"

# View progress from BubbleChoice activity page
Given I am on "http://studio.code.org/s/allthethings/lessons/40/levels/1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ Scenario: Submit three pages as... 1. all, 2. none, 3. some questions answered.

# Open the dropdown and verify the same three dots.
Then I open the progress drop down of the current page
And I verify progress in the drop down of the current page is "perfect_assessment" for stage 23 level 2
And I verify progress in the drop down of the current page is "not_tried" for stage 23 level 3
And I verify progress in the drop down of the current page is "attempted_assessment" for stage 23 level 4
And I verify progress in the drop down of the current page is "perfect_assessment" for lesson 23 level 2
And I verify progress in the drop down of the current page is "not_tried" for lesson 23 level 3
And I verify progress in the drop down of the current page is "attempted_assessment" for lesson 23 level 4

# Go to the course page and verify the same three dots.
Then I navigate to the course page for "allthethings"
And I wait until jQuery Ajax requests are finished
And I verify progress for stage 23 level 2 is "perfect_assessment"
And I verify progress for stage 23 level 3 is "not_tried"
And I verify progress for stage 23 level 4 is "attempted_assessment"
And I verify progress for lesson 23 level 2 is "perfect_assessment"
And I verify progress for lesson 23 level 3 is "not_tried"
And I verify progress for lesson 23 level 4 is "attempted_assessment"

# Submit the assessment.
When I am on "http://studio.code.org/s/allthethings/lessons/23/levels/2/page/3?noautoplay=true"
Expand All @@ -81,16 +81,16 @@ Scenario: Submit three pages as... 1. all, 2. none, 3. some questions answered.

# Open the dropdown and verify the same three dots.
Then I open the progress drop down of the current page
And I verify progress in the drop down of the current page is "perfect_assessment" for stage 23 level 2
And I verify progress in the drop down of the current page is "not_tried" for stage 23 level 3
And I verify progress in the drop down of the current page is "attempted_assessment" for stage 23 level 4
And I verify progress in the drop down of the current page is "perfect_assessment" for lesson 23 level 2
And I verify progress in the drop down of the current page is "not_tried" for lesson 23 level 3
And I verify progress in the drop down of the current page is "attempted_assessment" for lesson 23 level 4

# Go to the course page and verify the same three dots.
Then I navigate to the course page for "allthethings"
And I wait until jQuery Ajax requests are finished
And I verify progress for stage 23 level 2 is "perfect_assessment"
And I verify progress for stage 23 level 3 is "not_tried"
And I verify progress for stage 23 level 4 is "attempted_assessment"
And I verify progress for lesson 23 level 2 is "perfect_assessment"
And I verify progress for lesson 23 level 3 is "not_tried"
And I verify progress for lesson 23 level 4 is "attempted_assessment"

Scenario: optional free play level
When element ".level-group-content:nth(0) .multi-question" contains text "Which arrow gets"
Expand Down
8 changes: 4 additions & 4 deletions dashboard/test/ui/features/learning_platform/progress.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Feature: Level Progress
When I am on "http://studio.code.org/s/allthethings"
And I wait until element "td:contains(Maze)" is visible
And I wait for 2 seconds
Then I verify progress for stage 2 level 1 is "perfect"
And I verify progress for stage 2 level 2 is "not_tried"
Then I verify progress for lesson 2 level 1 is "perfect"
And I verify progress for lesson 2 level 2 is "not_tried"

Scenario: Progress is saved for signed-out student
Given I am not signed in
Expand All @@ -35,5 +35,5 @@ Feature: Level Progress
When I am on "http://studio.code.org/s/allthethings"
And I wait until element "td:contains(Maze)" is visible
And I wait for 2 seconds
Then I verify progress for stage 2 level 1 is "perfect"
And I verify progress for stage 2 level 2 is "not_tried"
Then I verify progress for lesson 2 level 1 is "perfect"
And I verify progress for lesson 2 level 2 is "not_tried"
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Feature: Script overview page
And I wait until element "td:contains(Maze)" is visible
And I wait until element ".teacher-panel" is not visible
And I wait for 2 seconds
Then I verify progress for stage 2 level 1 is "perfect"
Then I verify progress for stage 2 level 2 is "not_tried"
Then I verify progress for lesson 2 level 1 is "perfect"
Then I verify progress for lesson 2 level 2 is "not_tried"
And I sign out

# Verify progress as teacher viewing themself and student on script overview page
Expand All @@ -21,15 +21,15 @@ Feature: Script overview page
And I am on "http://studio.code.org/s/allthethings"
And I wait until element ".teacher-panel" is visible
And I wait until jQuery Ajax requests are finished
Then I verify progress for stage 29 level 4 is "perfect"
Then I verify progress for lesson 29 level 4 is "perfect"
When I click selector ".teacher-panel table td:contains(Sally)" once I see it
And I wait until element "td:contains(Maze)" is visible
And I wait for 2 seconds
Then I verify progress for stage 2 level 1 is "perfect"
Then I verify progress for stage 2 level 2 is "not_tried"
Then I verify progress for lesson 2 level 1 is "perfect"
Then I verify progress for lesson 2 level 2 is "not_tried"

# Make sure we only see student progress, not teacher progress.
Then I verify progress for stage 29 level 4 is "not_tried"
Then I verify progress for lesson 29 level 4 is "not_tried"

Scenario: Script overview contents
Given I create a student named "Jean"
Expand All @@ -47,5 +47,5 @@ Feature: Script overview page

And I am on "http://studio.code.org/s/mc"
And I wait until element "td:contains(Minecraft)" is visible
# verify script name overrides stage name when there is only one stage
# verify script name overrides lesson name when there is only one lesson
And element "td:contains(1. Minecraft Hour of Code)" is visible

0 comments on commit 9115919

Please sign in to comment.