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

Add question deletion scenario to quiz management feature #1014

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Feature: Quiz Question Management
| What does a cow say? | moo |
| What do you call a cow with not leg? | Ground beef |

Scenario: Manually delete a question from the note successfully
When I delete a question with the stem "What does a cow say?" for the note "The cow joke"
Then I should see the questions in the question list of the note "The cow joke":

@ignore
Scenario: Reset approval on new question
Given I am logged in as an admin
And I have a notebook with the head note "The cow joke"
Expand Down
3 changes: 3 additions & 0 deletions e2e_test/start/pageObjects/questionListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { addQuestionPage } from './addQuestionPage'
export const questionListPage = () => {
return {
addQuestionPage,
deleteQuestion(stem: string) {
cy.findByText(stem).parent('tr').findByText('Delete').click()
},
expectQuestion(expectedQuestions: Record<string, string>[]) {
expectedQuestions.forEach((row) => {
cy.findByText(row.Question!)
Expand Down
10 changes: 10 additions & 0 deletions e2e_test/step_definitions/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ Given(
}
)

When(
'I delete a question with the stem {string} for the note {string}',
(questionStem: string, noteTopic: string) => {
start
.jumpToNotePage(noteTopic)
.openQuestionList()
.deleteQuestion(questionStem)
}
)

Given(
'I refine the following question for the note {string}:',
(noteTopic: string, data: DataTable) => {
Expand Down